We consider the system Applicative_05__Ex3Lists. Alphabet: append : [b * b] --> b cons : [a * b] --> b map : [a -> a * b] --> b nil : [] --> b Rules: append(nil, x) => x append(cons(x, y), z) => cons(x, append(y, z)) map(f, nil) => nil map(f, cons(x, y)) => cons(f x, map(f, y)) append(append(x, y), z) => append(x, append(y, z)) map(f, append(x, y)) => append(map(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 rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): append(nil, X) >? X append(cons(X, Y), Z) >? cons(X, append(Y, Z)) map(F, nil) >? nil map(F, cons(X, Y)) >? cons(F X, map(F, Y)) append(append(X, Y), Z) >? append(X, append(Y, Z)) map(F, append(X, Y)) >? append(map(F, X), map(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {append} and Mul = {@_{o -> o}, cons, map}, and the following precedence: @_{o -> o} = map > append > cons Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: append(_|_, X) > X append(cons(X, Y), Z) >= cons(X, append(Y, Z)) map(F, _|_) >= _|_ map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) append(append(X, Y), Z) > append(X, append(Y, Z)) map(F, append(X, Y)) > append(map(F, X), map(F, Y)) With these choices, we have: 1] append(_|_, X) > X because [2], by definition 2] append*(_|_, X) >= X because [3], by (Select) 3] X >= X by (Meta) 4] append(cons(X, Y), Z) >= cons(X, append(Y, Z)) because [5], by (Star) 5] append*(cons(X, Y), Z) >= cons(X, append(Y, Z)) because append > cons, [6] and [10], by (Copy) 6] append*(cons(X, Y), Z) >= X because [7], by (Select) 7] cons(X, Y) >= X because [8], by (Star) 8] cons*(X, Y) >= X because [9], by (Select) 9] X >= X by (Meta) 10] append*(cons(X, Y), Z) >= append(Y, Z) because [11], [14] and [16], by (Stat) 11] cons(X, Y) > Y because [12], by definition 12] cons*(X, Y) >= Y because [13], by (Select) 13] Y >= Y by (Meta) 14] append*(cons(X, Y), Z) >= Y because [15], by (Select) 15] cons(X, Y) >= Y because [12], by (Star) 16] append*(cons(X, Y), Z) >= Z because [17], by (Select) 17] Z >= Z by (Meta) 18] map(F, _|_) >= _|_ by (Bot) 19] map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) because [20], by definition 20] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [21] and [26], by (Copy) 21] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map = @_{o -> o}, map in Mul, [22] and [23], by (Stat) 22] F >= F by (Meta) 23] cons(X, Y) > X because [24], by definition 24] cons*(X, Y) >= X because [25], by (Select) 25] X >= X by (Meta) 26] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [22] and [27], by (Stat) 27] cons(X, Y) > Y because [28], by definition 28] cons*(X, Y) >= Y because [29], by (Select) 29] Y >= Y by (Meta) 30] append(append(X, Y), Z) > append(X, append(Y, Z)) because [31], by definition 31] append*(append(X, Y), Z) >= append(X, append(Y, Z)) because [32], [35] and [37], by (Stat) 32] append(X, Y) > X because [33], by definition 33] append*(X, Y) >= X because [34], by (Select) 34] X >= X by (Meta) 35] append*(append(X, Y), Z) >= X because [36], by (Select) 36] append(X, Y) >= X because [33], by (Star) 37] append*(append(X, Y), Z) >= append(Y, Z) because [38], [41] and [43], by (Stat) 38] append(X, Y) > Y because [39], by definition 39] append*(X, Y) >= Y because [40], by (Select) 40] Y >= Y by (Meta) 41] append*(append(X, Y), Z) >= Y because [42], by (Select) 42] append(X, Y) >= Y because [39], by (Star) 43] append*(append(X, Y), Z) >= Z because [44], by (Select) 44] Z >= Z by (Meta) 45] map(F, append(X, Y)) > append(map(F, X), map(F, Y)) because [46], by definition 46] map*(F, append(X, Y)) >= append(map(F, X), map(F, Y)) because map > append, [47] and [52], by (Copy) 47] map*(F, append(X, Y)) >= map(F, X) because map in Mul, [48] and [49], by (Stat) 48] F >= F by (Meta) 49] append(X, Y) > X because [50], by definition 50] append*(X, Y) >= X because [51], by (Select) 51] X >= X by (Meta) 52] map*(F, append(X, Y)) >= map(F, Y) because map in Mul, [48] and [53], by (Stat) 53] append(X, Y) > Y because [54], by definition 54] append*(X, Y) >= Y because [55], by (Select) 55] Y >= Y by (Meta) We can thus remove the following rules: append(nil, X) => X map(F, cons(X, Y)) => cons(F X, map(F, Y)) append(append(X, Y), Z) => append(X, append(Y, Z)) map(F, append(X, Y)) => append(map(F, X), map(F, Y)) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): append(cons(X, Y), Z) >? cons(X, append(Y, Z)) map(F, nil) >? nil We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {append, cons, map}, and the following precedence: append > cons > map Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: append(cons(X, Y), Z) > cons(X, append(Y, Z)) map(F, _|_) >= _|_ With these choices, we have: 1] append(cons(X, Y), Z) > cons(X, append(Y, Z)) because [2], by definition 2] append*(cons(X, Y), Z) >= cons(X, append(Y, Z)) because append > cons, [3] and [7], by (Copy) 3] append*(cons(X, Y), Z) >= X because [4], by (Select) 4] cons(X, Y) >= X because [5], by (Star) 5] cons*(X, Y) >= X because [6], by (Select) 6] X >= X by (Meta) 7] append*(cons(X, Y), Z) >= append(Y, Z) because append in Mul, [8] and [11], by (Stat) 8] cons(X, Y) > Y because [9], by definition 9] cons*(X, Y) >= Y because [10], by (Select) 10] Y >= Y by (Meta) 11] Z >= Z by (Meta) 12] map(F, _|_) >= _|_ by (Bot) We can thus remove the following rules: append(cons(X, Y), Z) => cons(X, append(Y, Z)) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): map(F, nil) >? nil We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[nil]] = _|_ We choose Lex = {} and Mul = {map}, and the following precedence: map Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: map(F, _|_) > _|_ With these choices, we have: 1] map(F, _|_) > _|_ because [2], by definition 2] map*(F, _|_) >= _|_ by (Bot) We can thus remove the following rules: map(F, nil) => nil 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.