We consider the system AotoYamada_05__004. Alphabet: 0 : [] --> b cons : [a * b] --> b nil : [] --> b plus : [b * b] --> b s : [b] --> b sumwith : [a -> b * b] --> b Rules: plus(0, x) => x plus(s(x), y) => s(plus(x, y)) sumwith(f, nil) => nil sumwith(f, cons(x, y)) => plus(f x, sumwith(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]): plus(0, X) >? X plus(s(X), Y) >? s(plus(X, Y)) sumwith(F, nil) >? nil sumwith(F, cons(X, Y)) >? plus(F X, sumwith(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[s(x_1)]] = x_1 We choose Lex = {} and Mul = {0, @_{o -> o}, cons, nil, plus, sumwith}, and the following precedence: cons > 0 > sumwith > plus > nil > @_{o -> o} Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: plus(0, X) > X plus(X, Y) >= plus(X, Y) sumwith(F, nil) > nil sumwith(F, cons(X, Y)) >= plus(@_{o -> o}(F, X), sumwith(F, Y)) With these choices, we have: 1] plus(0, X) > X because [2], by definition 2] plus*(0, X) >= X because [3], by (Select) 3] X >= X by (Meta) 4] plus(X, Y) >= plus(X, Y) because plus in Mul, [5] and [6], by (Fun) 5] X >= X by (Meta) 6] Y >= Y by (Meta) 7] sumwith(F, nil) > nil because [8], by definition 8] sumwith*(F, nil) >= nil because sumwith > nil, by (Copy) 9] sumwith(F, cons(X, Y)) >= plus(@_{o -> o}(F, X), sumwith(F, Y)) because [10], by (Star) 10] sumwith*(F, cons(X, Y)) >= plus(@_{o -> o}(F, X), sumwith(F, Y)) because sumwith > plus, [11] and [18], by (Copy) 11] sumwith*(F, cons(X, Y)) >= @_{o -> o}(F, X) because sumwith > @_{o -> o}, [12] and [14], by (Copy) 12] sumwith*(F, cons(X, Y)) >= F because [13], by (Select) 13] F >= F by (Meta) 14] sumwith*(F, cons(X, Y)) >= X because [15], by (Select) 15] cons(X, Y) >= X because [16], by (Star) 16] cons*(X, Y) >= X because [17], by (Select) 17] X >= X by (Meta) 18] sumwith*(F, cons(X, Y)) >= sumwith(F, Y) because sumwith in Mul, [19] and [20], by (Stat) 19] F >= F by (Meta) 20] cons(X, Y) > Y because [21], by definition 21] cons*(X, Y) >= Y because [22], by (Select) 22] Y >= Y by (Meta) We can thus remove the following rules: plus(0, X) => X sumwith(F, nil) => nil 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)) sumwith(F, cons(X, Y)) >? plus(F X, sumwith(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {@_{o -> o}, cons, plus, s, sumwith}, and the following precedence: cons > sumwith > @_{o -> o} > plus > s With these choices, we have: 1] plus(s(X), Y) > s(plus(X, Y)) because [2], by definition 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] sumwith(F, cons(X, Y)) >= plus(@_{o -> o}(F, X), sumwith(F, Y)) because [9], by (Star) 9] sumwith*(F, cons(X, Y)) >= plus(@_{o -> o}(F, X), sumwith(F, Y)) because sumwith > plus, [10] and [17], by (Copy) 10] sumwith*(F, cons(X, Y)) >= @_{o -> o}(F, X) because sumwith > @_{o -> o}, [11] and [13], by (Copy) 11] sumwith*(F, cons(X, Y)) >= F because [12], by (Select) 12] F >= F by (Meta) 13] sumwith*(F, cons(X, Y)) >= X because [14], by (Select) 14] cons(X, Y) >= X because [15], by (Star) 15] cons*(X, Y) >= X because [16], by (Select) 16] X >= X by (Meta) 17] sumwith*(F, cons(X, Y)) >= sumwith(F, Y) because sumwith in Mul, [18] and [19], by (Stat) 18] F >= F by (Meta) 19] cons(X, Y) > Y because [20], by definition 20] cons*(X, Y) >= Y because [21], by (Select) 21] Y >= Y by (Meta) We can thus remove the following rules: plus(s(X), Y) => s(plus(X, 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]): sumwith(F, cons(X, Y)) >? plus(F X, sumwith(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {@_{o -> o}, cons, plus, sumwith}, and the following precedence: sumwith > cons > plus > @_{o -> o} With these choices, we have: 1] sumwith(F, cons(X, Y)) > plus(@_{o -> o}(F, X), sumwith(F, Y)) because [2], by definition 2] sumwith*(F, cons(X, Y)) >= plus(@_{o -> o}(F, X), sumwith(F, Y)) because sumwith > plus, [3] and [10], by (Copy) 3] sumwith*(F, cons(X, Y)) >= @_{o -> o}(F, X) because sumwith > @_{o -> o}, [4] and [6], by (Copy) 4] sumwith*(F, cons(X, Y)) >= F because [5], by (Select) 5] F >= F by (Meta) 6] sumwith*(F, cons(X, Y)) >= 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] sumwith*(F, cons(X, Y)) >= sumwith(F, Y) because sumwith in Mul, [11] and [12], by (Stat) 11] F >= F by (Meta) 12] cons(X, Y) > Y because [13], by definition 13] cons*(X, Y) >= Y because [14], by (Select) 14] Y >= Y by (Meta) We can thus remove the following rules: sumwith(F, cons(X, Y)) => plus(F X, sumwith(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.