We consider the system 434. Alphabet: 0 : [] --> nat cons : [nat * natlist] --> natlist foldl : [nat -> nat -> nat * nat * natlist] --> nat nil : [] --> natlist plus : [nat * nat] --> nat sum : [natlist] --> nat Rules: foldl(/\x./\y.X(x, y), Y, nil) => Y foldl(/\x./\y.X(x, y), Y, cons(Z, U)) => foldl(/\z./\u.X(z, u), X(Y, Z), U) sum(X) => foldl(/\x./\y.plus(x, y), 0, 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]): foldl(/\x./\y.X(x, y), Y, nil) >? Y foldl(/\x./\y.X(x, y), Y, cons(Z, U)) >? foldl(/\z./\u.X(z, u), X(Y, Z), U) sum(X) >? foldl(/\x./\y.plus(x, y), 0, X) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[foldl(x_1, x_2, x_3)]] = foldl(x_1, x_3, x_2) We choose Lex = {foldl} and Mul = {cons, nil, plus, sum}, and the following precedence: sum > cons > foldl > nil > plus Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: foldl(/\x./\y.X(x, y), Y, nil) > Y foldl(/\x./\y.X(x, y), Y, cons(Z, U)) >= foldl(/\x./\y.X(x, y), X(Y, Z), U) sum(X) >= foldl(/\x./\y.plus(x, y), _|_, X) With these choices, we have: 1] foldl(/\x./\y.X(x, y), Y, nil) > Y because [2], by definition 2] foldl*(/\x./\y.X(x, y), Y, nil) >= Y because [3], by (Select) 3] Y >= Y by (Meta) 4] foldl(/\x./\y.X(x, y), Y, cons(Z, U)) >= foldl(/\x./\y.X(x, y), X(Y, Z), U) because [5], by (Star) 5] foldl*(/\x./\y.X(x, y), Y, cons(Z, U)) >= foldl(/\x./\y.X(x, y), X(Y, Z), U) because [6], [11], [14], [21] and [29], by (Stat) 6] /\x./\z.X(x, z) >= /\x./\z.X(x, z) because [7], by (Abs) 7] /\z.X(y, z) >= /\z.X(y, z) because [8], by (Abs) 8] X(y, x) >= X(y, x) because [9] and [10], by (Meta) 9] y >= y by (Var) 10] x >= x by (Var) 11] cons(Z, U) > U because [12], by definition 12] cons*(Z, U) >= U because [13], by (Select) 13] U >= U by (Meta) 14] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= /\z./\u.X(z, u) because [15], by (F-Abs) 15] foldl*(/\z./\u.X(z, u), Y, cons(Z, U), v) >= /\z.X(v, z) because [16], by (Select) 16] /\z.X(foldl*(/\u./\x'.X(u, x'), Y, cons(Z, U), v), z) >= /\z.X(v, z) because [17], by (Abs) 17] X(foldl*(/\z./\u.X(z, u), Y, cons(Z, U), v), w) >= X(v, w) because [18] and [20], by (Meta) 18] foldl*(/\z./\u.X(z, u), Y, cons(Z, U), v) >= v because [19], by (Select) 19] v >= v by (Var) 20] w >= w by (Var) 21] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= X(Y, Z) because [22], by (Select) 22] X(foldl*(/\z./\u.X(z, u), Y, cons(Z, U)), foldl*(/\x'./\y'.X(x', y'), Y, cons(Z, U))) >= X(Y, Z) because [23] and [25], by (Meta) 23] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= Y because [24], by (Select) 24] Y >= Y by (Meta) 25] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= Z because [26], by (Select) 26] cons(Z, U) >= Z because [27], by (Star) 27] cons*(Z, U) >= Z because [28], by (Select) 28] Z >= Z by (Meta) 29] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= U because [30], by (Select) 30] cons(Z, U) >= U because [12], by (Star) 31] sum(X) >= foldl(/\x./\y.plus(x, y), _|_, X) because [32], by (Star) 32] sum*(X) >= foldl(/\x./\y.plus(x, y), _|_, X) because sum > foldl, [33], [40] and [41], by (Copy) 33] sum*(X) >= /\y./\z.plus(y, z) because [34], by (F-Abs) 34] sum*(X, x) >= /\z.plus(x, z) because [35], by (F-Abs) 35] sum*(X, x, y) >= plus(x, y) because sum > plus, [36] and [38], by (Copy) 36] sum*(X, x, y) >= x because [37], by (Select) 37] x >= x by (Var) 38] sum*(X, x, y) >= y because [39], by (Select) 39] y >= y by (Var) 40] sum*(X) >= _|_ by (Bot) 41] sum*(X) >= X because [42], by (Select) 42] X >= X by (Meta) We can thus remove the following rules: foldl(/\x./\y.X(x, y), Y, nil) => 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]): foldl(/\x./\y.X(x, y), Y, cons(Z, U)) >? foldl(/\z./\u.X(z, u), X(Y, Z), U) sum(X) >? foldl(/\x./\y.plus(x, y), 0, X) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[foldl(x_1, x_2, x_3)]] = foldl(x_3, x_2, x_1) We choose Lex = {foldl} and Mul = {cons, plus, sum}, and the following precedence: sum > foldl > cons > plus Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: foldl(/\x./\y.X(x, y), Y, cons(Z, U)) >= foldl(/\x./\y.X(x, y), X(Y, Z), U) sum(X) > foldl(/\x./\y.plus(x, y), _|_, X) With these choices, we have: 1] foldl(/\x./\y.X(x, y), Y, cons(Z, U)) >= foldl(/\x./\y.X(x, y), X(Y, Z), U) because [2], by (Star) 2] foldl*(/\x./\y.X(x, y), Y, cons(Z, U)) >= foldl(/\x./\y.X(x, y), X(Y, Z), U) because [3], [6], [12] and [20], by (Stat) 3] cons(Z, U) > U because [4], by definition 4] cons*(Z, U) >= U because [5], by (Select) 5] U >= U by (Meta) 6] foldl*(/\x./\y.X(x, y), Y, cons(Z, U)) >= /\x./\y.X(x, y) because [7], by (Select) 7] /\x./\z.X(x, z) >= /\x./\z.X(x, z) because [8], by (Abs) 8] /\z.X(y, z) >= /\z.X(y, z) because [9], by (Abs) 9] X(y, x) >= X(y, x) because [10] and [11], by (Meta) 10] y >= y by (Var) 11] x >= x by (Var) 12] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= X(Y, Z) because [13], by (Select) 13] X(foldl*(/\z./\u.X(z, u), Y, cons(Z, U)), foldl*(/\v./\w.X(v, w), Y, cons(Z, U))) >= X(Y, Z) because [14] and [16], by (Meta) 14] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= Y because [15], by (Select) 15] Y >= Y by (Meta) 16] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= Z because [17], by (Select) 17] cons(Z, U) >= Z because [18], by (Star) 18] cons*(Z, U) >= Z because [19], by (Select) 19] Z >= Z by (Meta) 20] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= U because [21], by (Select) 21] cons(Z, U) >= U because [4], by (Star) 22] sum(X) > foldl(/\x./\y.plus(x, y), _|_, X) because [23], by definition 23] sum*(X) >= foldl(/\x./\y.plus(x, y), _|_, X) because sum > foldl, [24], [31] and [32], by (Copy) 24] sum*(X) >= /\y./\z.plus(y, z) because [25], by (F-Abs) 25] sum*(X, x) >= /\z.plus(x, z) because [26], by (F-Abs) 26] sum*(X, x, y) >= plus(x, y) because sum > plus, [27] and [29], by (Copy) 27] sum*(X, x, y) >= x because [28], by (Select) 28] x >= x by (Var) 29] sum*(X, x, y) >= y because [30], by (Select) 30] y >= y by (Var) 31] sum*(X) >= _|_ by (Bot) 32] sum*(X) >= X because [33], by (Select) 33] X >= X by (Meta) We can thus remove the following rules: sum(X) => foldl(/\x./\y.plus(x, y), 0, 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]): foldl(/\x./\y.X(x, y), Y, cons(Z, U)) >? foldl(/\z./\u.X(z, u), X(Y, Z), U) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[foldl(x_1, x_2, x_3)]] = foldl(x_3, x_2, x_1) We choose Lex = {foldl} and Mul = {cons}, and the following precedence: foldl > cons Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: foldl(/\x./\y.X(x, y), Y, cons(Z, U)) > foldl(/\x./\y.X(x, y), X(Y, Z), U) With these choices, we have: 1] foldl(/\x./\y.X(x, y), Y, cons(Z, U)) > foldl(/\x./\y.X(x, y), X(Y, Z), U) because [2], by definition 2] foldl*(/\x./\y.X(x, y), Y, cons(Z, U)) >= foldl(/\x./\y.X(x, y), X(Y, Z), U) because [3], [6], [12] and [20], by (Stat) 3] cons(Z, U) > U because [4], by definition 4] cons*(Z, U) >= U because [5], by (Select) 5] U >= U by (Meta) 6] foldl*(/\x./\y.X(x, y), Y, cons(Z, U)) >= /\x./\y.X(x, y) because [7], by (Select) 7] /\x./\z.X(x, z) >= /\x./\z.X(x, z) because [8], by (Abs) 8] /\z.X(y, z) >= /\z.X(y, z) because [9], by (Abs) 9] X(y, x) >= X(y, x) because [10] and [11], by (Meta) 10] y >= y by (Var) 11] x >= x by (Var) 12] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= X(Y, Z) because [13], by (Select) 13] X(foldl*(/\z./\u.X(z, u), Y, cons(Z, U)), foldl*(/\v./\w.X(v, w), Y, cons(Z, U))) >= X(Y, Z) because [14] and [16], by (Meta) 14] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= Y because [15], by (Select) 15] Y >= Y by (Meta) 16] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= Z because [17], by (Select) 17] cons(Z, U) >= Z because [18], by (Star) 18] cons*(Z, U) >= Z because [19], by (Select) 19] Z >= Z by (Meta) 20] foldl*(/\z./\u.X(z, u), Y, cons(Z, U)) >= U because [21], by (Select) 21] cons(Z, U) >= U because [4], by (Star) We can thus remove the following rules: foldl(/\x./\y.X(x, y), Y, cons(Z, U)) => foldl(/\z./\u.X(z, u), X(Y, Z), U) 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.