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