0.00/0.17 YES 0.00/0.18 We consider the system theBenchmark. 0.00/0.18 0.00/0.18 Alphabet: 0.00/0.18 0.00/0.18 rec : [] --> N -> a -> (N -> a -> a) -> a 0.00/0.18 s : [] --> N -> N 0.00/0.18 z : [] --> N 0.00/0.18 0.00/0.18 Rules: 0.00/0.18 0.00/0.18 rec z x (/\y.f y) => x 0.00/0.18 rec (s x) y (/\u.f u) => f x (rec x y (/\v.f v)) 0.00/0.18 0.00/0.18 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.18 0.00/0.18 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.18 0.00/0.18 Alphabet: 0.00/0.18 0.00/0.18 rec : [N * a * N -> a -> a] --> a 0.00/0.18 s : [N] --> N 0.00/0.18 z : [] --> N 0.00/0.18 ~AP1 : [N -> a -> a * N] --> a -> a 0.00/0.18 0.00/0.18 Rules: 0.00/0.18 0.00/0.18 rec(z, X, /\x.~AP1(F, x)) => X 0.00/0.18 rec(s(X), Y, /\x.~AP1(F, x)) => ~AP1(F, X) rec(X, Y, /\y.~AP1(F, y)) 0.00/0.18 ~AP1(F, X) => F X 0.00/0.18 0.00/0.18 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. This gives: 0.00/0.18 0.00/0.18 Alphabet: 0.00/0.18 0.00/0.18 rec : [N * a * N -> a -> a] --> a 0.00/0.18 s : [N] --> N 0.00/0.18 z : [] --> N 0.00/0.18 0.00/0.18 Rules: 0.00/0.18 0.00/0.18 rec(z, X, /\x.F(x)) => X 0.00/0.18 rec(s(X), Y, /\x.F(x)) => F(X) rec(X, Y, /\y.F(y)) 0.00/0.18 0.00/0.18 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.18 0.00/0.18 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.18 0.00/0.18 rec(z, X, /\x.F(x)) >? X 0.00/0.18 rec(s(X), Y, /\x.F(x)) >? F(X) rec(X, Y, /\y.F(y)) 0.00/0.18 0.00/0.18 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.18 0.00/0.18 We choose Lex = {} and Mul = {@_{o -> o}, rec, s, z}, and the following precedence: rec > @_{o -> o} > s > z 0.00/0.18 0.00/0.18 With these choices, we have: 0.00/0.18 0.00/0.18 1] rec(z, X, /\x.F(x)) > X because [2], by definition 0.00/0.18 2] rec*(z, X, /\x.F(x)) >= X because [3], by (Select) 0.00/0.18 3] X >= X by (Meta) 0.00/0.18 0.00/0.18 4] rec(s(X), Y, /\x.F(x)) >= @_{o -> o}(F(X), rec(X, Y, /\x.F(x))) because [5], by (Star) 0.00/0.18 5] rec*(s(X), Y, /\x.F(x)) >= @_{o -> o}(F(X), rec(X, Y, /\x.F(x))) because rec > @_{o -> o}, [6] and [12], by (Copy) 0.00/0.18 6] rec*(s(X), Y, /\x.F(x)) >= F(X) because [7], by (Select) 0.00/0.18 7] F(rec*(s(X), Y, /\x.F(x))) >= F(X) because [8], by (Meta) 0.00/0.18 8] rec*(s(X), Y, /\x.F(x)) >= X because [9], by (Select) 0.00/0.18 9] s(X) >= X because [10], by (Star) 0.00/0.18 10] s*(X) >= X because [11], by (Select) 0.00/0.18 11] X >= X by (Meta) 0.00/0.18 12] rec*(s(X), Y, /\x.F(x)) >= rec(X, Y, /\x.F(x)) because rec in Mul, [13], [15] and [16], by (Stat) 0.00/0.18 13] s(X) > X because [14], by definition 0.00/0.18 14] s*(X) >= X because [11], by (Select) 0.00/0.18 15] Y >= Y by (Meta) 0.00/0.18 16] /\y.F(y) >= /\y.F(y) because [17], by (Abs) 0.00/0.18 17] F(x) >= F(x) because [18], by (Meta) 0.00/0.18 18] x >= x by (Var) 0.00/0.18 0.00/0.18 We can thus remove the following rules: 0.00/0.18 0.00/0.18 rec(z, X, /\x.F(x)) => X 0.00/0.18 0.00/0.18 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.18 0.00/0.18 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.18 0.00/0.18 rec(s(X), Y, /\x.F(x)) >? F(X) rec(X, Y, /\y.F(y)) 0.00/0.18 0.00/0.18 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.18 0.00/0.18 We choose Lex = {rec} and Mul = {@_{o -> o}, s}, and the following precedence: rec > @_{o -> o} > s 0.00/0.18 0.00/0.18 With these choices, we have: 0.00/0.18 0.00/0.18 1] rec(s(X), Y, /\x.F(x)) > @_{o -> o}(F(X), rec(X, Y, /\x.F(x))) because [2], by definition 0.00/0.18 2] rec*(s(X), Y, /\x.F(x)) >= @_{o -> o}(F(X), rec(X, Y, /\x.F(x))) because rec > @_{o -> o}, [3] and [9], by (Copy) 0.00/0.18 3] rec*(s(X), Y, /\x.F(x)) >= F(X) because [4], by (Select) 0.00/0.18 4] F(rec*(s(X), Y, /\x.F(x))) >= F(X) because [5], by (Meta) 0.00/0.18 5] rec*(s(X), Y, /\x.F(x)) >= X because [6], by (Select) 0.00/0.18 6] s(X) >= X because [7], by (Star) 0.00/0.18 7] s*(X) >= X because [8], by (Select) 0.00/0.18 8] X >= X by (Meta) 0.00/0.18 9] rec*(s(X), Y, /\x.F(x)) >= rec(X, Y, /\x.F(x)) because [10], [5], [12] and [14], by (Stat) 0.00/0.18 10] s(X) > X because [11], by definition 0.00/0.18 11] s*(X) >= X because [8], by (Select) 0.00/0.18 12] rec*(s(X), Y, /\x.F(x)) >= Y because [13], by (Select) 0.00/0.18 13] Y >= Y by (Meta) 0.00/0.18 14] rec*(s(X), Y, /\x.F(x)) >= /\x.F(x) because [15], by (F-Abs) 0.00/0.18 15] rec*(s(X), Y, /\x.F(x), y) >= F(y) because [16], by (Select) 0.00/0.18 16] F(rec*(s(X), Y, /\x.F(x), y)) >= F(y) because [17], by (Meta) 0.00/0.18 17] rec*(s(X), Y, /\x.F(x), y) >= y because [18], by (Select) 0.00/0.18 18] y >= y by (Var) 0.00/0.18 0.00/0.18 We can thus remove the following rules: 0.00/0.18 0.00/0.18 rec(s(X), Y, /\x.F(x)) => F(X) rec(X, Y, /\y.F(y)) 0.00/0.18 0.00/0.18 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.18 0.00/0.18 0.00/0.18 +++ Citations +++ 0.00/0.18 0.00/0.18 [Kop11] C. Kop. Simplifying Algebraic Functional Systems. In Proceedings of CAI 2011, volume 6742 of LNCS. 201--215, Springer, 2011. 0.00/0.18 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.18 EOF