0.00/0.05 YES 0.00/0.06 We consider the system theBenchmark. 0.00/0.06 0.00/0.06 Alphabet: 0.00/0.06 0.00/0.06 NIL : [] --> A 0.00/0.06 in : [] --> N -> (N -> A) -> A 0.00/0.06 new : [] --> (N -> A) -> A 0.00/0.06 out : [] --> N -> N -> A -> A 0.00/0.06 sum : [] --> A -> A -> A 0.00/0.06 tau : [] --> A -> A 0.00/0.06 0.00/0.06 Rules: 0.00/0.06 0.00/0.06 sum NIL x => x 0.00/0.06 new (/\x.y) => y 0.00/0.06 new (/\x.sum (f x) (g x)) => sum (new (/\y.f y)) (new (/\z.g z)) 0.00/0.06 new (/\x.out x y (f x)) => NIL 0.00/0.06 new (/\x.out y z (f x)) => out y z (new (/\u.f u)) 0.00/0.06 new (/\x.in y (/\z.f x z)) => in y (/\u.new (/\v.f v u)) 0.00/0.06 new (/\x.tau (f x)) => tau (new (/\y.f y)) 0.00/0.06 new (/\x.in x (/\y.f x y)) => NIL 0.00/0.06 0.00/0.06 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.06 0.00/0.06 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.06 0.00/0.06 Alphabet: 0.00/0.06 0.00/0.06 NIL : [] --> A 0.00/0.06 in : [N * N -> A] --> A 0.00/0.06 new : [N -> A] --> A 0.00/0.06 out : [N * N * A] --> A 0.00/0.06 sum : [A * A] --> A 0.00/0.06 tau : [A] --> A 0.00/0.06 ~AP1 : [N -> A * N] --> A 0.00/0.06 ~AP2 : [N -> N -> A * N] --> N -> A 0.00/0.06 0.00/0.06 Rules: 0.00/0.06 0.00/0.06 sum(NIL, X) => X 0.00/0.06 new(/\x.X) => X 0.00/0.06 new(/\x.sum(~AP1(F, x), ~AP1(G, x))) => sum(new(/\y.~AP1(F, y)), new(/\z.~AP1(G, z))) 0.00/0.06 new(/\x.out(x, X, ~AP1(F, x))) => NIL 0.00/0.06 new(/\x.out(X, Y, ~AP1(F, x))) => out(X, Y, new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(X, /\y.~AP1(~AP2(F, x), y))) => in(X, /\z.new(/\u.~AP1(~AP2(F, u), z))) 0.00/0.06 new(/\x.tau(~AP1(F, x))) => tau(new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(x, /\y.~AP1(~AP2(F, x), y))) => NIL 0.00/0.06 ~AP1(F, X) => F X 0.00/0.06 ~AP2(F, X) => F X 0.00/0.06 0.00/0.06 Symbol ~AP2 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.06 0.00/0.06 Alphabet: 0.00/0.06 0.00/0.06 NIL : [] --> A 0.00/0.06 in : [N * N -> A] --> A 0.00/0.06 new : [N -> A] --> A 0.00/0.06 out : [N * N * A] --> A 0.00/0.06 sum : [A * A] --> A 0.00/0.06 tau : [A] --> A 0.00/0.06 ~AP1 : [N -> A * N] --> A 0.00/0.06 0.00/0.06 Rules: 0.00/0.06 0.00/0.06 sum(NIL, X) => X 0.00/0.06 new(/\x.X) => X 0.00/0.06 new(/\x.sum(~AP1(F, x), ~AP1(G, x))) => sum(new(/\y.~AP1(F, y)), new(/\z.~AP1(G, z))) 0.00/0.06 new(/\x.out(x, X, ~AP1(F, x))) => NIL 0.00/0.06 new(/\x.out(X, Y, ~AP1(F, x))) => out(X, Y, new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(X, /\y.~AP1(F(x), y))) => in(X, /\z.new(/\u.~AP1(F(u), z))) 0.00/0.06 new(/\x.tau(~AP1(F, x))) => tau(new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(x, /\y.~AP1(F(x), y))) => NIL 0.00/0.06 ~AP1(F, X) => F X 0.00/0.06 0.00/0.06 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.06 0.00/0.06 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.06 0.00/0.06 sum(NIL, X) >? X 0.00/0.06 new(/\x.X) >? X 0.00/0.06 new(/\x.sum(~AP1(F, x), ~AP1(G, x))) >? sum(new(/\y.~AP1(F, y)), new(/\z.~AP1(G, z))) 0.00/0.06 new(/\x.out(x, X, ~AP1(F, x))) >? NIL 0.00/0.06 new(/\x.out(X, Y, ~AP1(F, x))) >? out(X, Y, new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(X, /\y.~AP1(F(x), y))) >? in(X, /\z.new(/\u.~AP1(F(u), z))) 0.00/0.06 new(/\x.tau(~AP1(F, x))) >? tau(new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(x, /\y.~AP1(F(x), y))) >? NIL 0.00/0.06 ~AP1(F, X) >? F X 0.00/0.06 0.00/0.06 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.06 0.00/0.06 The following interpretation satisfies the requirements: 0.00/0.06 0.00/0.06 NIL = 0 0.00/0.06 in = \y0G1.3 + y0 + 2G1(0) 0.00/0.06 new = \G0.2 + 3G0(0) 0.00/0.06 out = \y0y1y2.3 + y0 + y1 + 2y2 0.00/0.06 sum = \y0y1.3 + y0 + y1 0.00/0.06 tau = \y0.3 + y0 0.00/0.06 ~AP1 = \G0y1.3 + y1 + G0(y1) 0.00/0.06 0.00/0.06 Using this interpretation, the requirements translate to: 0.00/0.06 0.00/0.06 [[sum(NIL, _x0)]] = 3 + x0 > x0 = [[_x0]] 0.00/0.06 [[new(/\x._x0)]] = 2 + 3x0 > x0 = [[_x0]] 0.00/0.06 [[new(/\x.sum(~AP1(_F0, x), ~AP1(_F1, x)))]] = 29 + 3F0(0) + 3F1(0) > 25 + 3F0(0) + 3F1(0) = [[sum(new(/\x.~AP1(_F0, x)), new(/\y.~AP1(_F1, y)))]] 0.00/0.06 [[new(/\x.out(x, _x0, ~AP1(_F1, x)))]] = 29 + 3x0 + 6F1(0) > 0 = [[NIL]] 0.00/0.06 [[new(/\x.out(_x0, _x1, ~AP1(_F2, x)))]] = 29 + 3x0 + 3x1 + 6F2(0) > 25 + x0 + x1 + 6F2(0) = [[out(_x0, _x1, new(/\x.~AP1(_F2, x)))]] 0.00/0.06 [[new(/\x.in(_x0, /\y.~AP1(_F1(x), y)))]] = 29 + 3x0 + 6F1(0,0) > 25 + x0 + 6F1(0,0) = [[in(_x0, /\x.new(/\y.~AP1(_F1(y), x)))]] 0.00/0.06 [[new(/\x.tau(~AP1(_F0, x)))]] = 20 + 3F0(0) > 14 + 3F0(0) = [[tau(new(/\x.~AP1(_F0, x)))]] 0.00/0.06 [[new(/\x.in(x, /\y.~AP1(_F0(x), y)))]] = 29 + 6F0(0,0) > 0 = [[NIL]] 0.00/0.06 [[~AP1(_F0, _x1)]] = 3 + x1 + F0(x1) > x1 + F0(x1) = [[_F0 _x1]] 0.00/0.06 0.00/0.06 We can thus remove the following rules: 0.00/0.06 0.00/0.06 sum(NIL, X) => X 0.00/0.06 new(/\x.X) => X 0.00/0.06 new(/\x.sum(~AP1(F, x), ~AP1(G, x))) => sum(new(/\y.~AP1(F, y)), new(/\z.~AP1(G, z))) 0.00/0.06 new(/\x.out(x, X, ~AP1(F, x))) => NIL 0.00/0.06 new(/\x.out(X, Y, ~AP1(F, x))) => out(X, Y, new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(X, /\y.~AP1(F(x), y))) => in(X, /\z.new(/\u.~AP1(F(u), z))) 0.00/0.06 new(/\x.tau(~AP1(F, x))) => tau(new(/\y.~AP1(F, y))) 0.00/0.06 new(/\x.in(x, /\y.~AP1(F(x), y))) => NIL 0.00/0.06 ~AP1(F, X) => F X 0.00/0.06 0.00/0.06 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.06 0.00/0.06 0.00/0.06 +++ Citations +++ 0.00/0.06 0.00/0.06 [Kop11] C. Kop. Simplifying Algebraic Functional Systems. In Proceedings of CAI 2011, volume 6742 of LNCS. 201--215, Springer, 2011. 0.00/0.06 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.06 EOF