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: [[cons(x_1, x_2)]] = cons(x_2, x_1) [[filter(x_1, x_2)]] = filter(x_2, x_1) [[filter2(x_1, x_2, x_3, x_4)]] = filter2(x_4, x_2, x_1, x_3) We choose Lex = {cons, false, filter, filter2, true} and Mul = {!facplus, !factimes, @_{o -> o}, map, nil}, and the following precedence: !factimes > false > !facplus > map > nil > true > filter = filter2 > cons > @_{o -> o} 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, nil) >= nil map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) filter(F, nil) > nil 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, nil) >= nil because [13], by (Star) 13] map*(F, nil) >= nil because [14], by (Select) 14] nil >= nil by (Fun) 15] map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) because [16], by definition 16] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [17] and [24], by (Copy) 17] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [18] and [20], by (Copy) 18] map*(F, cons(X, Y)) >= F because [19], by (Select) 19] F >= F by (Meta) 20] map*(F, cons(X, Y)) >= X because [21], by (Select) 21] cons(X, Y) >= X because [22], by (Star) 22] cons*(X, Y) >= X because [23], by (Select) 23] X >= X by (Meta) 24] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [25] and [26], by (Stat) 25] F >= F by (Meta) 26] cons(X, Y) > Y because [27], by definition 27] cons*(X, Y) >= Y because [28], by (Select) 28] Y >= Y by (Meta) 29] filter(F, nil) > nil because [30], by definition 30] filter*(F, nil) >= nil because [14], by (Select) 31] filter(F, cons(X, Y)) > filter2(@_{o -> o}(F, X), F, X, Y) because [32], by definition 32] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [33], [36], [37], [39] and [43], by (Stat) 33] cons(X, Y) > Y because [34], by definition 34] cons*(X, Y) >= Y because [35], by (Select) 35] Y >= Y by (Meta) 36] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [37] and [39], by (Copy) 37] filter*(F, cons(X, Y)) >= F because [38], by (Select) 38] F >= F by (Meta) 39] filter*(F, cons(X, Y)) >= X because [40], by (Select) 40] cons(X, Y) >= X because [41], by (Star) 41] cons*(X, Y) >= X because [42], by (Select) 42] X >= X by (Meta) 43] filter*(F, cons(X, Y)) >= Y because [44], by (Select) 44] cons(X, Y) >= Y because [34], by (Star) 45] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [46], by (Star) 46] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [47] and [49], by (Copy) 47] filter2*(true, F, X, Y) >= X because [48], by (Select) 48] X >= X by (Meta) 49] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [50], [51], [52], [53], [50] and [51], by (Stat) 50] F >= F by (Meta) 51] Y >= Y by (Meta) 52] filter2*(true, F, X, Y) >= F because [50], by (Select) 53] filter2*(true, F, X, Y) >= Y because [51], by (Select) 54] filter2(false, F, X, Y) >= filter(F, Y) because [55], by (Star) 55] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [56], [57], [58], [59], [56] and [57], by (Stat) 56] F >= F by (Meta) 57] Y >= Y by (Meta) 58] filter2*(false, F, X, Y) >= F because [56], by (Select) 59] filter2*(false, F, X, Y) >= Y because [57], by (Select) We can thus remove the following rules: 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) 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 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]. We choose Lex = {} and Mul = {!facplus, !factimes, cons, false, filter, filter2, map, nil, true}, and the following precedence: !factimes > !facplus > false > filter2 > cons > filter > map > nil > true 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, nil) >= nil because [13], by (Star) 13] map*(F, nil) >= nil because map > nil, by (Copy) 14] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [15], by (Star) 15] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [16] and [18], by (Copy) 16] filter2*(true, F, X, Y) >= X because [17], by (Select) 17] X >= X by (Meta) 18] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 > filter, [19] and [21], by (Copy) 19] filter2*(true, F, X, Y) >= F because [20], by (Select) 20] F >= F by (Meta) 21] filter2*(true, F, X, Y) >= Y because [22], by (Select) 22] Y >= Y by (Meta) 23] filter2(false, F, X, Y) > filter(F, Y) because [24], by definition 24] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 > filter, [25] and [27], by (Copy) 25] filter2*(false, F, X, Y) >= F because [26], by (Select) 26] F >= F by (Meta) 27] filter2*(false, F, X, Y) >= Y because [28], by (Select) 28] Y >= Y by (Meta) We can thus remove the following rules: 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 filter2(true, F, X, Y) >? cons(X, filter(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {!facplus, !factimes, cons, filter, filter2, map, nil, true}, and the following precedence: !factimes > !facplus > filter2 > cons > filter > map > nil > true 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, nil) > nil because [13], by definition 13] map*(F, nil) >= nil because [14], by (Select) 14] nil >= nil by (Fun) 15] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [16], by (Star) 16] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [17] and [19], by (Copy) 17] filter2*(true, F, X, Y) >= X because [18], by (Select) 18] X >= X by (Meta) 19] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 > filter, [20] and [22], by (Copy) 20] filter2*(true, F, X, Y) >= F because [21], by (Select) 21] F >= F by (Meta) 22] filter2*(true, F, X, Y) >= Y because [23], by (Select) 23] Y >= Y by (Meta) We can thus remove the following rules: map(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]): !factimes(X, !facplus(Y, Z)) >? !facplus(!factimes(X, Y), !factimes(X, Z)) filter2(true, F, X, Y) >? cons(X, filter(F, Y)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[filter(x_1, x_2)]] = filter(x_2, x_1) We choose Lex = {filter} and Mul = {!facplus, !factimes, cons, filter2, true}, and the following precedence: !factimes > !facplus > filter2 > cons = true > filter 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)) 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 (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] filter2(true, F, X, Y) > cons(X, filter(F, Y)) because [13], by definition 13] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [14] and [16], by (Copy) 14] filter2*(true, F, X, Y) >= X because [15], by (Select) 15] X >= X by (Meta) 16] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 > filter, [17] and [19], by (Copy) 17] filter2*(true, F, X, Y) >= F because [18], by (Select) 18] F >= F by (Meta) 19] filter2*(true, F, X, Y) >= Y because [20], by (Select) 20] Y >= Y by (Meta) We can thus remove the following rules: 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]): !factimes(X, !facplus(Y, Z)) >? !facplus(!factimes(X, Y), !factimes(X, Z)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[!facplus(x_1, x_2)]] = !facplus(x_2, x_1) We choose Lex = {!facplus} and Mul = {!factimes}, and the following precedence: !factimes > !facplus 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)) 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) We can thus remove the following rules: !factimes(X, !facplus(Y, Z)) => !facplus(!factimes(X, Y), !factimes(X, Z)) 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.