We consider the system Applicative_first_order_05__30. Alphabet: !faccolon : [a * a] --> a C : [] --> a cons : [c * d] --> d false : [] --> b filter : [c -> b * d] --> d filter2 : [b * c -> b * c * d] --> d map : [c -> c * d] --> d nil : [] --> d true : [] --> b Rules: !faccolon(!faccolon(!faccolon(!faccolon(C, x), y), z), u) => !faccolon(!faccolon(x, z), !faccolon(!faccolon(!faccolon(x, y), z), u)) 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]): !faccolon(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) >? !faccolon(!faccolon(X, Z), !faccolon(!faccolon(!faccolon(X, Y), Z), U)) 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: [[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) We choose Lex = {!faccolon, filter, filter2} and Mul = {@_{o -> o}, C, cons, false, map, nil, true}, and the following precedence: true > map > false > C > filter = filter2 > @_{o -> o} > cons > nil > !faccolon Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: !faccolon(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) > !faccolon(!faccolon(X, Z), !faccolon(!faccolon(!faccolon(X, Y), Z), U)) 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] !faccolon(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) > !faccolon(!faccolon(X, Z), !faccolon(!faccolon(!faccolon(X, Y), Z), U)) because [2], by definition 2] !faccolon*(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) >= !faccolon(!faccolon(X, Z), !faccolon(!faccolon(!faccolon(X, Y), Z), U)) because [3], [14] and [18], by (Stat) 3] !faccolon(!faccolon(!faccolon(C, X), Y), Z) > !faccolon(X, Z) because [4], by definition 4] !faccolon*(!faccolon(!faccolon(C, X), Y), Z) >= !faccolon(X, Z) because [5], [10] and [12], by (Stat) 5] !faccolon(!faccolon(C, X), Y) > X because [6], by definition 6] !faccolon*(!faccolon(C, X), Y) >= X because [7], by (Select) 7] !faccolon(C, X) >= X because [8], by (Star) 8] !faccolon*(C, X) >= X because [9], by (Select) 9] X >= X by (Meta) 10] !faccolon*(!faccolon(!faccolon(C, X), Y), Z) >= X because [11], by (Select) 11] !faccolon(!faccolon(C, X), Y) >= X because [6], by (Star) 12] !faccolon*(!faccolon(!faccolon(C, X), Y), Z) >= Z because [13], by (Select) 13] Z >= Z by (Meta) 14] !faccolon*(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) >= !faccolon(X, Z) because [15], by (Select) 15] !faccolon(!faccolon(!faccolon(C, X), Y), Z) >= !faccolon(X, Z) because [16] and [17], by (Fun) 16] !faccolon(!faccolon(C, X), Y) >= X because [6], by (Star) 17] Z >= Z by (Meta) 18] !faccolon*(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) >= !faccolon(!faccolon(!faccolon(X, Y), Z), U) because [19], [30] and [35], by (Stat) 19] !faccolon(!faccolon(!faccolon(C, X), Y), Z) > !faccolon(!faccolon(X, Y), Z) because [20], by definition 20] !faccolon*(!faccolon(!faccolon(C, X), Y), Z) >= !faccolon(!faccolon(X, Y), Z) because [21], [27] and [12], by (Stat) 21] !faccolon(!faccolon(C, X), Y) > !faccolon(X, Y) because [22], by definition 22] !faccolon*(!faccolon(C, X), Y) >= !faccolon(X, Y) because [23], [6] and [25], by (Stat) 23] !faccolon(C, X) > X because [24], by definition 24] !faccolon*(C, X) >= X because [9], by (Select) 25] !faccolon*(!faccolon(C, X), Y) >= Y because [26], by (Select) 26] Y >= Y by (Meta) 27] !faccolon*(!faccolon(!faccolon(C, X), Y), Z) >= !faccolon(X, Y) because [5], [10] and [28], by (Stat) 28] !faccolon*(!faccolon(!faccolon(C, X), Y), Z) >= Y because [29], by (Select) 29] !faccolon(!faccolon(C, X), Y) >= Y because [25], by (Star) 30] !faccolon*(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) >= !faccolon(!faccolon(X, Y), Z) because [31], by (Select) 31] !faccolon(!faccolon(!faccolon(C, X), Y), Z) >= !faccolon(!faccolon(X, Y), Z) because [32] and [17], by (Fun) 32] !faccolon(!faccolon(C, X), Y) >= !faccolon(X, Y) because [33] and [34], by (Fun) 33] !faccolon(C, X) >= X because [24], by (Star) 34] Y >= Y by (Meta) 35] !faccolon*(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) >= U because [36], by (Select) 36] U >= U by (Meta) 37] map(F, nil) > nil because [38], by definition 38] map*(F, nil) >= nil because map > nil, by (Copy) 39] map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) because [40], by definition 40] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [41] and [48], by (Copy) 41] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [42] and [44], by (Copy) 42] map*(F, cons(X, Y)) >= F because [43], by (Select) 43] F >= F by (Meta) 44] map*(F, cons(X, Y)) >= X because [45], by (Select) 45] cons(X, Y) >= X because [46], by (Star) 46] cons*(X, Y) >= X because [47], by (Select) 47] X >= X by (Meta) 48] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [49] and [50], by (Stat) 49] F >= F by (Meta) 50] cons(X, Y) > Y because [51], by definition 51] cons*(X, Y) >= Y because [52], by (Select) 52] Y >= Y by (Meta) 53] filter(F, nil) >= nil because [54], by (Star) 54] filter*(F, nil) >= nil because [55], by (Select) 55] nil >= nil by (Fun) 56] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [57], by (Star) 57] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [58], [61], [62], [64] and [68], by (Stat) 58] cons(X, Y) > Y because [59], by definition 59] cons*(X, Y) >= Y because [60], by (Select) 60] Y >= Y by (Meta) 61] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [62] and [64], by (Copy) 62] filter*(F, cons(X, Y)) >= F because [63], by (Select) 63] F >= F by (Meta) 64] filter*(F, cons(X, Y)) >= X because [65], by (Select) 65] cons(X, Y) >= X because [66], by (Star) 66] cons*(X, Y) >= X because [67], by (Select) 67] X >= X by (Meta) 68] filter*(F, cons(X, Y)) >= Y because [69], by (Select) 69] cons(X, Y) >= Y because [59], by (Star) 70] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [71], by (Star) 71] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [72] and [74], by (Copy) 72] filter2*(true, F, X, Y) >= X because [73], by (Select) 73] X >= X by (Meta) 74] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [75], [76], [77] and [78], by (Stat) 75] F >= F by (Meta) 76] Y >= Y by (Meta) 77] filter2*(true, F, X, Y) >= F because [75], by (Select) 78] filter2*(true, F, X, Y) >= Y because [76], by (Select) 79] filter2(false, F, X, Y) >= filter(F, Y) because [80], by (Star) 80] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [81], [82], [83] and [84], by (Stat) 81] F >= F by (Meta) 82] Y >= Y by (Meta) 83] filter2*(false, F, X, Y) >= F because [81], by (Select) 84] filter2*(false, F, X, Y) >= Y because [82], by (Select) We can thus remove the following rules: !faccolon(!faccolon(!faccolon(!faccolon(C, X), Y), Z), U) => !faccolon(!faccolon(X, Z), !faccolon(!faccolon(!faccolon(X, Y), Z), U)) map(F, nil) => nil 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]): 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_3, x_1) [[nil]] = _|_ We choose Lex = {filter, filter2} and Mul = {@_{o -> o}, cons, false, true}, and the following precedence: true > filter = filter2 > false > cons > @_{o -> o} Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: 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] filter(F, _|_) > _|_ because [2], by definition 2] filter*(F, _|_) >= _|_ by (Bot) 3] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [4], by (Star) 4] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [5], [6], [9], [10], [11] and [15], by (Stat) 5] F >= F by (Meta) 6] cons(X, Y) > Y because [7], by definition 7] cons*(X, Y) >= Y because [8], by (Select) 8] Y >= Y by (Meta) 9] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [10] and [11], by (Copy) 10] filter*(F, cons(X, Y)) >= F because [5], by (Select) 11] filter*(F, cons(X, Y)) >= X because [12], by (Select) 12] cons(X, Y) >= X because [13], by (Star) 13] cons*(X, Y) >= X because [14], by (Select) 14] X >= X by (Meta) 15] filter*(F, cons(X, Y)) >= Y because [16], by (Select) 16] cons(X, Y) >= Y because [7], by (Star) 17] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [18], by (Star) 18] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [19] and [21], by (Copy) 19] filter2*(true, F, X, Y) >= X because [20], by (Select) 20] X >= X by (Meta) 21] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [22], [23], [24] and [25], by (Stat) 22] F >= F by (Meta) 23] Y >= Y by (Meta) 24] filter2*(true, F, X, Y) >= F because [22], by (Select) 25] filter2*(true, F, X, Y) >= Y because [23], by (Select) 26] filter2(false, F, X, Y) > filter(F, Y) because [27], by definition 27] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [28], [29], [30] and [31], by (Stat) 28] F >= F by (Meta) 29] Y >= Y by (Meta) 30] filter2*(false, F, X, Y) >= F because [28], by (Select) 31] filter2*(false, F, X, Y) >= Y because [29], by (Select) We can thus remove the following rules: filter(F, nil) => nil 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]): filter(F, cons(X, Y)) >? filter2(F X, F, X, Y) filter2(true, F, X, Y) >? cons(X, 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) We choose Lex = {filter, filter2} and Mul = {@_{o -> o}, cons, true}, and the following precedence: filter = filter2 > cons > @_{o -> o} > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) filter2(true, F, X, Y) > cons(X, filter(F, Y)) With these choices, we have: 1] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [2], by (Star) 2] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [3], [4], [7], [8], [9] and [13], by (Stat) 3] F >= F by (Meta) 4] cons(X, Y) > Y because [5], by definition 5] cons*(X, Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [8] and [9], by (Copy) 8] filter*(F, cons(X, Y)) >= F because [3], by (Select) 9] filter*(F, cons(X, Y)) >= X because [10], by (Select) 10] cons(X, Y) >= X because [11], by (Star) 11] cons*(X, Y) >= X because [12], by (Select) 12] X >= X by (Meta) 13] filter*(F, cons(X, Y)) >= Y because [14], by (Select) 14] cons(X, Y) >= Y because [5], by (Star) 15] filter2(true, F, X, Y) > cons(X, filter(F, Y)) because [16], by definition 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], [21], [22] and [23], by (Stat) 20] F >= F by (Meta) 21] Y >= Y by (Meta) 22] filter2*(true, F, X, Y) >= F because [20], by (Select) 23] filter2*(true, F, X, Y) >= Y because [21], by (Select) 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]): filter(F, cons(X, Y)) >? filter2(F X, F, X, Y) We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {@_{o -> o}, cons, filter, filter2}, and the following precedence: filter > filter2 > cons > @_{o -> o} With these choices, we have: 1] filter(F, cons(X, Y)) > filter2(@_{o -> o}(F, X), F, X, Y) because [2], by definition 2] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter > filter2, [3], [4], [6] and [10], by (Copy) 3] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [4] and [6], by (Copy) 4] filter*(F, cons(X, Y)) >= F because [5], by (Select) 5] F >= F by (Meta) 6] filter*(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] filter*(F, cons(X, Y)) >= Y because [11], by (Select) 11] cons(X, Y) >= Y because [12], by (Star) 12] cons*(X, Y) >= Y because [13], by (Select) 13] Y >= Y by (Meta) We can thus remove the following rules: filter(F, cons(X, Y)) => filter2(F X, F, X, 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.