0.00/0.40 YES 0.00/0.41 We consider the system theBenchmark. 0.00/0.41 0.00/0.41 Alphabet: 0.00/0.41 0.00/0.41 0 : [] --> nat 0.00/0.41 cons : [nat * list] --> list 0.00/0.41 foldl : [nat -> nat -> nat * nat * list] --> nat 0.00/0.41 nil : [] --> list 0.00/0.41 plus : [nat * nat] --> nat 0.00/0.41 plusc : [] --> nat -> nat -> nat 0.00/0.41 sum : [list] --> nat 0.00/0.41 0.00/0.41 Rules: 0.00/0.41 0.00/0.41 foldl(f, x, nil) => x 0.00/0.41 foldl(f, x, cons(y, z)) => foldl(f, f x y, z) 0.00/0.41 plusc => /\x./\y.plus(x, y) 0.00/0.41 sum(x) => foldl(plusc, 0, x) 0.00/0.41 0.00/0.41 This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). 0.00/0.41 0.00/0.41 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.41 0.00/0.41 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.41 0.00/0.41 foldl(F, X, nil) >? X 0.00/0.41 foldl(F, X, cons(Y, Z)) >? foldl(F, F X Y, Z) 0.00/0.41 plusc >? /\x./\y.plus(x, y) 0.00/0.41 sum(X) >? foldl(plusc, 0, X) 0.00/0.41 0.00/0.41 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.41 0.00/0.41 Argument functions: 0.00/0.41 0.00/0.41 [[0]] = _|_ 0.00/0.41 [[foldl(x_1, x_2, x_3)]] = foldl(x_3, x_1, x_2) 0.00/0.41 0.00/0.41 We choose Lex = {foldl} and Mul = {@_{o -> o -> o}, @_{o -> o}, cons, nil, plus, plusc, sum}, and the following precedence: nil > plusc = sum > foldl > @_{o -> o -> o} > @_{o -> o} > cons > plus 0.00/0.41 0.00/0.41 Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: 0.00/0.41 0.00/0.41 foldl(F, X, nil) > X 0.00/0.41 foldl(F, X, cons(Y, Z)) >= foldl(F, @_{o -> o}(@_{o -> o -> o}(F, X), Y), Z) 0.00/0.41 plusc >= /\x./\y.plus(x, y) 0.00/0.41 sum(X) >= foldl(plusc, _|_, X) 0.00/0.41 0.00/0.41 With these choices, we have: 0.00/0.41 0.00/0.41 1] foldl(F, X, nil) > X because [2], by definition 0.00/0.41 2] foldl*(F, X, nil) >= X because [3], by (Select) 0.00/0.41 3] X >= X by (Meta) 0.00/0.41 0.00/0.41 4] foldl(F, X, cons(Y, Z)) >= foldl(F, @_{o -> o}(@_{o -> o -> o}(F, X), Y), Z) because [5], by (Star) 0.00/0.41 5] foldl*(F, X, cons(Y, Z)) >= foldl(F, @_{o -> o}(@_{o -> o -> o}(F, X), Y), Z) because [6], [9], [11] and [19], by (Stat) 0.00/0.41 6] cons(Y, Z) > Z because [7], by definition 0.00/0.41 7] cons*(Y, Z) >= Z because [8], by (Select) 0.00/0.41 8] Z >= Z by (Meta) 0.00/0.41 9] foldl*(F, X, cons(Y, Z)) >= F because [10], by (Select) 0.00/0.41 10] F >= F by (Meta) 0.00/0.41 11] foldl*(F, X, cons(Y, Z)) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) because foldl > @_{o -> o}, [12] and [15], by (Copy) 0.00/0.41 12] foldl*(F, X, cons(Y, Z)) >= @_{o -> o -> o}(F, X) because foldl > @_{o -> o -> o}, [9] and [13], by (Copy) 0.00/0.41 13] foldl*(F, X, cons(Y, Z)) >= X because [14], by (Select) 0.00/0.41 14] X >= X by (Meta) 0.00/0.41 15] foldl*(F, X, cons(Y, Z)) >= Y because [16], by (Select) 0.00/0.41 16] cons(Y, Z) >= Y because [17], by (Star) 0.00/0.41 17] cons*(Y, Z) >= Y because [18], by (Select) 0.00/0.41 18] Y >= Y by (Meta) 0.00/0.41 19] foldl*(F, X, cons(Y, Z)) >= Z because [20], by (Select) 0.00/0.41 20] cons(Y, Z) >= Z because [7], by (Star) 0.00/0.41 0.00/0.41 21] plusc >= /\x./\y.plus(x, y) because [22], by (Star) 0.00/0.41 22] plusc* >= /\y./\z.plus(y, z) because [23], by (F-Abs) 0.00/0.41 23] plusc*(x) >= /\z.plus(x, z) because [24], by (F-Abs) 0.00/0.41 24] plusc*(x, y) >= plus(x, y) because plusc > plus, [25] and [27], by (Copy) 0.00/0.41 25] plusc*(x, y) >= x because [26], by (Select) 0.00/0.41 26] x >= x by (Var) 0.00/0.41 27] plusc*(x, y) >= y because [28], by (Select) 0.00/0.41 28] y >= y by (Var) 0.00/0.41 0.00/0.41 29] sum(X) >= foldl(plusc, _|_, X) because [30], by (Star) 0.00/0.41 30] sum*(X) >= foldl(plusc, _|_, X) because sum > foldl, [31], [32] and [33], by (Copy) 0.00/0.41 31] sum*(X) >= plusc because sum = plusc and sum in Mul, by (Stat) 0.00/0.41 32] sum*(X) >= _|_ by (Bot) 0.00/0.41 33] sum*(X) >= X because [34], by (Select) 0.00/0.41 34] X >= X by (Meta) 0.00/0.41 0.00/0.41 We can thus remove the following rules: 0.00/0.41 0.00/0.41 foldl(F, X, nil) => X 0.00/0.41 0.00/0.41 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.41 0.00/0.41 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.41 0.00/0.41 foldl(F, X, cons(Y, Z)) >? foldl(F, F X Y, Z) 0.00/0.41 plusc >? /\x./\y.plus(x, y) 0.00/0.41 sum(X) >? foldl(plusc, 0, X) 0.00/0.41 0.00/0.41 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.41 0.00/0.41 Argument functions: 0.00/0.41 0.00/0.41 [[0]] = _|_ 0.00/0.41 [[foldl(x_1, x_2, x_3)]] = foldl(x_3, x_2, x_1) 0.00/0.41 0.00/0.41 We choose Lex = {foldl} and Mul = {@_{o -> o -> o}, @_{o -> o}, cons, plus, plusc, sum}, and the following precedence: cons > sum > foldl > @_{o -> o -> o} > @_{o -> o} > plusc > plus 0.00/0.41 0.00/0.41 Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: 0.00/0.41 0.00/0.41 foldl(F, X, cons(Y, Z)) > foldl(F, @_{o -> o}(@_{o -> o -> o}(F, X), Y), Z) 0.00/0.41 plusc >= /\x./\y.plus(x, y) 0.00/0.41 sum(X) >= foldl(plusc, _|_, X) 0.00/0.41 0.00/0.41 With these choices, we have: 0.00/0.41 0.00/0.41 1] foldl(F, X, cons(Y, Z)) > foldl(F, @_{o -> o}(@_{o -> o -> o}(F, X), Y), Z) because [2], by definition 0.00/0.41 2] foldl*(F, X, cons(Y, Z)) >= foldl(F, @_{o -> o}(@_{o -> o -> o}(F, X), Y), Z) because [3], [6], [8] and [16], by (Stat) 0.00/0.41 3] cons(Y, Z) > Z because [4], by definition 0.00/0.41 4] cons*(Y, Z) >= Z because [5], by (Select) 0.00/0.41 5] Z >= Z by (Meta) 0.00/0.41 6] foldl*(F, X, cons(Y, Z)) >= F because [7], by (Select) 0.00/0.41 7] F >= F by (Meta) 0.00/0.41 8] foldl*(F, X, cons(Y, Z)) >= @_{o -> o}(@_{o -> o -> o}(F, X), Y) because foldl > @_{o -> o}, [9] and [12], by (Copy) 0.00/0.41 9] foldl*(F, X, cons(Y, Z)) >= @_{o -> o -> o}(F, X) because foldl > @_{o -> o -> o}, [6] and [10], by (Copy) 0.00/0.41 10] foldl*(F, X, cons(Y, Z)) >= X because [11], by (Select) 0.00/0.41 11] X >= X by (Meta) 0.00/0.41 12] foldl*(F, X, cons(Y, Z)) >= Y because [13], by (Select) 0.00/0.41 13] cons(Y, Z) >= Y because [14], by (Star) 0.00/0.41 14] cons*(Y, Z) >= Y because [15], by (Select) 0.00/0.41 15] Y >= Y by (Meta) 0.00/0.41 16] foldl*(F, X, cons(Y, Z)) >= Z because [17], by (Select) 0.00/0.41 17] cons(Y, Z) >= Z because [4], by (Star) 0.00/0.41 0.00/0.41 18] plusc >= /\x./\y.plus(x, y) because [19], by (Star) 0.00/0.41 19] plusc* >= /\y./\z.plus(y, z) because [20], by (F-Abs) 0.00/0.41 20] plusc*(x) >= /\z.plus(x, z) because [21], by (F-Abs) 0.00/0.41 21] plusc*(x, y) >= plus(x, y) because plusc > plus, [22] and [24], by (Copy) 0.00/0.41 22] plusc*(x, y) >= x because [23], by (Select) 0.00/0.41 23] x >= x by (Var) 0.00/0.41 24] plusc*(x, y) >= y because [25], by (Select) 0.00/0.41 25] y >= y by (Var) 0.00/0.41 0.00/0.41 26] sum(X) >= foldl(plusc, _|_, X) because [27], by (Star) 0.00/0.41 27] sum*(X) >= foldl(plusc, _|_, X) because sum > foldl, [28], [29] and [30], by (Copy) 0.00/0.41 28] sum*(X) >= plusc because sum > plusc, by (Copy) 0.00/0.41 29] sum*(X) >= _|_ by (Bot) 0.00/0.41 30] sum*(X) >= X because [31], by (Select) 0.00/0.41 31] X >= X by (Meta) 0.00/0.41 0.00/0.41 We can thus remove the following rules: 0.00/0.41 0.00/0.41 foldl(F, X, cons(Y, Z)) => foldl(F, F X Y, Z) 0.00/0.41 0.00/0.41 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.41 0.00/0.41 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.41 0.00/0.41 plusc >? /\x./\y.plus(x, y) 0.00/0.41 sum(X) >? foldl(plusc, 0, X) 0.00/0.41 0.00/0.41 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.41 0.00/0.41 The following interpretation satisfies the requirements: 0.00/0.41 0.00/0.41 0 = 0 0.00/0.41 foldl = \G0y1y2.y1 + y2 + G0(0,0) 0.00/0.41 plus = \y0y1.y0 + y1 0.00/0.41 plusc = \y0y1.1 + y0 + y1 0.00/0.41 sum = \y0.3 + 3y0 0.00/0.41 0.00/0.41 Using this interpretation, the requirements translate to: 0.00/0.41 0.00/0.41 [[plusc]] = \y0y1.1 + y0 + y1 > \y0y1.y0 + y1 = [[/\x./\y.plus(x, y)]] 0.00/0.41 [[sum(_x0)]] = 3 + 3x0 > 1 + x0 = [[foldl(plusc, 0, _x0)]] 0.00/0.41 0.00/0.41 We can thus remove the following rules: 0.00/0.41 0.00/0.41 plusc => /\x./\y.plus(x, y) 0.00/0.41 sum(X) => foldl(plusc, 0, X) 0.00/0.41 0.00/0.41 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. 0.00/0.41 0.00/0.41 0.00/0.41 +++ Citations +++ 0.00/0.41 0.00/0.41 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.41 EOF