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). 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 : 0 * 2 : 1, 2 * 3 : 3 * 4 : 3 * 5 : 0 * 6 : 3 * 7 : 1, 2 This graph has the following strongly connected components: P_1: plus#(s(X), Y) =#> plus#(X, Y) P_2: times#(s(X), Y) =#> times#(X, Y) P_3: map#(F, cons(X, Y)) =#> map#(F, 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: 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, 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 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.1 + 2y1 double = \y0.0 inc = \y0.0 map = \G0y1.y1 map# = \G0y1.y1 + y1G0(y1) nil = 0 plus = \y0y1.y1 s = \y0.0 times = \y0y1.y1 Using this interpretation, the requirements translate to: [[map#(_F0, cons(_x1, _x2))]] = 1 + 2x2 + F0(1 + 2x2) + 2x2F0(1 + 2x2) > x2 + x2F0(x2) = [[map#(_F0, _x2)]] [[plus(0, _x0)]] = x0 >= x0 = [[_x0]] [[plus(s(_x0), _x1)]] = x1 >= 0 = [[s(plus(_x0, _x1))]] [[times(0, _x0)]] = x0 >= 0 = [[0]] [[times(s(_x0), _x1)]] = x1 >= x1 = [[plus(times(_x0, _x1), _x1)]] [[map(_F0, nil)]] = 0 >= 0 = [[nil]] [[map(_F0, cons(_x1, _x2))]] = 1 + 2x2 >= 1 + 2x2 = [[cons(_F0 _x1, map(_F0, _x2))]] [[#argfun-inc#(map(/\x.plus(s(0), x), _x0))]] = 3 + x0 >= x0 = [[map(/\x.plus(s(0), x), _x0)]] [[#argfun-double#(map(/\x.times(s(s(0)), x), _x0))]] = 3 + x0 >= x0 = [[map(/\x.times(s(s(0)), x), _x0)]] 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 [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) 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 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)) 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]] = _|_ [[cons(x_1, x_2)]] = x_2 [[double(x_1)]] = x_1 [[inc(x_1)]] = x_1 [[times#(x_1, x_2)]] = x_1 We choose Lex = {} and Mul = {#argfun-double#, #argfun-inc#, @_{o -> o}, map, nil, plus, s, times}, and the following precedence: #argfun-inc# > @_{o -> o} > nil > #argfun-double# > map > times > plus > s Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: s(X) > X plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(_|_, X) >= _|_ times(s(X), Y) >= plus(times(X, Y), Y) map(F, nil) >= nil map(F, X) >= map(F, X) #argfun-inc#(map(/\x.plus(s(_|_), x), X)) >= map(/\x.plus(s(_|_), x), X) #argfun-double#(map(/\x.times(s(s(_|_)), x), X)) >= map(/\x.times(s(s(_|_)), x), X) 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] plus(_|_, X) >= X because [5], by (Star) 5] plus*(_|_, X) >= X because [6], by (Select) 6] X >= X by (Meta) 7] plus(s(X), Y) >= s(plus(X, Y)) because [8], by (Star) 8] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [9], by (Copy) 9] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [10] and [13], by (Stat) 10] s(X) > X because [11], by definition 11] s*(X) >= X because [12], by (Select) 12] X >= X by (Meta) 13] Y >= Y by (Meta) 14] times(_|_, X) >= _|_ by (Bot) 15] times(s(X), Y) >= plus(times(X, Y), Y) because [16], by (Star) 16] times*(s(X), Y) >= plus(times(X, Y), Y) because times > plus, [17] and [20], by (Copy) 17] times*(s(X), Y) >= times(X, Y) because times in Mul, [18] and [19], by (Stat) 18] s(X) > X because [2], by definition 19] Y >= Y by (Meta) 20] times*(s(X), Y) >= Y because [19], by (Select) 21] map(F, nil) >= nil because [22], by (Star) 22] map*(F, nil) >= nil because [23], by (Select) 23] nil >= nil by (Fun) 24] map(F, X) >= map(F, X) because map in Mul, [25] and [26], by (Fun) 25] F >= F by (Meta) 26] X >= X by (Meta) 27] #argfun-inc#(map(/\x.plus(s(_|_), x), X)) >= map(/\x.plus(s(_|_), x), X) because [28], by (Star) 28] #argfun-inc#*(map(/\x.plus(s(_|_), x), X)) >= map(/\x.plus(s(_|_), x), X) because #argfun-inc# > map, [29] and [37], by (Copy) 29] #argfun-inc#*(map(/\x.plus(s(_|_), x), X)) >= /\x.plus(s(_|_), x) because [30], by (F-Abs) 30] #argfun-inc#*(map(/\x.plus(s(_|_), x), X), y) >= plus(s(_|_), y) because #argfun-inc# > plus, [31] and [35], by (Copy) 31] #argfun-inc#*(map(/\x.plus(s(_|_), x), X), y) >= s(_|_) because [32], by (Select) 32] map(/\x.plus(s(_|_), x), X) >= s(_|_) because [33], by (Star) 33] map*(/\x.plus(s(_|_), x), X) >= s(_|_) because map > s and [34], by (Copy) 34] map*(/\x.plus(s(_|_), x), X) >= _|_ by (Bot) 35] #argfun-inc#*(map(/\x.plus(s(_|_), x), X), y) >= y because [36], by (Select) 36] y >= y by (Var) 37] #argfun-inc#*(map(/\x.plus(s(_|_), x), X)) >= X because [38], by (Select) 38] map(/\x.plus(s(_|_), x), X) >= X because [39], by (Star) 39] map*(/\x.plus(s(_|_), x), X) >= X because [40], by (Select) 40] X >= X by (Meta) 41] #argfun-double#(map(/\x.times(s(s(_|_)), x), X)) >= map(/\x.times(s(s(_|_)), x), X) because [42], by (Star) 42] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X)) >= map(/\x.times(s(s(_|_)), x), X) because #argfun-double# > map, [43] and [52], by (Copy) 43] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X)) >= /\x.times(s(s(_|_)), x) because [44], by (F-Abs) 44] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= times(s(s(_|_)), y) because #argfun-double# > times, [45] and [50], by (Copy) 45] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= s(s(_|_)) because #argfun-double# > s and [46], by (Copy) 46] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= s(_|_) because [47], by (Select) 47] map(/\x.times(s(s(_|_)), x), X) >= s(_|_) because [48], by (Star) 48] map*(/\x.times(s(s(_|_)), x), X) >= s(_|_) because map > s and [49], by (Copy) 49] map*(/\x.times(s(s(_|_)), x), X) >= _|_ by (Bot) 50] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= y because [51], by (Select) 51] y >= y by (Var) 52] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X)) >= X because [53], by (Select) 53] map(/\x.times(s(s(_|_)), x), X) >= X because [54], by (Star) 54] map*(/\x.times(s(s(_|_)), x), X) >= X because [55], by (Select) 55] 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_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 [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) 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 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)) 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-double#(x_1)]] = #argfun-double# [[#argfun-inc#(x_1)]] = #argfun-inc# [[0]] = _|_ [[cons(x_1, x_2)]] = x_2 [[double(x_1)]] = double [[inc(x_1)]] = inc [[map(x_1, x_2)]] = _|_ [[nil]] = _|_ We choose Lex = {} and Mul = {#argfun-double#, #argfun-inc#, @_{o -> o}, double, inc, plus, plus#, s, times}, and the following precedence: #argfun-double# > #argfun-inc# > @_{o -> o} > double > inc > plus# > times > plus > s Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: plus#(s(X), Y) > plus#(X, Y) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) times(_|_, X) >= _|_ times(s(X), Y) >= plus(times(X, Y), Y) _|_ >= _|_ _|_ >= _|_ #argfun-inc# >= _|_ #argfun-double# >= _|_ With these choices, we have: 1] plus#(s(X), Y) > plus#(X, Y) because [2], by definition 2] plus#*(s(X), Y) >= plus#(X, Y) because plus# in Mul, [3] and [6], by (Stat) 3] s(X) > X because [4], by definition 4] s*(X) >= X because [5], by (Select) 5] X >= X by (Meta) 6] Y >= Y by (Meta) 7] plus(_|_, X) >= X because [8], by (Star) 8] plus*(_|_, X) >= X because [9], by (Select) 9] X >= X by (Meta) 10] plus(s(X), Y) >= s(plus(X, Y)) because [11], by (Star) 11] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [12], by (Copy) 12] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [3] and [6], by (Stat) 13] times(_|_, X) >= _|_ by (Bot) 14] times(s(X), Y) >= plus(times(X, Y), Y) because [15], by (Star) 15] times*(s(X), Y) >= plus(times(X, Y), Y) because times > plus, [16] and [21], by (Copy) 16] times*(s(X), Y) >= times(X, Y) because times in Mul, [17] and [20], by (Stat) 17] s(X) > X because [18], by definition 18] s*(X) >= X because [19], by (Select) 19] X >= X by (Meta) 20] Y >= Y by (Meta) 21] times*(s(X), Y) >= Y because [20], by (Select) 22] _|_ >= _|_ by (Bot) 23] _|_ >= _|_ by (Bot) 24] #argfun-inc# >= _|_ by (Bot) 25] #argfun-double# >= _|_ by (Bot) 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.