We consider the system from. Alphabet: chain : [N -> N * list] --> list cons : [N * list] --> list false : [] --> B from : [N * list] --> list if : [B * list * list] --> list incch : [list] --> list lteq : [N * N] --> B nil : [] --> list o : [] --> N s : [N] --> N true : [] --> B Rules: if(true, x, y) => x if(false, x, y) => y lteq(s(x), o) => false lteq(o, x) => true lteq(s(x), s(y)) => lteq(x, y) from(x, nil) => nil from(x, cons(y, z)) => if(lteq(x, y), cons(y, z), from(x, z)) chain(f, nil) => nil chain(f, cons(x, y)) => cons(f x, chain(f, from(f x, y))) incch(x) => chain(/\y.s(y), x) 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] lteq#(s(X), s(Y)) =#> lteq#(X, Y) 1] from#(X, cons(Y, Z)) =#> if#(lteq(X, Y), cons(Y, Z), from(X, Z)) 2] from#(X, cons(Y, Z)) =#> lteq#(X, Y) 3] from#(X, cons(Y, Z)) =#> from#(X, Z) 4] chain#(F, cons(X, Y)) =#> chain#(F, from(F X, Y)) 5] chain#(F, cons(X, Y)) =#> from#(F X, Y) 6] incch#(X) =#> chain#(/\x.s(x), X) Rules R_0: if(true, X, Y) => X if(false, X, Y) => Y lteq(s(X), o) => false lteq(o, X) => true lteq(s(X), s(Y)) => lteq(X, Y) from(X, nil) => nil from(X, cons(Y, Z)) => if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, nil) => nil chain(F, cons(X, Y)) => cons(F X, chain(F, from(F X, Y))) incch(X) => chain(/\x.s(x), X) 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 place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 0 * 1 : * 2 : 0 * 3 : 1, 2, 3 * 4 : 4, 5 * 5 : 1, 2, 3 * 6 : 4, 5 This graph has the following strongly connected components: P_1: lteq#(s(X), s(Y)) =#> lteq#(X, Y) P_2: from#(X, cons(Y, Z)) =#> from#(X, Z) P_3: chain#(F, cons(X, Y)) =#> chain#(F, from(F X, Y)) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_0, R_0, m, f) by (P_1, R_0, m, f), (P_2, R_0, m, f) and (P_3, R_0, m, f). Thus, the original system is terminating if each of (P_1, R_0, static, formative), (P_2, R_0, static, formative) and (P_3, R_0, static, formative) is finite. We consider the dependency pair problem (P_3, 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: chain#(F, cons(X, Y)) >? chain#(F, from(F X, Y)) if(true, X, Y) >= X if(false, X, Y) >= Y lteq(s(X), o) >= false lteq(o, X) >= true lteq(s(X), s(Y)) >= lteq(X, Y) from(X, nil) >= nil from(X, cons(Y, Z)) >= if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, nil) >= nil chain(F, cons(X, Y)) >= cons(F X, chain(F, from(F X, Y))) incch(X) >= chain(/\x.s(x), X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( incch(X) ) = #argfun-incch#(chain(/\x.s(x), X)) 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: [[#argfun-incch#(x_1)]] = x_1 [[chain#(x_1, x_2)]] = x_2 [[false]] = _|_ [[from(x_1, x_2)]] = from(x_2) [[if(x_1, x_2, x_3)]] = if(x_2, x_3) [[incch(x_1)]] = x_1 [[lteq(x_1, x_2)]] = lteq [[true]] = _|_ We choose Lex = {} and Mul = {@_{o -> o}, chain, cons, from, if, lteq, nil, o, s}, and the following precedence: lteq > nil > o > s > chain > cons > from > if > @_{o -> o} Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: cons(X, Y) > from(Y) if(X, Y) >= X if(X, Y) >= Y lteq >= _|_ lteq >= _|_ lteq >= lteq from(nil) >= nil from(cons(X, Y)) >= if(cons(X, Y), from(Y)) chain(F, nil) >= nil chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) chain(/\x.s(x), X) >= chain(/\x.s(x), X) With these choices, we have: 1] cons(X, Y) > from(Y) because [2], by definition 2] cons*(X, Y) >= from(Y) because cons > from and [3], by (Copy) 3] cons*(X, Y) >= Y because [4], by (Select) 4] Y >= Y by (Meta) 5] if(X, Y) >= X because [6], by (Star) 6] if*(X, Y) >= X because [7], by (Select) 7] X >= X by (Meta) 8] if(X, Y) >= Y because [9], by (Star) 9] if*(X, Y) >= Y because [10], by (Select) 10] Y >= Y by (Meta) 11] lteq >= _|_ by (Bot) 12] lteq >= _|_ by (Bot) 13] lteq >= lteq because lteq in Mul, by (Fun) 14] from(nil) >= nil because [15], by (Star) 15] from*(nil) >= nil because [16], by (Select) 16] nil >= nil by (Fun) 17] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [18], by (Star) 18] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [19] and [23], by (Copy) 19] from*(cons(X, Y)) >= cons(X, Y) because [20], by (Select) 20] cons(X, Y) >= cons(X, Y) because cons in Mul, [21] and [22], by (Fun) 21] X >= X by (Meta) 22] Y >= Y by (Meta) 23] from*(cons(X, Y)) >= from(Y) because [24], by (Select) 24] cons(X, Y) >= from(Y) because [25], by (Star) 25] cons*(X, Y) >= from(Y) because cons > from and [26], by (Copy) 26] cons*(X, Y) >= Y because [22], by (Select) 27] chain(F, nil) >= nil because [28], by (Star) 28] chain*(F, nil) >= nil because [16], by (Select) 29] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [30], by (Star) 30] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [31] and [38], by (Copy) 31] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [32] and [34], by (Copy) 32] chain*(F, cons(X, Y)) >= F because [33], by (Select) 33] F >= F by (Meta) 34] chain*(F, cons(X, Y)) >= X because [35], by (Select) 35] cons(X, Y) >= X because [36], by (Star) 36] cons*(X, Y) >= X because [37], by (Select) 37] X >= X by (Meta) 38] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [39] and [40], by (Stat) 39] F >= F by (Meta) 40] cons(X, Y) > from(Y) because [2], by definition 41] chain(/\x.s(x), X) >= chain(/\x.s(x), X) because chain in Mul, [42] and [45], by (Fun) 42] /\y.s(y) >= /\y.s(y) because [43], by (Abs) 43] s(x) >= s(x) because s in Mul and [44], by (Fun) 44] x >= x by (Var) 45] X >= X by (Meta) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_3, R_0) by ({}, R_0). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, static, formative) and (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 with usable rules [Kop12, Thm. 7.44]. (P_2, R_0) has no usable rules. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: from#(X, cons(Y, Z)) >? from#(X, Z) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: cons = \y0y1.1 + 2y1 from# = \y0y1.y1 Using this interpretation, the requirements translate to: [[from#(_x0, cons(_x1, _x2))]] = 1 + 2x2 > x2 = [[from#(_x0, _x2)]] 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. 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 with usable rules [Kop12, Thm. 7.44]. (P_1, R_0) has no usable rules. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: lteq#(s(X), s(Y)) >? lteq#(X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: lteq# = \y0y1.y0 + y1 s = \y0.3 + 2y0 Using this interpretation, the requirements translate to: [[lteq#(s(_x0), s(_x1))]] = 6 + 2x0 + 2x1 > x0 + x1 = [[lteq#(_x0, _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_1, 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.