We consider the system AotoYamada_05__014. Alphabet: 0 : [] --> b cons : [b * a] --> a double : [] --> a -> a inc : [] --> a -> a map : [b -> b] --> a -> a nil : [] --> a plus : [b] --> b -> b s : [b] --> b times : [b] --> b -> b Rules: plus(0) x => x plus(s(x)) y => s(plus(x) y) times(0) x => 0 times(s(x)) y => plus(times(x) y) y map(f) nil => nil map(f) cons(x, y) => cons(f x, map(f) y) inc => map(plus(s(0))) double => map(times(s(s(0)))) 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]). In order to do so, we start by eta-expanding the system, which gives: plus(0, X) => X plus(s(X), Y) => s(plus(X, Y)) times(0, X) => 0 times(s(X), Y) => plus(times(X, Y), Y) map(F, nil) => nil map(F, cons(X, Y)) => cons(F X, map(F, Y)) inc(X) => map(/\x.plus(s(0), x), X) double(X) => map(/\x.times(s(s(0)), x), X) We thus obtain the following dependency pair problem (P_0, R_0, static, formative): Dependency Pairs P_0: 0] plus#(s(X), Y) =#> plus#(X, Y) 1] times#(s(X), Y) =#> plus#(times(X, Y), Y) 2] times#(s(X), Y) =#> times#(X, Y) 3] map#(F, cons(X, Y)) =#> map#(F, Y) 4] inc#(X) =#> map#(/\x.plus(s(0), x), X) 5] inc#(X) =#> plus#(s(0), Y) 6] double#(X) =#> map#(/\x.times(s(s(0)), x), X) 7] double#(X) =#> times#(s(s(0)), Y) Rules R_0: plus(0, X) => X plus(s(X), Y) => s(plus(X, Y)) times(0, X) => 0 times(s(X), Y) => plus(times(X, Y), Y) map(F, nil) => nil map(F, cons(X, Y)) => cons(F X, map(F, Y)) inc(X) => map(/\x.plus(s(0), x), X) double(X) => map(/\x.times(s(s(0)), 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). The formative rules of (P_0, R_0) are R_1 ::= plus(0, X) => X plus(s(X), Y) => s(plus(X, Y)) times(0, X) => 0 times(s(X), Y) => plus(times(X, Y), Y) map(F, cons(X, Y)) => cons(F X, map(F, Y)) inc(X) => map(/\x.plus(s(0), x), X) double(X) => map(/\x.times(s(s(0)), x), X) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_0, R_0, static, formative) by (P_0, R_1, static, formative). Thus, the original system is terminating if (P_0, R_1, static, formative) is finite. We consider the dependency pair problem (P_0, R_1, 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: plus#(s(X), Y) >? plus#(X, Y) times#(s(X), Y) >? plus#(times(X, Y), Y) times#(s(X), Y) >? times#(X, Y) map#(F, cons(X, Y)) >? map#(F, Y) inc#(X) >? map#(/\x.plus(s(0), x), X) inc#(X) >? plus#(s(0), Y) double#(X) >? map#(/\x.times(s(s(0)), x), X) double#(X) >? times#(s(s(0)), Y) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(0, X) >= 0 times(s(X), Y) >= plus(times(X, Y), Y) map(F, cons(X, Y)) >= cons(F X, map(F, Y)) inc(X) >= map(/\x.plus(s(0), x), X) double(X) >= map(/\x.times(s(s(0)), x), X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( double(X) ) = #argfun-double#(map(/\x.times(s(s(0)), x), X)) pi( inc(X) ) = #argfun-inc#(map(/\x.plus(s(0), x), X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-double# = \y0.3 + y0 #argfun-inc# = \y0.3 + y0 0 = 0 cons = \y0y1.y0 double = \y0.0 double# = \y0.3 + 2y0 inc = \y0.0 inc# = \y0.3 + 2y0 map = \G0y1.2 + 2G0(y1) map# = \G0y1.0 plus = \y0y1.y1 plus# = \y0y1.0 s = \y0.0 times = \y0y1.2 + y1 times# = \y0y1.0 Using this interpretation, the requirements translate to: [[plus#(s(_x0), _x1)]] = 0 >= 0 = [[plus#(_x0, _x1)]] [[times#(s(_x0), _x1)]] = 0 >= 0 = [[plus#(times(_x0, _x1), _x1)]] [[times#(s(_x0), _x1)]] = 0 >= 0 = [[times#(_x0, _x1)]] [[map#(_F0, cons(_x1, _x2))]] = 0 >= 0 = [[map#(_F0, _x2)]] [[inc#(_x0)]] = 3 + 2x0 > 0 = [[map#(/\x.plus(s(0), x), _x0)]] [[inc#(_x0)]] = 3 + 2x0 > 0 = [[plus#(s(0), _x1)]] [[double#(_x0)]] = 3 + 2x0 > 0 = [[map#(/\x.times(s(s(0)), x), _x0)]] [[double#(_x0)]] = 3 + 2x0 > 0 = [[times#(s(s(0)), _x1)]] [[plus(0, _x0)]] = x0 >= x0 = [[_x0]] [[plus(s(_x0), _x1)]] = x1 >= 0 = [[s(plus(_x0, _x1))]] [[times(0, _x0)]] = 2 + x0 >= 0 = [[0]] [[times(s(_x0), _x1)]] = 2 + x1 >= x1 = [[plus(times(_x0, _x1), _x1)]] [[map(_F0, cons(_x1, _x2))]] = 2 + 2F0(x1) >= F0(x1) = [[cons(_F0 _x1, map(_F0, _x2))]] [[#argfun-inc#(map(/\x.plus(s(0), x), _x0))]] = 5 + 2x0 >= 2 + 2x0 = [[map(/\x.plus(s(0), x), _x0)]] [[#argfun-double#(map(/\x.times(s(s(0)), x), _x0))]] = 9 + 2x0 >= 6 + 2x0 = [[map(/\x.times(s(s(0)), x), _x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_0, R_1, static, formative) by (P_1, R_1, static, formative), where P_1 consists of: plus#(s(X), Y) =#> plus#(X, Y) times#(s(X), Y) =#> plus#(times(X, Y), Y) times#(s(X), Y) =#> times#(X, Y) map#(F, cons(X, Y)) =#> map#(F, Y) Thus, the original system is terminating if (P_1, R_1, static, formative) is finite. We consider the dependency pair problem (P_1, R_1, 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: plus#(s(X), Y) >? plus#(X, Y) times#(s(X), Y) >? plus#(times(X, Y), Y) times#(s(X), Y) >? times#(X, Y) map#(F, cons(X, Y)) >? map#(F, Y) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(0, X) >= 0 times(s(X), Y) >= plus(times(X, Y), Y) map(F, cons(X, Y)) >= cons(F X, map(F, Y)) inc(X) >= map(/\x.plus(s(0), x), X) double(X) >= map(/\x.times(s(s(0)), x), X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( double(X) ) = #argfun-double#(map(/\x.times(s(s(0)), x), X)) pi( inc(X) ) = #argfun-inc#(map(/\x.plus(s(0), x), X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-double# = \y0.3 + y0 #argfun-inc# = \y0.3 + y0 0 = 0 cons = \y0y1.3 + y1 double = \y0.0 inc = \y0.0 map = \G0y1.y1 + G0(y1) + 3y1G0(y1) map# = \G0y1.y1 plus = \y0y1.2 + y1 plus# = \y0y1.0 s = \y0.0 times = \y0y1.2 + y1 times# = \y0y1.3 Using this interpretation, the requirements translate to: [[plus#(s(_x0), _x1)]] = 0 >= 0 = [[plus#(_x0, _x1)]] [[times#(s(_x0), _x1)]] = 3 > 0 = [[plus#(times(_x0, _x1), _x1)]] [[times#(s(_x0), _x1)]] = 3 >= 3 = [[times#(_x0, _x1)]] [[map#(_F0, cons(_x1, _x2))]] = 3 + x2 > x2 = [[map#(_F0, _x2)]] [[plus(0, _x0)]] = 2 + x0 >= x0 = [[_x0]] [[plus(s(_x0), _x1)]] = 2 + x1 >= 0 = [[s(plus(_x0, _x1))]] [[times(0, _x0)]] = 2 + x0 >= 0 = [[0]] [[times(s(_x0), _x1)]] = 2 + x1 >= 2 + x1 = [[plus(times(_x0, _x1), _x1)]] [[map(_F0, cons(_x1, _x2))]] = 3 + x2 + 3x2F0(3 + x2) + 10F0(3 + x2) >= 3 + x2 + F0(x2) + 3x2F0(x2) = [[cons(_F0 _x1, map(_F0, _x2))]] [[#argfun-inc#(map(/\x.plus(s(0), x), _x0))]] = 5 + 3x0x0 + 8x0 >= 2 + 3x0x0 + 8x0 = [[map(/\x.plus(s(0), x), _x0)]] [[#argfun-double#(map(/\x.times(s(s(0)), x), _x0))]] = 5 + 3x0x0 + 8x0 >= 2 + 3x0x0 + 8x0 = [[map(/\x.times(s(s(0)), x), _x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_1, static, formative) by (P_2, R_1, static, formative), where P_2 consists of: plus#(s(X), Y) =#> plus#(X, Y) times#(s(X), Y) =#> times#(X, Y) Thus, the original system is terminating if (P_2, R_1, static, formative) is finite. We consider the dependency pair problem (P_2, R_1, static, formative). The formative rules of (P_2, R_1) are R_2 ::= plus(0, X) => X plus(s(X), Y) => s(plus(X, Y)) times(0, X) => 0 times(s(X), Y) => plus(times(X, Y), Y) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_2, R_1, static, formative) by (P_2, R_2, static, formative). Thus, the original system is terminating if (P_2, R_2, static, formative) is finite. We consider the dependency pair problem (P_2, R_2, 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: plus#(s(X), Y) >? plus#(X, Y) times#(s(X), Y) >? times#(X, Y) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(0, X) >= 0 times(s(X), Y) >= plus(times(X, Y), 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: [[0]] = _|_ [[plus#(x_1, x_2)]] = x_1 We choose Lex = {} and Mul = {plus, s, times, times#}, and the following precedence: times > plus > s > times# Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: s(X) > X times#(s(X), Y) >= times#(X, Y) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(_|_, X) >= _|_ times(s(X), Y) >= plus(times(X, Y), Y) With these choices, we have: 1] s(X) > X because [2], by definition 2] s*(X) >= X because [3], by (Select) 3] X >= X by (Meta) 4] times#(s(X), Y) >= times#(X, Y) because times# in Mul, [5] and [8], by (Fun) 5] s(X) >= X because [6], by (Star) 6] s*(X) >= X because [7], by (Select) 7] X >= X by (Meta) 8] Y >= Y by (Meta) 9] plus(_|_, X) >= X because [10], by (Star) 10] plus*(_|_, X) >= X because [11], by (Select) 11] X >= X by (Meta) 12] plus(s(X), Y) >= s(plus(X, Y)) because [13], by (Star) 13] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [14], by (Copy) 14] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [15] and [16], by (Stat) 15] s(X) > X because [2], by definition 16] Y >= Y by (Meta) 17] times(_|_, X) >= _|_ by (Bot) 18] times(s(X), Y) >= plus(times(X, Y), Y) because [19], by (Star) 19] times*(s(X), Y) >= plus(times(X, Y), Y) because times > plus, [20] and [23], by (Copy) 20] times*(s(X), Y) >= times(X, Y) because times in Mul, [21] and [8], by (Stat) 21] s(X) > X because [22], by definition 22] s*(X) >= X because [7], by (Select) 23] times*(s(X), Y) >= Y because [8], by (Select) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_2, R_2, static, formative) by (P_3, R_2, static, formative), where P_3 consists of: times#(s(X), Y) =#> times#(X, Y) Thus, the original system is terminating if (P_3, R_2, static, formative) is finite. We consider the dependency pair problem (P_3, R_2, 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: times#(s(X), Y) >? times#(X, Y) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(0, X) >= 0 times(s(X), Y) >= plus(times(X, Y), 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: [[0]] = _|_ [[times#(x_1, x_2)]] = times#(x_1) We choose Lex = {} and Mul = {plus, s, times, times#}, and the following precedence: times > plus > s = times# Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: times#(s(X)) > times#(X) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(_|_, X) >= _|_ times(s(X), Y) >= plus(times(X, Y), Y) With these choices, we have: 1] times#(s(X)) > times#(X) because [2], by definition 2] times#*(s(X)) >= times#(X) because [3], by (Select) 3] s(X) >= times#(X) because s = times#, s in Mul and [4], by (Fun) 4] X >= X by (Meta) 5] plus(_|_, X) >= X because [6], by (Star) 6] plus*(_|_, X) >= X because [7], by (Select) 7] X >= X by (Meta) 8] plus(s(X), Y) >= s(plus(X, Y)) because [9], by (Star) 9] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [10], by (Copy) 10] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [11] and [14], by (Stat) 11] s(X) > X because [12], by definition 12] s*(X) >= X because [13], by (Select) 13] X >= X by (Meta) 14] Y >= Y by (Meta) 15] times(_|_, X) >= _|_ by (Bot) 16] times(s(X), Y) >= plus(times(X, Y), Y) because [17], by (Star) 17] times*(s(X), Y) >= plus(times(X, Y), Y) because times > plus, [18] and [22], by (Copy) 18] times*(s(X), Y) >= times(X, Y) because times in Mul, [19] and [21], by (Stat) 19] s(X) > X because [20], by definition 20] s*(X) >= X because [4], by (Select) 21] Y >= Y by (Meta) 22] times*(s(X), Y) >= Y because [21], by (Select) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_3, R_2) by ({}, R_2). 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.