We consider the system AotoYamada_05__021. Alphabet: 0 : [] --> a cons : [a * b] --> b double : [b] --> b inc : [b] --> b map : [a -> a * b] --> b nil : [] --> b plus : [a] --> a -> a s : [a] --> a times : [a] --> a -> a 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 inc(x) => map(plus(s(0)), x) double(x) => map(times(s(s(0))), x) map(f, nil) => nil map(f, cons(x, y)) => cons(f x, map(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]). 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) inc(X) => map(/\x.plus(s(0), x), X) double(X) => map(/\x.times(s(s(0)), x), X) map(F, nil) => nil map(F, cons(X, Y)) => cons(F X, map(F, Y)) 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] inc#(X) =#> map#(/\x.plus(s(0), x), X) 4] inc#(X) =#> plus#(s(0), Y) 5] double#(X) =#> map#(/\x.times(s(s(0)), x), X) 6] double#(X) =#> times#(s(s(0)), Y) 7] map#(F, cons(X, Y)) =#> map#(F, 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) inc(X) => map(/\x.plus(s(0), x), X) double(X) => map(/\x.times(s(s(0)), x), X) map(F, nil) => nil map(F, cons(X, Y)) => cons(F X, map(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 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 : 7 * 4 : 0 * 5 : 7 * 6 : 1, 2 * 7 : 7 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) inc(X) >= map(/\x.plus(s(0), x), X) double(X) >= map(/\x.times(s(s(0)), x), X) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) 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)]] [[#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)]] [[map(_F0, nil)]] = 0 >= 0 = [[nil]] [[map(_F0, cons(_x1, _x2))]] = 1 + 2x2 >= 1 + 2x2 = [[cons(_F0 _x1, map(_F0, _x2))]] 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) inc(X) >= map(/\x.plus(s(0), x), X) double(X) >= map(/\x.times(s(s(0)), x), X) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) 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# [[cons(x_1, x_2)]] = x_2 [[double(x_1)]] = double [[inc(x_1)]] = inc [[map(x_1, x_2)]] = map(x_1) [[nil]] = _|_ [[times#(x_1, x_2)]] = x_1 We choose Lex = {} and Mul = {#argfun-double#, #argfun-inc#, 0, @_{o -> o}, double, inc, map, plus, s, times}, and the following precedence: #argfun-inc# > @_{o -> o} > double > inc > #argfun-double# > times > plus > 0 > s > map Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: s(X) > X 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) #argfun-inc#(map(/\x.plus(s(0), x))) >= map(/\x.plus(s(0), x)) #argfun-double# >= map(/\x.times(s(s(0)), x)) map(F) >= _|_ map(F) >= map(F) 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(0, X) >= X because [5], by (Star) 5] plus*(0, 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(0, X) >= 0 because [15], by (Star) 15] times*(0, X) >= 0 because times > 0, by (Copy) 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 [21], by (Copy) 18] times*(s(X), Y) >= times(X, Y) because times in Mul, [19] and [20], by (Stat) 19] s(X) > X because [2], by definition 20] Y >= Y by (Meta) 21] times*(s(X), Y) >= Y because [20], by (Select) 22] #argfun-inc#(map(/\x.plus(s(0), x))) >= map(/\x.plus(s(0), x)) because [23], by (Star) 23] #argfun-inc#*(map(/\x.plus(s(0), x))) >= map(/\x.plus(s(0), x)) because #argfun-inc# > map and [24], by (Copy) 24] #argfun-inc#*(map(/\x.plus(s(0), x))) >= /\x.plus(s(0), x) because [25], by (F-Abs) 25] #argfun-inc#*(map(/\x.plus(s(0), x)), y) >= plus(s(0), y) because #argfun-inc# > plus, [26] and [32], by (Copy) 26] #argfun-inc#*(map(/\x.plus(s(0), x)), y) >= s(0) because #argfun-inc# > s and [27], by (Copy) 27] #argfun-inc#*(map(/\x.plus(s(0), x)), y) >= 0 because [28], by (Select) 28] map(/\x.plus(s(0), x)) >= 0 because [29], by (Star) 29] map*(/\x.plus(s(0), x)) >= 0 because [30], by (Select) 30] plus(s(0), map*(/\x.plus(s(0), x))) >= 0 because [31], by (Star) 31] plus*(s(0), map*(/\x.plus(s(0), x))) >= 0 because plus > 0, by (Copy) 32] #argfun-inc#*(map(/\x.plus(s(0), x)), y) >= y because [33], by (Select) 33] y >= y by (Var) 34] #argfun-double# >= map(/\x.times(s(s(0)), x)) because [35], by (Star) 35] #argfun-double#* >= map(/\x.times(s(s(0)), x)) because #argfun-double# > map and [36], by (Copy) 36] #argfun-double#* >= /\y.times(s(s(0)), y) because [37], by (F-Abs) 37] #argfun-double#*(x) >= times(s(s(0)), x) because #argfun-double# > times, [38] and [41], by (Copy) 38] #argfun-double#*(x) >= s(s(0)) because #argfun-double# > s and [39], by (Copy) 39] #argfun-double#*(x) >= s(0) because #argfun-double# > s and [40], by (Copy) 40] #argfun-double#*(x) >= 0 because #argfun-double# > 0, by (Copy) 41] #argfun-double#*(x) >= x because [42], by (Select) 42] x >= x by (Var) 43] map(F) >= _|_ by (Bot) 44] map(F) >= map(F) because map in Mul and [45], by (Fun) 45] F >= F 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) inc(X) >= map(/\x.plus(s(0), x), X) double(X) >= map(/\x.times(s(s(0)), x), X) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) 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]] = _|_ [[double(x_1)]] = x_1 [[inc(x_1)]] = x_1 [[nil]] = _|_ We choose Lex = {} and Mul = {#argfun-double#, #argfun-inc#, @_{o -> o}, cons, map, plus, plus#, s, times}, and the following precedence: #argfun-inc# > #argfun-double# > map > @_{o -> o} > cons > 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#(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) map(F, _|_) >= _|_ map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) 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] #argfun-inc#(map(/\x.plus(s(_|_), x), X)) >= map(/\x.plus(s(_|_), x), X) because [23], by (Star) 23] #argfun-inc#*(map(/\x.plus(s(_|_), x), X)) >= map(/\x.plus(s(_|_), x), X) because #argfun-inc# > map, [24] and [30], by (Copy) 24] #argfun-inc#*(map(/\x.plus(s(_|_), x), X)) >= /\x.plus(s(_|_), x) because [25], by (F-Abs) 25] #argfun-inc#*(map(/\x.plus(s(_|_), x), X), y) >= plus(s(_|_), y) because #argfun-inc# > plus, [26] and [28], by (Copy) 26] #argfun-inc#*(map(/\x.plus(s(_|_), x), X), y) >= s(_|_) because #argfun-inc# > s and [27], by (Copy) 27] #argfun-inc#*(map(/\x.plus(s(_|_), x), X), y) >= _|_ by (Bot) 28] #argfun-inc#*(map(/\x.plus(s(_|_), x), X), y) >= y because [29], by (Select) 29] y >= y by (Var) 30] #argfun-inc#*(map(/\x.plus(s(_|_), x), X)) >= X because [31], by (Select) 31] map(/\x.plus(s(_|_), x), X) >= X because [32], by (Star) 32] map*(/\x.plus(s(_|_), x), X) >= X because [33], by (Select) 33] X >= X by (Meta) 34] #argfun-double#(map(/\x.times(s(s(_|_)), x), X)) >= map(/\x.times(s(s(_|_)), x), X) because [35], by (Star) 35] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X)) >= map(/\x.times(s(s(_|_)), x), X) because #argfun-double# > map, [36] and [43], by (Copy) 36] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X)) >= /\x.times(s(s(_|_)), x) because [37], by (F-Abs) 37] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= times(s(s(_|_)), y) because #argfun-double# > times, [38] and [41], by (Copy) 38] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= s(s(_|_)) because #argfun-double# > s and [39], by (Copy) 39] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= s(_|_) because #argfun-double# > s and [40], by (Copy) 40] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= _|_ by (Bot) 41] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X), y) >= y because [42], by (Select) 42] y >= y by (Var) 43] #argfun-double#*(map(/\x.times(s(s(_|_)), x), X)) >= X because [44], by (Select) 44] map(/\x.times(s(s(_|_)), x), X) >= X because [45], by (Star) 45] map*(/\x.times(s(s(_|_)), x), X) >= X because [46], by (Select) 46] X >= X by (Meta) 47] map(F, _|_) >= _|_ by (Bot) 48] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [49], by (Star) 49] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [50] and [57], by (Copy) 50] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [51] and [53], by (Copy) 51] map*(F, cons(X, Y)) >= F because [52], by (Select) 52] F >= F by (Meta) 53] map*(F, cons(X, Y)) >= X because [54], by (Select) 54] cons(X, Y) >= X because [55], by (Star) 55] cons*(X, Y) >= X because [56], by (Select) 56] X >= X by (Meta) 57] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [58] and [59], by (Stat) 58] F >= F by (Meta) 59] cons(X, Y) > Y because [60], by definition 60] cons*(X, Y) >= Y because [61], by (Select) 61] Y >= Y by (Meta) 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.