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