0.00/0.48 YES 0.00/0.51 We consider the system theBenchmark. 0.00/0.51 0.00/0.51 Alphabet: 0.00/0.51 0.00/0.51 0 : [] --> nat 0.00/0.51 mult : [] --> nat -> nat -> nat 0.00/0.51 plus : [] --> nat -> nat -> nat 0.00/0.51 plus3 : [] --> nat -> nat -> nat -> nat 0.00/0.51 rec : [] --> nat -> nat -> (nat -> nat -> nat) -> nat 0.00/0.51 s : [] --> nat -> nat 0.00/0.51 succ2 : [] --> nat -> nat -> nat 0.00/0.51 0.00/0.51 Rules: 0.00/0.51 0.00/0.51 rec 0 x (/\y./\z.f y z) => x 0.00/0.51 rec (s x) y (/\z./\u.f z u) => f x (rec x y (/\v./\w.f v w)) 0.00/0.51 succ2 x y => s y 0.00/0.51 plus x y => rec x y (/\z./\u.succ2 z u) 0.00/0.51 plus3 x y z => plus x (plus y z) 0.00/0.51 mult x y => rec x 0 (/\z./\u.plus3 y z u) 0.00/0.51 0.00/0.51 Using the transformations described in [Kop11], this system can be brought in a form without leading free variables in the left-hand side, and where the left-hand side of a variable is always a functional term or application headed by a functional term. 0.00/0.51 0.00/0.51 We now transform the resulting AFS into an AFSM by replacing all free variables by meta-variables (with arity 0). This leads to the following AFSM: 0.00/0.51 0.00/0.51 Alphabet: 0.00/0.51 0.00/0.51 0 : [] --> nat 0.00/0.51 mult : [nat * nat] --> nat 0.00/0.51 plus : [nat * nat] --> nat 0.00/0.51 plus3 : [nat * nat * nat] --> nat 0.00/0.51 rec : [nat * nat * nat -> nat -> nat] --> nat 0.00/0.51 s : [nat] --> nat 0.00/0.51 succ2 : [nat * nat] --> nat 0.00/0.51 ~AP1 : [nat -> nat -> nat * nat] --> nat -> nat 0.00/0.51 0.00/0.51 Rules: 0.00/0.51 0.00/0.51 rec(0, X, /\x./\y.~AP1(F, x) y) => X 0.00/0.51 rec(s(X), Y, /\x./\y.~AP1(F, x) y) => ~AP1(F, X) rec(X, Y, /\z./\u.~AP1(F, z) u) 0.00/0.51 succ2(X, Y) => s(Y) 0.00/0.51 plus(X, Y) => rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.51 plus3(X, Y, Z) => plus(X, plus(Y, Z)) 0.00/0.51 mult(X, Y) => rec(X, 0, /\x./\y.plus3(Y, x, y)) 0.00/0.51 rec(0, X, /\x./\y.mult(x, y)) => X 0.00/0.51 rec(0, X, /\x./\y.plus(x, y)) => X 0.00/0.51 rec(0, X, /\x./\y.plus3(Y, x, y)) => X 0.00/0.51 rec(0, X, /\x./\y.succ2(x, y)) => X 0.00/0.51 rec(s(X), Y, /\x./\y.mult(x, y)) => mult(X, rec(X, Y, /\z./\u.mult(z, u))) 0.00/0.51 rec(s(X), Y, /\x./\y.plus(x, y)) => plus(X, rec(X, Y, /\z./\u.plus(z, u))) 0.00/0.51 rec(s(X), Y, /\x./\y.plus3(Z, x, y)) => plus3(Z, X, rec(X, Y, /\z./\u.plus3(Z, z, u))) 0.00/0.51 rec(s(X), Y, /\x./\y.succ2(x, y)) => succ2(X, rec(X, Y, /\z./\u.succ2(z, u))) 0.00/0.52 ~AP1(F, X) => F X 0.00/0.52 0.00/0.52 Symbol ~AP1 is an encoding for application that is only used in innocuous ways. We can simplify the program (without losing non-termination) by removing it. Additionally, we can remove some (now-)redundant rules. This gives: 0.00/0.52 0.00/0.52 Alphabet: 0.00/0.52 0.00/0.52 0 : [] --> nat 0.00/0.52 mult : [nat * nat] --> nat 0.00/0.52 plus : [nat * nat] --> nat 0.00/0.52 plus3 : [nat * nat * nat] --> nat 0.00/0.52 rec : [nat * nat * nat -> nat -> nat] --> nat 0.00/0.52 s : [nat] --> nat 0.00/0.52 succ2 : [nat * nat] --> nat 0.00/0.52 0.00/0.52 Rules: 0.00/0.52 0.00/0.52 rec(0, X, /\x./\y.Y(x, y)) => X 0.00/0.52 rec(s(X), Y, /\x./\y.Z(x, y)) => Z(X, rec(X, Y, /\z./\u.Z(z, u))) 0.00/0.52 succ2(X, Y) => s(Y) 0.00/0.52 plus(X, Y) => rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.52 plus3(X, Y, Z) => plus(X, plus(Y, Z)) 0.00/0.52 mult(X, Y) => rec(X, 0, /\x./\y.plus3(Y, x, y)) 0.00/0.52 0.00/0.52 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.52 0.00/0.52 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.52 0.00/0.52 rec(0, X, /\x./\y.Y(x, y)) >? X 0.00/0.52 rec(s(X), Y, /\x./\y.Z(x, y)) >? Z(X, rec(X, Y, /\z./\u.Z(z, u))) 0.00/0.52 succ2(X, Y) >? s(Y) 0.00/0.52 plus(X, Y) >? rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.52 plus3(X, Y, Z) >? plus(X, plus(Y, Z)) 0.00/0.52 mult(X, Y) >? rec(X, 0, /\x./\y.plus3(Y, x, y)) 0.00/0.52 0.00/0.52 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.52 0.00/0.52 Argument functions: 0.00/0.52 0.00/0.52 [[0]] = _|_ 0.00/0.52 0.00/0.52 We choose Lex = {} and Mul = {mult, plus, plus3, rec, s, succ2}, and the following precedence: mult > plus3 > plus > succ2 > s > rec 0.00/0.52 0.00/0.52 Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: 0.00/0.52 0.00/0.52 rec(_|_, X, /\x./\y.Y(x, y)) >= X 0.00/0.52 rec(s(X), Y, /\x./\y.Z(x, y)) > Z(X, rec(X, Y, /\x./\y.Z(x, y))) 0.00/0.52 succ2(X, Y) >= s(Y) 0.00/0.52 plus(X, Y) >= rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.52 plus3(X, Y, Z) >= plus(X, plus(Y, Z)) 0.00/0.52 mult(X, Y) >= rec(X, _|_, /\x./\y.plus3(Y, x, y)) 0.00/0.52 0.00/0.52 With these choices, we have: 0.00/0.52 0.00/0.52 1] rec(_|_, X, /\x./\y.Y(x, y)) >= X because [2], by (Star) 0.00/0.52 2] rec*(_|_, X, /\x./\y.Y(x, y)) >= X because [3], by (Select) 0.00/0.52 3] X >= X by (Meta) 0.00/0.52 0.00/0.52 4] rec(s(X), Y, /\x./\y.Z(x, y)) > Z(X, rec(X, Y, /\x./\y.Z(x, y))) because [5], by definition 0.00/0.52 5] rec*(s(X), Y, /\x./\y.Z(x, y)) >= Z(X, rec(X, Y, /\x./\y.Z(x, y))) because [6], by (Select) 0.00/0.52 6] Z(rec*(s(X), Y, /\x./\y.Z(x, y)), rec*(s(X), Y, /\z./\u.Z(z, u))) >= Z(X, rec(X, Y, /\x./\y.Z(x, y))) because [7] and [11], by (Meta) 0.00/0.52 7] rec*(s(X), Y, /\x./\y.Z(x, y)) >= X because [8], by (Select) 0.00/0.52 8] s(X) >= X because [9], by (Star) 0.00/0.52 9] s*(X) >= X because [10], by (Select) 0.00/0.52 10] X >= X by (Meta) 0.00/0.52 11] rec*(s(X), Y, /\x./\y.Z(x, y)) >= rec(X, Y, /\x./\y.Z(x, y)) because rec in Mul, [12], [14] and [15], by (Stat) 0.00/0.52 12] s(X) > X because [13], by definition 0.00/0.52 13] s*(X) >= X because [10], by (Select) 0.00/0.52 14] Y >= Y by (Meta) 0.00/0.52 15] /\x./\z.Z(x, z) >= /\x./\z.Z(x, z) because [16], by (Abs) 0.00/0.52 16] /\z.Z(y, z) >= /\z.Z(y, z) because [17], by (Abs) 0.00/0.52 17] Z(y, x) >= Z(y, x) because [18] and [19], by (Meta) 0.00/0.52 18] y >= y by (Var) 0.00/0.52 19] x >= x by (Var) 0.00/0.52 0.00/0.52 20] succ2(X, Y) >= s(Y) because [21], by (Star) 0.00/0.52 21] succ2*(X, Y) >= s(Y) because succ2 > s and [22], by (Copy) 0.00/0.52 22] succ2*(X, Y) >= Y because [23], by (Select) 0.00/0.52 23] Y >= Y by (Meta) 0.00/0.52 0.00/0.52 24] plus(X, Y) >= rec(X, Y, /\x./\y.succ2(x, y)) because [25], by (Star) 0.00/0.52 25] plus*(X, Y) >= rec(X, Y, /\x./\y.succ2(x, y)) because plus > rec, [26], [28] and [30], by (Copy) 0.00/0.52 26] plus*(X, Y) >= X because [27], by (Select) 0.00/0.52 27] X >= X by (Meta) 0.00/0.52 28] plus*(X, Y) >= Y because [29], by (Select) 0.00/0.52 29] Y >= Y by (Meta) 0.00/0.52 30] plus*(X, Y) >= /\y./\z.succ2(y, z) because [31], by (F-Abs) 0.00/0.52 31] plus*(X, Y, x) >= /\z.succ2(x, z) because [32], by (F-Abs) 0.00/0.52 32] plus*(X, Y, x, y) >= succ2(x, y) because plus > succ2, [33] and [35], by (Copy) 0.00/0.52 33] plus*(X, Y, x, y) >= x because [34], by (Select) 0.00/0.52 34] x >= x by (Var) 0.00/0.52 35] plus*(X, Y, x, y) >= y because [36], by (Select) 0.00/0.52 36] y >= y by (Var) 0.00/0.52 0.00/0.52 37] plus3(X, Y, Z) >= plus(X, plus(Y, Z)) because [38], by (Star) 0.00/0.52 38] plus3*(X, Y, Z) >= plus(X, plus(Y, Z)) because plus3 > plus, [39] and [41], by (Copy) 0.00/0.52 39] plus3*(X, Y, Z) >= X because [40], by (Select) 0.00/0.52 40] X >= X by (Meta) 0.00/0.52 41] plus3*(X, Y, Z) >= plus(Y, Z) because plus3 > plus, [42] and [44], by (Copy) 0.00/0.52 42] plus3*(X, Y, Z) >= Y because [43], by (Select) 0.00/0.52 43] Y >= Y by (Meta) 0.00/0.52 44] plus3*(X, Y, Z) >= Z because [45], by (Select) 0.00/0.52 45] Z >= Z by (Meta) 0.00/0.52 0.00/0.52 46] mult(X, Y) >= rec(X, _|_, /\x./\y.plus3(Y, x, y)) because [47], by (Star) 0.00/0.52 47] mult*(X, Y) >= rec(X, _|_, /\x./\y.plus3(Y, x, y)) because mult > rec, [48], [50] and [51], by (Copy) 0.00/0.52 48] mult*(X, Y) >= X because [49], by (Select) 0.00/0.52 49] X >= X by (Meta) 0.00/0.52 50] mult*(X, Y) >= _|_ by (Bot) 0.00/0.52 51] mult*(X, Y) >= /\y./\z.plus3(Y, y, z) because [52], by (F-Abs) 0.00/0.52 52] mult*(X, Y, x) >= /\z.plus3(Y, x, z) because [53], by (F-Abs) 0.00/0.52 53] mult*(X, Y, x, y) >= plus3(Y, x, y) because mult > plus3, [54], [56] and [58], by (Copy) 0.00/0.52 54] mult*(X, Y, x, y) >= Y because [55], by (Select) 0.00/0.52 55] Y >= Y by (Meta) 0.00/0.52 56] mult*(X, Y, x, y) >= x because [57], by (Select) 0.00/0.52 57] x >= x by (Var) 0.00/0.52 58] mult*(X, Y, x, y) >= y because [59], by (Select) 0.00/0.52 59] y >= y by (Var) 0.00/0.52 0.00/0.52 We can thus remove the following rules: 0.00/0.52 0.00/0.52 rec(s(X), Y, /\x./\y.Z(x, y)) => Z(X, rec(X, Y, /\z./\u.Z(z, u))) 0.00/0.52 0.00/0.52 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.52 0.00/0.52 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.52 0.00/0.52 rec(0, X, /\x./\y.Y(x, y)) >? X 0.00/0.52 succ2(X, Y) >? s(Y) 0.00/0.52 plus(X, Y) >? rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.52 plus3(X, Y, Z) >? plus(X, plus(Y, Z)) 0.00/0.52 mult(X, Y) >? rec(X, 0, /\x./\y.plus3(Y, x, y)) 0.00/0.52 0.00/0.52 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.52 0.00/0.52 The following interpretation satisfies the requirements: 0.00/0.52 0.00/0.52 0 = 0 0.00/0.52 mult = \y0y1.3 + 3y0 + 3y1 0.00/0.52 plus = \y0y1.y0 + y1 0.00/0.52 plus3 = \y0y1y2.y0 + 2y1 + 2y2 0.00/0.52 rec = \y0y1G2.y0 + y1 + 2G2(0,0) 0.00/0.52 s = \y0.y0 0.00/0.52 succ2 = \y0y1.y0 + y1 0.00/0.52 0.00/0.52 Using this interpretation, the requirements translate to: 0.00/0.52 0.00/0.52 [[rec(0, _x0, /\x./\y._x1(x, y))]] = x0 + 2F1(0,0) >= x0 = [[_x0]] 0.00/0.52 [[succ2(_x0, _x1)]] = x0 + x1 >= x1 = [[s(_x1)]] 0.00/0.52 [[plus(_x0, _x1)]] = x0 + x1 >= x0 + x1 = [[rec(_x0, _x1, /\x./\y.succ2(x, y))]] 0.00/0.52 [[plus3(_x0, _x1, _x2)]] = x0 + 2x1 + 2x2 >= x0 + x1 + x2 = [[plus(_x0, plus(_x1, _x2))]] 0.00/0.52 [[mult(_x0, _x1)]] = 3 + 3x0 + 3x1 > x0 + 2x1 = [[rec(_x0, 0, /\x./\y.plus3(_x1, x, y))]] 0.00/0.52 0.00/0.52 We can thus remove the following rules: 0.00/0.52 0.00/0.52 mult(X, Y) => rec(X, 0, /\x./\y.plus3(Y, x, y)) 0.00/0.52 0.00/0.52 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.52 0.00/0.52 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.52 0.00/0.52 rec(0, X, /\x./\y.Y(x, y)) >? X 0.00/0.52 succ2(X, Y) >? s(Y) 0.00/0.52 plus(X, Y) >? rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.52 plus3(X, Y, Z) >? plus(X, plus(Y, Z)) 0.00/0.52 0.00/0.52 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.52 0.00/0.52 The following interpretation satisfies the requirements: 0.00/0.52 0.00/0.52 0 = 3 0.00/0.52 plus = \y0y1.y0 + y1 0.00/0.52 plus3 = \y0y1y2.3 + 3y0 + 3y1 + 3y2 0.00/0.52 rec = \y0y1G2.y0 + y1 + 2G2(0,0) 0.00/0.52 s = \y0.y0 0.00/0.52 succ2 = \y0y1.y0 + y1 0.00/0.52 0.00/0.52 Using this interpretation, the requirements translate to: 0.00/0.52 0.00/0.52 [[rec(0, _x0, /\x./\y._x1(x, y))]] = 3 + x0 + 2F1(0,0) > x0 = [[_x0]] 0.00/0.52 [[succ2(_x0, _x1)]] = x0 + x1 >= x1 = [[s(_x1)]] 0.00/0.52 [[plus(_x0, _x1)]] = x0 + x1 >= x0 + x1 = [[rec(_x0, _x1, /\x./\y.succ2(x, y))]] 0.00/0.52 [[plus3(_x0, _x1, _x2)]] = 3 + 3x0 + 3x1 + 3x2 > x0 + x1 + x2 = [[plus(_x0, plus(_x1, _x2))]] 0.00/0.52 0.00/0.52 We can thus remove the following rules: 0.00/0.52 0.00/0.52 rec(0, X, /\x./\y.Y(x, y)) => X 0.00/0.52 plus3(X, Y, Z) => plus(X, plus(Y, Z)) 0.00/0.52 0.00/0.52 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.52 0.00/0.52 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.52 0.00/0.52 succ2(X, Y) >? s(Y) 0.00/0.52 plus(X, Y) >? rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.52 0.00/0.52 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.52 0.00/0.52 The following interpretation satisfies the requirements: 0.00/0.52 0.00/0.52 plus = \y0y1.3 + 3y0 + 3y1 0.00/0.52 rec = \y0y1G2.y0 + y1 + G2(0,0) 0.00/0.52 s = \y0.y0 0.00/0.52 succ2 = \y0y1.1 + y0 + y1 0.00/0.52 0.00/0.52 Using this interpretation, the requirements translate to: 0.00/0.52 0.00/0.52 [[succ2(_x0, _x1)]] = 1 + x0 + x1 > x1 = [[s(_x1)]] 0.00/0.52 [[plus(_x0, _x1)]] = 3 + 3x0 + 3x1 > 1 + x0 + x1 = [[rec(_x0, _x1, /\x./\y.succ2(x, y))]] 0.00/0.52 0.00/0.52 We can thus remove the following rules: 0.00/0.52 0.00/0.52 succ2(X, Y) => s(Y) 0.00/0.52 plus(X, Y) => rec(X, Y, /\x./\y.succ2(x, y)) 0.00/0.52 0.00/0.52 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.52 0.00/0.52 0.00/0.52 +++ Citations +++ 0.00/0.52 0.00/0.52 [Kop11] C. Kop. Simplifying Algebraic Functional Systems. In Proceedings of CAI 2011, volume 6742 of LNCS. 201--215, Springer, 2011. 0.00/0.52 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.52 EOF