0.00/0.22 YES 0.00/0.24 We consider the system theBenchmark. 0.00/0.24 0.00/0.24 Alphabet: 0.00/0.24 0.00/0.24 0 : [] --> nat 0.00/0.24 rec : [] --> nat -> nat -> (nat -> nat -> nat) -> nat 0.00/0.24 s : [] --> nat -> nat 0.00/0.24 xplus : [] --> nat -> nat -> nat 0.00/0.24 xtimes : [] --> nat -> nat -> nat 0.00/0.24 0.00/0.24 Rules: 0.00/0.24 0.00/0.24 xplus x 0 => x 0.00/0.24 xplus x (s y) => s (xplus x y) 0.00/0.24 rec 0 x (/\y./\z.f y z) => x 0.00/0.24 rec (s x) y (/\z./\u.f z u) => f x (rec x y (/\v./\w.f v w)) 0.00/0.24 xtimes x y => rec y 0 (/\z./\u.xplus x u) 0.00/0.24 0.00/0.24 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.24 0.00/0.24 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.24 0.00/0.24 Alphabet: 0.00/0.24 0.00/0.24 0 : [] --> nat 0.00/0.24 rec : [nat * nat * nat -> nat -> nat] --> nat 0.00/0.24 s : [nat] --> nat 0.00/0.24 xplus : [nat * nat] --> nat 0.00/0.24 xtimes : [nat * nat] --> nat 0.00/0.24 ~AP1 : [nat -> nat -> nat * nat] --> nat -> nat 0.00/0.24 0.00/0.24 Rules: 0.00/0.24 0.00/0.24 xplus(X, 0) => X 0.00/0.24 xplus(X, s(Y)) => s(xplus(X, Y)) 0.00/0.24 rec(0, X, /\x./\y.~AP1(F, x) y) => X 0.00/0.24 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.24 xtimes(X, Y) => rec(Y, 0, /\x./\y.xplus(X, y)) 0.00/0.24 rec(0, X, /\x./\y.xplus(x, y)) => X 0.00/0.24 rec(0, X, /\x./\y.xtimes(x, y)) => X 0.00/0.24 rec(s(X), Y, /\x./\y.xplus(x, y)) => xplus(X, rec(X, Y, /\z./\u.xplus(z, u))) 0.00/0.24 rec(s(X), Y, /\x./\y.xtimes(x, y)) => xtimes(X, rec(X, Y, /\z./\u.xtimes(z, u))) 0.00/0.24 ~AP1(F, X) => F X 0.00/0.24 0.00/0.24 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.24 0.00/0.24 Alphabet: 0.00/0.24 0.00/0.24 0 : [] --> nat 0.00/0.24 rec : [nat * nat * nat -> nat -> nat] --> nat 0.00/0.24 s : [nat] --> nat 0.00/0.24 xplus : [nat * nat] --> nat 0.00/0.24 xtimes : [nat * nat] --> nat 0.00/0.24 0.00/0.24 Rules: 0.00/0.24 0.00/0.24 xplus(X, 0) => X 0.00/0.24 xplus(X, s(Y)) => s(xplus(X, Y)) 0.00/0.24 rec(0, X, /\x./\y.Y(x, y)) => X 0.00/0.24 rec(s(X), Y, /\x./\y.Z(x, y)) => Z(X, rec(X, Y, /\z./\u.Z(z, u))) 0.00/0.24 xtimes(X, Y) => rec(Y, 0, /\x./\y.xplus(X, y)) 0.00/0.24 0.00/0.24 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.24 0.00/0.24 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.24 0.00/0.24 xplus(X, 0) >? X 0.00/0.24 xplus(X, s(Y)) >? s(xplus(X, Y)) 0.00/0.24 rec(0, X, /\x./\y.Y(x, y)) >? X 0.00/0.24 rec(s(X), Y, /\x./\y.Z(x, y)) >? Z(X, rec(X, Y, /\z./\u.Z(z, u))) 0.00/0.24 xtimes(X, Y) >? rec(Y, 0, /\x./\y.xplus(X, y)) 0.00/0.24 0.00/0.24 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.24 0.00/0.24 Argument functions: 0.00/0.24 0.00/0.24 [[0]] = _|_ 0.00/0.24 0.00/0.24 We choose Lex = {} and Mul = {rec, s, xplus, xtimes}, and the following precedence: xtimes > rec > xplus > s 0.00/0.24 0.00/0.24 Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: 0.00/0.24 0.00/0.24 xplus(X, _|_) >= X 0.00/0.24 xplus(X, s(Y)) > s(xplus(X, Y)) 0.00/0.24 rec(_|_, X, /\x./\y.Y(x, y)) > X 0.00/0.24 rec(s(X), Y, /\x./\y.Z(x, y)) >= Z(X, rec(X, Y, /\x./\y.Z(x, y))) 0.00/0.24 xtimes(X, Y) > rec(Y, _|_, /\x./\y.xplus(X, y)) 0.00/0.24 0.00/0.24 With these choices, we have: 0.00/0.24 0.00/0.24 1] xplus(X, _|_) >= X because [2], by (Star) 0.00/0.24 2] xplus*(X, _|_) >= X because [3], by (Select) 0.00/0.24 3] X >= X by (Meta) 0.00/0.24 0.00/0.24 4] xplus(X, s(Y)) > s(xplus(X, Y)) because [5], by definition 0.00/0.24 5] xplus*(X, s(Y)) >= s(xplus(X, Y)) because xplus > s and [6], by (Copy) 0.00/0.24 6] xplus*(X, s(Y)) >= xplus(X, Y) because xplus in Mul, [7] and [8], by (Stat) 0.00/0.24 7] X >= X by (Meta) 0.00/0.24 8] s(Y) > Y because [9], by definition 0.00/0.24 9] s*(Y) >= Y because [10], by (Select) 0.00/0.24 10] Y >= Y by (Meta) 0.00/0.24 0.00/0.24 11] rec(_|_, X, /\x./\y.Y(x, y)) > X because [12], by definition 0.00/0.24 12] rec*(_|_, X, /\x./\y.Y(x, y)) >= X because [13], by (Select) 0.00/0.24 13] X >= X by (Meta) 0.00/0.24 0.00/0.24 14] rec(s(X), Y, /\x./\y.Z(x, y)) >= Z(X, rec(X, Y, /\x./\y.Z(x, y))) because [15], by (Star) 0.00/0.24 15] rec*(s(X), Y, /\x./\y.Z(x, y)) >= Z(X, rec(X, Y, /\x./\y.Z(x, y))) because [16], by (Select) 0.00/0.24 16] 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 [17] and [21], by (Meta) 0.00/0.24 17] rec*(s(X), Y, /\x./\y.Z(x, y)) >= X because [18], by (Select) 0.00/0.24 18] s(X) >= X because [19], by (Star) 0.00/0.24 19] s*(X) >= X because [20], by (Select) 0.00/0.24 20] X >= X by (Meta) 0.00/0.24 21] rec*(s(X), Y, /\x./\y.Z(x, y)) >= rec(X, Y, /\x./\y.Z(x, y)) because rec in Mul, [22], [24] and [25], by (Stat) 0.00/0.24 22] s(X) > X because [23], by definition 0.00/0.24 23] s*(X) >= X because [20], by (Select) 0.00/0.24 24] Y >= Y by (Meta) 0.00/0.24 25] /\x./\z.Z(x, z) >= /\x./\z.Z(x, z) because [26], by (Abs) 0.00/0.24 26] /\z.Z(y, z) >= /\z.Z(y, z) because [27], by (Abs) 0.00/0.24 27] Z(y, x) >= Z(y, x) because [28] and [29], by (Meta) 0.00/0.24 28] y >= y by (Var) 0.00/0.24 29] x >= x by (Var) 0.00/0.24 0.00/0.24 30] xtimes(X, Y) > rec(Y, _|_, /\x./\y.xplus(X, y)) because [31], by definition 0.00/0.24 31] xtimes*(X, Y) >= rec(Y, _|_, /\x./\y.xplus(X, y)) because xtimes > rec, [32], [34] and [35], by (Copy) 0.00/0.24 32] xtimes*(X, Y) >= Y because [33], by (Select) 0.00/0.24 33] Y >= Y by (Meta) 0.00/0.24 34] xtimes*(X, Y) >= _|_ by (Bot) 0.00/0.24 35] xtimes*(X, Y) >= /\y./\z.xplus(X, z) because [36], by (F-Abs) 0.00/0.24 36] xtimes*(X, Y, x) >= /\z.xplus(X, z) because [37], by (F-Abs) 0.00/0.24 37] xtimes*(X, Y, x, y) >= xplus(X, y) because xtimes > xplus, [38] and [40], by (Copy) 0.00/0.24 38] xtimes*(X, Y, x, y) >= X because [39], by (Select) 0.00/0.24 39] X >= X by (Meta) 0.00/0.24 40] xtimes*(X, Y, x, y) >= y because [41], by (Select) 0.00/0.24 41] y >= y by (Var) 0.00/0.24 0.00/0.24 We can thus remove the following rules: 0.00/0.24 0.00/0.24 xplus(X, s(Y)) => s(xplus(X, Y)) 0.00/0.24 rec(0, X, /\x./\y.Y(x, y)) => X 0.00/0.24 xtimes(X, Y) => rec(Y, 0, /\x./\y.xplus(X, y)) 0.00/0.24 0.00/0.24 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.24 0.00/0.24 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.24 0.00/0.24 xplus(X, 0) >? X 0.00/0.24 rec(s(X), Y, /\x./\y.Z(x, y)) >? Z(X, rec(X, Y, /\z./\u.Z(z, u))) 0.00/0.24 0.00/0.24 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.24 0.00/0.24 We choose Lex = {} and Mul = {0, rec, s, xplus}, and the following precedence: 0 > rec > s > xplus 0.00/0.24 0.00/0.24 With these choices, we have: 0.00/0.24 0.00/0.24 1] xplus(X, 0) >= X because [2], by (Star) 0.00/0.24 2] xplus*(X, 0) >= X because [3], by (Select) 0.00/0.24 3] X >= X by (Meta) 0.00/0.24 0.00/0.24 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.24 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.24 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.24 7] rec*(s(X), Y, /\x./\y.Z(x, y)) >= X because [8], by (Select) 0.00/0.24 8] s(X) >= X because [9], by (Star) 0.00/0.24 9] s*(X) >= X because [10], by (Select) 0.00/0.24 10] X >= X by (Meta) 0.00/0.24 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.24 12] s(X) > X because [13], by definition 0.00/0.24 13] s*(X) >= X because [10], by (Select) 0.00/0.24 14] Y >= Y by (Meta) 0.00/0.24 15] /\x./\z.Z(x, z) >= /\x./\z.Z(x, z) because [16], by (Abs) 0.00/0.24 16] /\z.Z(y, z) >= /\z.Z(y, z) because [17], by (Abs) 0.00/0.24 17] Z(y, x) >= Z(y, x) because [18] and [19], by (Meta) 0.00/0.24 18] y >= y by (Var) 0.00/0.24 19] x >= x by (Var) 0.00/0.24 0.00/0.24 We can thus remove the following rules: 0.00/0.24 0.00/0.24 rec(s(X), Y, /\x./\y.Z(x, y)) => Z(X, rec(X, Y, /\z./\u.Z(z, u))) 0.00/0.24 0.00/0.24 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.24 0.00/0.24 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.24 0.00/0.24 xplus(X, 0) >? X 0.00/0.24 0.00/0.24 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.24 0.00/0.24 The following interpretation satisfies the requirements: 0.00/0.24 0.00/0.24 0 = 3 0.00/0.24 xplus = \y0y1.3 + y0 + y1 0.00/0.24 0.00/0.24 Using this interpretation, the requirements translate to: 0.00/0.24 0.00/0.24 [[xplus(_x0, 0)]] = 6 + x0 > x0 = [[_x0]] 0.00/0.24 0.00/0.24 We can thus remove the following rules: 0.00/0.24 0.00/0.24 xplus(X, 0) => X 0.00/0.24 0.00/0.24 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.24 0.00/0.24 0.00/0.24 +++ Citations +++ 0.00/0.24 0.00/0.24 [Kop11] C. Kop. Simplifying Algebraic Functional Systems. In Proceedings of CAI 2011, volume 6742 of LNCS. 201--215, Springer, 2011. 0.00/0.24 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.24 EOF