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