We consider the system AotoYamada_05__015. Alphabet: cons : [a * c] --> c false : [] --> b filter : [a -> b * c] --> c if : [b * c * c] --> c nil : [] --> c true : [] --> b Rules: if(true, x, y) => x if(false, x, y) => y filter(f, nil) => nil filter(f, cons(x, y)) => if(f x, cons(x, filter(f, y)), filter(f, y)) This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). We use the dependency pair framework as described in [Kop12, Ch. 6/7], with static dependency pairs (see [KusIsoSakBla09] and the adaptation for AFSMs and accessible arguments in [Kop13]). We thus obtain the following dependency pair problem (P_0, R_0, static, formative): Dependency Pairs P_0: 0] filter#(F, cons(X, Y)) =#> if#(F X, cons(X, filter(F, Y)), filter(F, Y)) 1] filter#(F, cons(X, Y)) =#> filter#(F, Y) 2] filter#(F, cons(X, Y)) =#> filter#(F, Y) Rules R_0: if(true, X, Y) => X if(false, X, Y) => Y filter(F, nil) => nil filter(F, cons(X, Y)) => if(F X, cons(X, filter(F, Y)), filter(F, Y)) Thus, the original system is terminating if (P_0, R_0, static, formative) is finite. We consider the dependency pair problem (P_0, R_0, static, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: filter#(F, cons(X, Y)) >? if#(F X, cons(X, filter(F, Y)), filter(F, Y)) filter#(F, cons(X, Y)) >? filter#(F, Y) filter#(F, cons(X, Y)) >? filter#(F, Y) if(true, X, Y) >= X if(false, X, Y) >= Y filter(F, nil) >= nil filter(F, cons(X, Y)) >= if(F X, cons(X, filter(F, Y)), filter(F, Y)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: cons = \y0y1.0 false = 0 filter = \G0y1.2 filter# = \G0y1.3 if = \y0y1y2.y1 + y2 if# = \y0y1y2.0 nil = 0 true = 0 Using this interpretation, the requirements translate to: [[filter#(_F0, cons(_x1, _x2))]] = 3 > 0 = [[if#(_F0 _x1, cons(_x1, filter(_F0, _x2)), filter(_F0, _x2))]] [[filter#(_F0, cons(_x1, _x2))]] = 3 >= 3 = [[filter#(_F0, _x2)]] [[filter#(_F0, cons(_x1, _x2))]] = 3 >= 3 = [[filter#(_F0, _x2)]] [[if(true, _x0, _x1)]] = x0 + x1 >= x0 = [[_x0]] [[if(false, _x0, _x1)]] = x0 + x1 >= x1 = [[_x1]] [[filter(_F0, nil)]] = 2 >= 0 = [[nil]] [[filter(_F0, cons(_x1, _x2))]] = 2 >= 2 = [[if(_F0 _x1, cons(_x1, filter(_F0, _x2)), filter(_F0, _x2))]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_0, R_0, static, formative) by (P_1, R_0, static, formative), where P_1 consists of: filter#(F, cons(X, Y)) =#> filter#(F, Y) filter#(F, cons(X, Y)) =#> filter#(F, Y) Thus, the original system is terminating if (P_1, R_0, static, formative) is finite. We consider the dependency pair problem (P_1, R_0, static, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: filter#(F, cons(X, Y)) >? filter#(F, Y) filter#(F, cons(X, Y)) >? filter#(F, Y) if(true, X, Y) >= X if(false, X, Y) >= Y filter(F, nil) >= nil filter(F, cons(X, Y)) >= if(F X, cons(X, filter(F, Y)), filter(F, Y)) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {@_{o -> o}, cons, false, filter, filter#, if, nil, true}, and the following precedence: false > filter# > filter > @_{o -> o} > cons > if > nil > true With these choices, we have: 1] filter#(F, cons(X, Y)) >= filter#(F, Y) because [2], by (Star) 2] filter#*(F, cons(X, Y)) >= filter#(F, Y) because filter# in Mul, [3] and [4], by (Stat) 3] F >= F by (Meta) 4] cons(X, Y) > Y because [5], by definition 5] cons*(X, Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] filter#(F, cons(X, Y)) > filter#(F, Y) because [8], by definition 8] filter#*(F, cons(X, Y)) >= filter#(F, Y) because filter# in Mul, [3] and [4], by (Stat) 9] if(true, X, Y) >= X because [10], by (Star) 10] if*(true, X, Y) >= X because [11], by (Select) 11] X >= X by (Meta) 12] if(false, X, Y) >= Y because [13], by (Star) 13] if*(false, X, Y) >= Y because [14], by (Select) 14] Y >= Y by (Meta) 15] filter(F, nil) >= nil because [16], by (Star) 16] filter*(F, nil) >= nil because filter > nil, by (Copy) 17] filter(F, cons(X, Y)) >= if(@_{o -> o}(F, X), cons(X, filter(F, Y)), filter(F, Y)) because [18], by (Star) 18] filter*(F, cons(X, Y)) >= if(@_{o -> o}(F, X), cons(X, filter(F, Y)), filter(F, Y)) because filter > if, [19], [25] and [26], by (Copy) 19] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [20] and [21], by (Copy) 20] filter*(F, cons(X, Y)) >= F because [3], by (Select) 21] filter*(F, cons(X, Y)) >= X because [22], by (Select) 22] cons(X, Y) >= X because [23], by (Star) 23] cons*(X, Y) >= X because [24], by (Select) 24] X >= X by (Meta) 25] filter*(F, cons(X, Y)) >= cons(X, filter(F, Y)) because filter > cons, [21] and [26], by (Copy) 26] filter*(F, cons(X, Y)) >= filter(F, Y) because filter in Mul, [3] and [4], by (Stat) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_0, static, formative) by (P_2, R_0, static, formative), where P_2 consists of: filter#(F, cons(X, Y)) =#> filter#(F, Y) Thus, the original system is terminating if (P_2, R_0, static, formative) is finite. We consider the dependency pair problem (P_2, R_0, static, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: filter#(F, cons(X, Y)) >? filter#(F, Y) if(true, X, Y) >= X if(false, X, Y) >= Y filter(F, nil) >= nil filter(F, cons(X, Y)) >= if(F X, cons(X, filter(F, Y)), filter(F, Y)) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {@_{o -> o}, cons, false, filter, filter#, if, true}, and the following precedence: false > filter# > filter > @_{o -> o} > cons > if > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: filter#(F, cons(X, Y)) > filter#(F, Y) if(true, X, Y) >= X if(false, X, Y) >= Y filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= if(@_{o -> o}(F, X), cons(X, filter(F, Y)), filter(F, Y)) With these choices, we have: 1] filter#(F, cons(X, Y)) > filter#(F, Y) because [2], by definition 2] filter#*(F, cons(X, Y)) >= filter#(F, Y) because filter# in Mul, [3] and [4], by (Stat) 3] F >= F by (Meta) 4] cons(X, Y) > Y because [5], by definition 5] cons*(X, Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] if(true, X, Y) >= X because [8], by (Star) 8] if*(true, X, Y) >= X because [9], by (Select) 9] X >= X by (Meta) 10] if(false, X, Y) >= Y because [11], by (Star) 11] if*(false, X, Y) >= Y because [12], by (Select) 12] Y >= Y by (Meta) 13] filter(F, _|_) >= _|_ by (Bot) 14] filter(F, cons(X, Y)) >= if(@_{o -> o}(F, X), cons(X, filter(F, Y)), filter(F, Y)) because [15], by (Star) 15] filter*(F, cons(X, Y)) >= if(@_{o -> o}(F, X), cons(X, filter(F, Y)), filter(F, Y)) because filter > if, [16], [22] and [23], by (Copy) 16] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [17] and [18], by (Copy) 17] filter*(F, cons(X, Y)) >= F because [3], by (Select) 18] filter*(F, cons(X, Y)) >= X because [19], by (Select) 19] cons(X, Y) >= X because [20], by (Star) 20] cons*(X, Y) >= X because [21], by (Select) 21] X >= X by (Meta) 22] filter*(F, cons(X, Y)) >= cons(X, filter(F, Y)) because filter > cons, [18] and [23], by (Copy) 23] filter*(F, cons(X, Y)) >= filter(F, Y) because filter in Mul, [3] and [4], by (Stat) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_2, R_0) by ({}, R_0). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. As all dependency pair problems were succesfully simplified with sound (and complete) processors until nothing remained, we conclude termination. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. [Kop13] C. Kop. Static Dependency Pairs with Accessibility. Unpublished manuscript, http://cl-informatik.uibk.ac.at/users/kop/static.pdf, 2013. [KusIsoSakBla09] K. Kusakari, Y. Isogai, M. Sakai, and F. Blanqui. Static Dependency Pair Method Based On Strong Computability for Higher-Order Rewrite Systems. In volume 92(10) of IEICE Transactions on Information and Systems. 2007--2015, 2009.