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