We consider the system Applicative_first_order_05__#3.16. Alphabet: 0 : [] --> 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 plus : [a * a] --> a s : [a] --> a times : [a * a] --> a true : [] --> b Rules: times(x, 0) => 0 times(x, s(y)) => plus(times(x, y), x) plus(x, 0) => x plus(0, x) => x plus(x, s(y)) => s(plus(x, y)) plus(s(x), y) => s(plus(x, 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]): times(X, 0) >? 0 times(X, s(Y)) >? plus(times(X, Y), X) plus(X, 0) >? X plus(0, X) >? X plus(X, s(Y)) >? s(plus(X, Y)) plus(s(X), Y) >? s(plus(X, 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: [[cons(x_1, x_2)]] = cons(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_1, x_3) [[nil]] = _|_ We choose Lex = {cons, false, filter, filter2, true} and Mul = {0, @_{o -> o}, map, plus, s, times}, and the following precedence: 0 > false > filter = filter2 > map > @_{o -> o} > times > plus > s > cons = true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: times(X, 0) >= 0 times(X, s(Y)) > plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) > X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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] times(X, 0) >= 0 because [2], by (Star) 2] times*(X, 0) >= 0 because [3], by (Select) 3] 0 >= 0 by (Fun) 4] times(X, s(Y)) > plus(times(X, Y), X) because [5], by definition 5] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [6] and [11], by (Copy) 6] times*(X, s(Y)) >= times(X, Y) because times in Mul, [7] and [8], by (Stat) 7] X >= X by (Meta) 8] s(Y) > Y because [9], by definition 9] s*(Y) >= Y because [10], by (Select) 10] Y >= Y by (Meta) 11] times*(X, s(Y)) >= X because [7], by (Select) 12] plus(X, 0) >= X because [13], by (Star) 13] plus*(X, 0) >= X because [14], by (Select) 14] X >= X by (Meta) 15] plus(0, X) > X because [16], by definition 16] plus*(0, X) >= X because [17], by (Select) 17] X >= X by (Meta) 18] plus(X, s(Y)) >= s(plus(X, Y)) because [19], by (Star) 19] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [20], by (Copy) 20] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [21] and [22], by (Stat) 21] X >= X by (Meta) 22] s(Y) > Y because [23], by definition 23] s*(Y) >= Y because [24], by (Select) 24] Y >= Y by (Meta) 25] plus(s(X), Y) >= s(plus(X, Y)) because [26], by (Star) 26] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [27], by (Copy) 27] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [28] and [31], by (Stat) 28] s(X) > X because [29], by definition 29] s*(X) >= X because [30], by (Select) 30] X >= X by (Meta) 31] Y >= Y by (Meta) 32] map(F, _|_) > _|_ because [33], by definition 33] map*(F, _|_) >= _|_ by (Bot) 34] map(F, cons(X, Y)) > cons(@_{o -> o}(F, X), map(F, Y)) because [35], by definition 35] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [36] and [43], by (Copy) 36] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [37] and [39], by (Copy) 37] map*(F, cons(X, Y)) >= F because [38], by (Select) 38] F >= F by (Meta) 39] map*(F, cons(X, Y)) >= X because [40], by (Select) 40] cons(X, Y) >= X because [41], by (Star) 41] cons*(X, Y) >= X because [42], by (Select) 42] X >= X by (Meta) 43] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [44] and [45], by (Stat) 44] F >= F by (Meta) 45] cons(X, Y) > Y because [46], by definition 46] cons*(X, Y) >= Y because [47], by (Select) 47] Y >= Y by (Meta) 48] filter(F, _|_) > _|_ because [49], by definition 49] filter*(F, _|_) >= _|_ by (Bot) 50] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [51], by (Star) 51] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [52], [55], [56], [58] and [62], by (Stat) 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, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [56] and [58], by (Copy) 56] filter*(F, cons(X, Y)) >= F because [57], by (Select) 57] F >= F by (Meta) 58] filter*(F, cons(X, Y)) >= X because [59], by (Select) 59] cons(X, Y) >= X because [60], by (Star) 60] cons*(X, Y) >= X because [61], by (Select) 61] X >= X by (Meta) 62] filter*(F, cons(X, Y)) >= Y because [63], by (Select) 63] cons(X, Y) >= Y because [53], by (Star) 64] filter2(true, F, X, Y) > cons(X, filter(F, Y)) because [65], by definition 65] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [66] and [68], by (Copy) 66] filter2*(true, F, X, Y) >= X because [67], by (Select) 67] X >= X by (Meta) 68] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [69], [70], [71], [72], [69] and [70], by (Stat) 69] F >= F by (Meta) 70] Y >= Y by (Meta) 71] filter2*(true, F, X, Y) >= F because [69], by (Select) 72] filter2*(true, F, X, Y) >= Y because [70], by (Select) 73] filter2(false, F, X, Y) > filter(F, Y) because [74], by definition 74] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [75], [76], [77], [78], [75] and [76], by (Stat) 75] F >= F by (Meta) 76] Y >= Y by (Meta) 77] filter2*(false, F, X, Y) >= F because [75], by (Select) 78] filter2*(false, F, X, Y) >= Y because [76], by (Select) We can thus remove the following rules: times(X, s(Y)) => plus(times(X, Y), X) plus(0, X) => X map(F, nil) => nil 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 rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): times(X, 0) >? 0 plus(X, 0) >? X plus(X, s(Y)) >? s(plus(X, Y)) plus(s(X), Y) >? s(plus(X, Y)) filter(F, cons(X, Y)) >? filter2(F X, F, X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 2 cons = Lam[y0;y1].3 + 3*y0 + 3*y1 filter = Lam[G0;y1].3 + 3*y1 + 3*y1*G0(y1) + 3*G0(0) + 3*G0(y1) filter2 = Lam[y0;G1;y2;y3].y0 + y2 + y3 + 2*G1(y2) plus = Lam[y0;y1].3 + 3*y0 + 3*y1 s = Lam[y0].y0 times = Lam[y0;y1].3 + y0 + 3*y1 Using this interpretation, the requirements translate to: [[times(_x0, 0)]] = 9 + x0 > 2 = [[0]] [[plus(_x0, 0)]] = 9 + 3*x0 > x0 = [[_x0]] [[plus(_x0, s(_x1))]] = 3 + 3*x0 + 3*x1 >= 3 + 3*x0 + 3*x1 = [[s(plus(_x0, _x1))]] [[plus(s(_x0), _x1)]] = 3 + 3*x0 + 3*x1 >= 3 + 3*x0 + 3*x1 = [[s(plus(_x0, _x1))]] [[filter(_F0, cons(_x1, _x2))]] = 12 + 9*x1 + 9*x2 + 3*F0(0) + 9*x1*F0(3 + 3*x1 + 3*x2) + 9*x2*F0(3 + 3*x1 + 3*x2) + 12*F0(3 + 3*x1 + 3*x2) > x2 + 2*x1 + 3*F0(x1) = [[filter2(_F0 _x1, _F0, _x1, _x2)]] We can thus remove the following rules: times(X, 0) => 0 plus(X, 0) => X 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]): plus(X, s(Y)) >? s(plus(X, Y)) plus(s(X), Y) >? s(plus(X, Y)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: plus = Lam[y0;y1].3*y0 + 3*y1 s = Lam[y0].2 + y0 Using this interpretation, the requirements translate to: [[plus(_x0, s(_x1))]] = 6 + 3*x0 + 3*x1 > 2 + 3*x0 + 3*x1 = [[s(plus(_x0, _x1))]] [[plus(s(_x0), _x1)]] = 6 + 3*x0 + 3*x1 > 2 + 3*x0 + 3*x1 = [[s(plus(_x0, _x1))]] We can thus remove the following rules: plus(X, s(Y)) => s(plus(X, Y)) plus(s(X), Y) => s(plus(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.