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