We consider the system AotoYamada_05__010. Alphabet: 0 : [] --> b cons : [b * a] --> a curry : [b -> b -> b * b] --> b -> b 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 curry(f, x) y => f x y map(f) nil => nil map(f) cons(x, y) => cons(f x, map(f) y) inc => map(curry(plus, s(0))) double => map(curry(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 rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 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 curry(F, X) Y >? F X Y map(F) nil >? nil map(F) cons(X, Y) >? cons(F X, map(F) Y) inc >? map(curry(plus, s(0))) double >? map(curry(times, s(s(0)))) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[nil]] = _|_ We choose Lex = {} and Mul = {@_{o -> o -> o}, @_{o -> o}, cons, curry, double, inc, map, plus, s, times}, and the following precedence: inc > double > times > map > cons > @_{o -> o -> o} = curry > @_{o -> o} > s > plus Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: @_{o -> o}(@_{o -> o -> o}(plus, _|_), X) > X @_{o -> o}(@_{o -> o -> o}(plus, s(X)), Y) >= s(@_{o -> o}(@_{o -> o -> o}(plus, X), Y)) @_{o -> o}(@_{o -> o -> o}(times, _|_), X) >= _|_ @_{o -> o}(@_{o -> o -> o}(times, s(X)), Y) >= @_{o -> o}(@_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)), Y) @_{o -> o}(curry(F, X), Y) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) @_{o -> o}(map(F), _|_) >= _|_ @_{o -> o}(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) inc > map(curry(plus, s(_|_))) double >= map(curry(times, s(s(_|_)))) With these choices, we have: 1] @_{o -> o}(@_{o -> o -> o}(plus, _|_), X) > X because [2], by definition 2] @_{o -> o}*(@_{o -> o -> o}(plus, _|_), X) >= X because [3], by (Select) 3] X >= X by (Meta) 4] @_{o -> o}(@_{o -> o -> o}(plus, s(X)), Y) >= s(@_{o -> o}(@_{o -> o -> o}(plus, X), Y)) because [5], by (Star) 5] @_{o -> o}*(@_{o -> o -> o}(plus, s(X)), Y) >= s(@_{o -> o}(@_{o -> o -> o}(plus, X), Y)) because @_{o -> o} > s and [6], by (Copy) 6] @_{o -> o}*(@_{o -> o -> o}(plus, s(X)), Y) >= @_{o -> o}(@_{o -> o -> o}(plus, X), Y) because @_{o -> o} in Mul, [7] and [13], by (Stat) 7] @_{o -> o -> o}(plus, s(X)) > @_{o -> o -> o}(plus, X) because [8], by definition 8] @_{o -> o -> o}*(plus, s(X)) >= @_{o -> o -> o}(plus, X) because @_{o -> o -> o} in Mul, [9] and [10], by (Stat) 9] plus >= plus by (Fun) 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] @_{o -> o}(@_{o -> o -> o}(times, _|_), X) >= _|_ by (Bot) 15] @_{o -> o}(@_{o -> o -> o}(times, s(X)), Y) >= @_{o -> o}(@_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)), Y) because [16], by (Star) 16] @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y) >= @_{o -> o}(@_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)), Y) because [17], by (Select) 17] @_{o -> o -> o}(times, s(X)) @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y) >= @_{o -> o}(@_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)), Y) because [18] 18] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= @_{o -> o}(@_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)), Y) because @_{o -> o -> o} > @_{o -> o}, [19] and [30], by (Copy) 19] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= @_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)) because [20], by (Select) 20] times @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= @_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)) because [21] 21] times*(@_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y))) >= @_{o -> o -> o}(plus, @_{o -> o}(@_{o -> o -> o}(times, X), Y)) because times > @_{o -> o -> o}, [22] and [23], by (Copy) 22] times*(@_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y))) >= plus because times > plus, by (Copy) 23] times*(@_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y))) >= @_{o -> o}(@_{o -> o -> o}(times, X), Y) because [24], by (Select) 24] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= @_{o -> o}(@_{o -> o -> o}(times, X), Y) because @_{o -> o -> o} > @_{o -> o}, [25] and [30], by (Copy) 25] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= @_{o -> o -> o}(times, X) because @_{o -> o -> o} in Mul, [26] and [27], by (Stat) 26] times >= times by (Fun) 27] s(X) > X because [28], by definition 28] s*(X) >= X because [29], by (Select) 29] X >= X by (Meta) 30] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= Y because [31], by (Select) 31] @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y) >= Y because [32], by (Select) 32] Y >= Y by (Meta) 33] @_{o -> o}(curry(F, X), Y) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) because @_{o -> o} in Mul, [34] and [37], by (Fun) 34] curry(F, X) >= @_{o -> o -> o}(F, X) because curry = @_{o -> o -> o}, curry in Mul, [35] and [36], by (Fun) 35] F >= F by (Meta) 36] X >= X by (Meta) 37] Y >= Y by (Meta) 38] @_{o -> o}(map(F), _|_) >= _|_ by (Bot) 39] @_{o -> o}(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because [40], by (Star) 40] @_{o -> o}*(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because [41], by (Select) 41] map(F) @_{o -> o}*(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because [42] 42] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because map > cons, [43] and [54], by (Copy) 43] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= @_{o -> o}(F, X) because map > @_{o -> o}, [44] and [46], by (Copy) 44] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= F because [45], by (Select) 45] F >= F by (Meta) 46] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= X because [47], by (Select) 47] @_{o -> o}*(map(F), cons(X, Y)) >= X because [48], by (Select) 48] map(F) @_{o -> o}*(map(F), cons(X, Y)) >= X because [49] 49] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= X because [50], by (Select) 50] @_{o -> o}*(map(F), cons(X, Y)) >= X because [51], by (Select) 51] cons(X, Y) >= X because [52], by (Star) 52] cons*(X, Y) >= X because [53], by (Select) 53] X >= X by (Meta) 54] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= @_{o -> o}(map(F), Y) because [55], by (Select) 55] @_{o -> o}*(map(F), cons(X, Y)) >= @_{o -> o}(map(F), Y) because @_{o -> o} in Mul, [56] and [58], by (Stat) 56] map(F) >= map(F) because map in Mul and [57], by (Fun) 57] F >= F by (Meta) 58] cons(X, Y) > Y because [59], by definition 59] cons*(X, Y) >= Y because [60], by (Select) 60] Y >= Y by (Meta) 61] inc > map(curry(plus, s(_|_))) because [62], by definition 62] inc* >= map(curry(plus, s(_|_))) because inc > map and [63], by (Copy) 63] inc* >= curry(plus, s(_|_)) because inc > curry, [64] and [65], by (Copy) 64] inc* >= plus because inc > plus, by (Copy) 65] inc* >= s(_|_) because inc > s and [66], by (Copy) 66] inc* >= _|_ by (Bot) 67] double >= map(curry(times, s(s(_|_)))) because [68], by (Star) 68] double* >= map(curry(times, s(s(_|_)))) because double > map and [69], by (Copy) 69] double* >= curry(times, s(s(_|_))) because double > curry, [70] and [71], by (Copy) 70] double* >= times because double > times, by (Copy) 71] double* >= s(s(_|_)) because double > s and [72], by (Copy) 72] double* >= s(_|_) because double > s and [73], by (Copy) 73] double* >= _|_ by (Bot) We can thus remove the following rules: plus 0 X => X inc => map(curry(plus, s(0))) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): plus(s(X), Y) >? s(plus(X, Y)) times 0 X >? 0 times s(X) Y >? plus(times X Y, Y) curry(F, X) Y >? F X Y map(F) nil >? nil map(F) cons(X, Y) >? cons(F X, map(F) Y) double >? map(curry(times, s(s(0)))) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[nil]] = _|_ We choose Lex = {} and Mul = {@_{o -> o -> o}, @_{o -> o}, cons, curry, double, map, plus, s, times}, and the following precedence: double > curry > map > cons > times > plus > @_{o -> o} > s > @_{o -> o -> o} Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: plus(s(X), Y) >= s(plus(X, Y)) @_{o -> o}(@_{o -> o -> o}(times, _|_), X) >= _|_ @_{o -> o}(@_{o -> o -> o}(times, s(X)), Y) > plus(@_{o -> o}(@_{o -> o -> o}(times, X), Y), Y) @_{o -> o}(curry(F, X), Y) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) @_{o -> o}(map(F), _|_) >= _|_ @_{o -> o}(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) double > map(curry(times, s(s(_|_)))) With these choices, we have: 1] plus(s(X), Y) >= s(plus(X, Y)) because [2], by (Star) 2] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [3], by (Copy) 3] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [4] and [7], by (Stat) 4] s(X) > X because [5], by definition 5] s*(X) >= X because [6], by (Select) 6] X >= X by (Meta) 7] Y >= Y by (Meta) 8] @_{o -> o}(@_{o -> o -> o}(times, _|_), X) >= _|_ by (Bot) 9] @_{o -> o}(@_{o -> o -> o}(times, s(X)), Y) > plus(@_{o -> o}(@_{o -> o -> o}(times, X), Y), Y) because [10], by definition 10] @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y) >= plus(@_{o -> o}(@_{o -> o -> o}(times, X), Y), Y) because [11], by (Select) 11] @_{o -> o -> o}(times, s(X)) @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y) >= plus(@_{o -> o}(@_{o -> o -> o}(times, X), Y), Y) because [12] 12] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= plus(@_{o -> o}(@_{o -> o -> o}(times, X), Y), Y) because [13], by (Select) 13] times @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= plus(@_{o -> o}(@_{o -> o -> o}(times, X), Y), Y) because [14] 14] times*(@_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)), @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y))) >= plus(@_{o -> o}(@_{o -> o -> o}(times, X), Y), Y) because times > plus, [15] and [25], by (Copy) 15] times*(@_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)), @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y))) >= @_{o -> o}(@_{o -> o -> o}(times, X), Y) because [16], by (Select) 16] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= @_{o -> o}(@_{o -> o -> o}(times, X), Y) because [17], by (Select) 17] @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y) >= @_{o -> o}(@_{o -> o -> o}(times, X), Y) because @_{o -> o} in Mul, [18] and [24], by (Stat) 18] @_{o -> o -> o}(times, s(X)) > @_{o -> o -> o}(times, X) because [19], by definition 19] @_{o -> o -> o}*(times, s(X)) >= @_{o -> o -> o}(times, X) because @_{o -> o -> o} in Mul, [20] and [21], by (Stat) 20] times >= times by (Fun) 21] s(X) > X because [22], by definition 22] s*(X) >= X because [23], by (Select) 23] X >= X by (Meta) 24] Y >= Y by (Meta) 25] times*(@_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)), @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y))) >= Y because [26], by (Select) 26] @_{o -> o -> o}*(times, s(X), @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y)) >= Y because [27], by (Select) 27] @_{o -> o}*(@_{o -> o -> o}(times, s(X)), Y) >= Y because [24], by (Select) 28] @_{o -> o}(curry(F, X), Y) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) because [29], by (Star) 29] @_{o -> o}*(curry(F, X), Y) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) because [30], by (Select) 30] curry(F, X) @_{o -> o}*(curry(F, X), Y) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) because [31] 31] curry*(F, X, @_{o -> o}*(curry(F, X), Y)) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) because curry > @_{o -> o}, [32] and [37], by (Copy) 32] curry*(F, X, @_{o -> o}*(curry(F, X), Y)) >= @_{o -> o -> o}(F, X) because curry > @_{o -> o -> o}, [33] and [35], by (Copy) 33] curry*(F, X, @_{o -> o}*(curry(F, X), Y)) >= F because [34], by (Select) 34] F >= F by (Meta) 35] curry*(F, X, @_{o -> o}*(curry(F, X), Y)) >= X because [36], by (Select) 36] X >= X by (Meta) 37] curry*(F, X, @_{o -> o}*(curry(F, X), Y)) >= Y because [38], by (Select) 38] @_{o -> o}*(curry(F, X), Y) >= Y because [39], by (Select) 39] Y >= Y by (Meta) 40] @_{o -> o}(map(F), _|_) >= _|_ by (Bot) 41] @_{o -> o}(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because [42], by (Star) 42] @_{o -> o}*(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because [43], by (Select) 43] map(F) @_{o -> o}*(map(F), cons(X, Y)) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because [44] 44] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= cons(@_{o -> o}(F, X), @_{o -> o}(map(F), Y)) because map > cons, [45] and [53], by (Copy) 45] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= @_{o -> o}(F, X) because map > @_{o -> o}, [46] and [48], by (Copy) 46] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= F because [47], by (Select) 47] F >= F by (Meta) 48] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= X because [49], by (Select) 49] @_{o -> o}*(map(F), cons(X, Y)) >= X because [50], by (Select) 50] cons(X, Y) >= X because [51], by (Star) 51] cons*(X, Y) >= X because [52], by (Select) 52] X >= X by (Meta) 53] map*(F, @_{o -> o}*(map(F), cons(X, Y))) >= @_{o -> o}(map(F), Y) because [54], by (Select) 54] @_{o -> o}*(map(F), cons(X, Y)) >= @_{o -> o}(map(F), Y) because @_{o -> o} in Mul, [55] and [57], by (Stat) 55] map(F) >= map(F) because map in Mul and [56], by (Fun) 56] F >= F by (Meta) 57] cons(X, Y) > Y because [58], by definition 58] cons*(X, Y) >= Y because [59], by (Select) 59] Y >= Y by (Meta) 60] double > map(curry(times, s(s(_|_)))) because [61], by definition 61] double* >= map(curry(times, s(s(_|_)))) because double > map and [62], by (Copy) 62] double* >= curry(times, s(s(_|_))) because double > curry, [63] and [64], by (Copy) 63] double* >= times because double > times, by (Copy) 64] double* >= s(s(_|_)) because double > s and [65], by (Copy) 65] double* >= s(_|_) because double > s and [66], by (Copy) 66] double* >= _|_ by (Bot) We can thus remove the following rules: times s(X) Y => plus(times X Y, Y) double => map(curry(times, s(s(0)))) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): plus(s(X), Y) >? s(plus(X, Y)) times(0, X) >? 0 curry(F, X, Y) >? F X Y map(F, nil) >? nil map(F, cons(X, Y)) >? cons(F X, map(F, Y)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 cons = \y0y1.3 + y0 + y1 curry = \G0y1y2.3 + y1 + y2 + G0(y1,y2) map = \G0y1.3 + 3y1 + G0(y1) + 2y1G0(y1) nil = 0 plus = \y0y1.y1 + 3y0 s = \y0.3 + y0 times = \y0y1.3 + y1 + 3y0 Using this interpretation, the requirements translate to: [[plus(s(_x0), _x1)]] = 9 + x1 + 3x0 > 3 + x1 + 3x0 = [[s(plus(_x0, _x1))]] [[times(0, _x0)]] = 3 + x0 > 0 = [[0]] [[curry(_F0, _x1, _x2)]] = 3 + x1 + x2 + F0(x1,x2) > x1 + x2 + F0(x1,x2) = [[_F0 _x1 _x2]] [[map(_F0, nil)]] = 3 + F0(0) > 0 = [[nil]] [[map(_F0, cons(_x1, _x2))]] = 12 + 3x1 + 3x2 + 2x1F0(3 + x1 + x2) + 2x2F0(3 + x1 + x2) + 7F0(3 + x1 + x2) > 6 + x1 + 3x2 + F0(x1) + F0(x2) + 2x2F0(x2) = [[cons(_F0 _x1, map(_F0, _x2))]] We can thus remove the following rules: plus(s(X), Y) => s(plus(X, Y)) times(0, X) => 0 curry(F, X, Y) => F X Y map(F, nil) => nil map(F, cons(X, Y)) => cons(F X, map(F, Y)) All rules were succesfully removed. Thus, termination of the original system has been reduced to termination of the beta-rule, which is well-known to hold. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012.