0.00/0.40 YES 0.00/0.42 We consider the system theBenchmark. 0.00/0.42 0.00/0.42 Alphabet: 0.00/0.42 0.00/0.42 casea : [u * a -> a * b -> a] --> a 0.00/0.42 caseb : [u * a -> b * b -> b] --> b 0.00/0.42 caseu : [u * a -> u * b -> u] --> u 0.00/0.42 inl : [a] --> u 0.00/0.42 inr : [b] --> u 0.00/0.42 0.00/0.42 Rules: 0.00/0.42 0.00/0.42 casea(inl(x), f, g) => f x 0.00/0.42 casea(inr(x), f, g) => g x 0.00/0.42 casea(x, /\y.f inl(y), /\z.f inr(z)) => f x 0.00/0.42 caseb(inl(x), f, g) => f x 0.00/0.42 caseb(inr(x), f, g) => g x 0.00/0.42 caseb(x, /\y.f inl(y), /\z.f inr(z)) => f x 0.00/0.42 caseu(inl(x), f, g) => f x 0.00/0.42 caseu(inr(x), f, g) => g x 0.00/0.42 caseu(x, /\y.f inl(y), /\z.f inr(z)) => f x 0.00/0.42 0.00/0.42 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.42 0.00/0.42 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.42 0.00/0.42 Alphabet: 0.00/0.42 0.00/0.42 casea : [u * a -> a * b -> a] --> a 0.00/0.42 caseb : [u * a -> b * b -> b] --> b 0.00/0.42 caseu : [u * a -> u * b -> u] --> u 0.00/0.42 inl : [a] --> u 0.00/0.42 inr : [b] --> u 0.00/0.42 ~AP1 : [u -> a * u] --> a 0.00/0.42 ~AP2 : [u -> b * u] --> b 0.00/0.42 ~AP3 : [u -> u * u] --> u 0.00/0.42 0.00/0.42 Rules: 0.00/0.42 0.00/0.42 casea(inl(X), F, G) => F X 0.00/0.42 casea(inr(X), F, G) => G X 0.00/0.42 casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) => ~AP1(F, X) 0.00/0.42 caseb(inl(X), F, G) => F X 0.00/0.42 caseb(inr(X), F, G) => G X 0.00/0.42 caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) => ~AP2(F, X) 0.00/0.42 caseu(inl(X), F, G) => F X 0.00/0.42 caseu(inr(X), F, G) => G X 0.00/0.42 caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) => ~AP3(F, X) 0.00/0.42 ~AP1(F, X) => F X 0.00/0.42 ~AP2(F, X) => F X 0.00/0.42 ~AP3(F, X) => F X 0.00/0.42 0.00/0.42 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.42 0.00/0.42 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.42 0.00/0.42 casea(inl(X), F, G) >? F X 0.00/0.42 casea(inr(X), F, G) >? G X 0.00/0.42 casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) >? ~AP1(F, X) 0.00/0.42 caseb(inl(X), F, G) >? F X 0.00/0.42 caseb(inr(X), F, G) >? G X 0.00/0.42 caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) >? ~AP2(F, X) 0.00/0.42 caseu(inl(X), F, G) >? F X 0.00/0.42 caseu(inr(X), F, G) >? G X 0.00/0.42 caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) >? ~AP3(F, X) 0.00/0.42 ~AP1(F, X) >? F X 0.00/0.42 ~AP2(F, X) >? F X 0.00/0.42 ~AP3(F, X) >? F X 0.00/0.42 0.00/0.42 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.42 0.00/0.42 The following interpretation satisfies the requirements: 0.00/0.42 0.00/0.42 casea = \y0G1G2.3 + 3y0 + G1(y0) + G2(y0) + 2y0G2(y0) 0.00/0.42 caseb = \y0G1G2.3 + 3y0 + 3G1(y0) + 3G2(0) + 3G2(y0) + y0G2(y0) 0.00/0.42 caseu = \y0G1G2.3 + 3y0 + 3y0G1(y0) + 3G1(0) + 3G1(y0) + 3G2(0) + 3G2(y0) 0.00/0.42 inl = \y0.3 + 3y0 0.00/0.42 inr = \y0.3 + 3y0 0.00/0.42 ~AP1 = \G0y1.2 + y1 + 2G0(y1) 0.00/0.42 ~AP2 = \G0y1.2y1 + 3G0(0) + 3G0(y1) + y1G0(y1) 0.00/0.42 ~AP3 = \G0y1.2y1 + 2y1G0(y1) + 3G0(0) + 3G0(y1) 0.00/0.42 0.00/0.42 Using this interpretation, the requirements translate to: 0.00/0.42 0.00/0.42 [[casea(inl(_x0), _F1, _F2)]] = 12 + 9x0 + F1(3 + 3x0) + 6x0F2(3 + 3x0) + 7F2(3 + 3x0) > x0 + F1(x0) = [[_F1 _x0]] 0.00/0.42 [[casea(inr(_x0), _F1, _F2)]] = 12 + 9x0 + F1(3 + 3x0) + 6x0F2(3 + 3x0) + 7F2(3 + 3x0) > x0 + F2(x0) = [[_F2 _x0]] 0.00/0.42 [[casea(_x0, /\x.~AP1(_F1, inl(x)), /\y.~AP1(_F1, inr(y)))]] = 13 + 6x0x0 + 19x0 + 4x0F1(3 + 3x0) + 4F1(3 + 3x0) > 2 + x0 + 2F1(x0) = [[~AP1(_F1, _x0)]] 0.00/0.42 [[caseb(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 3x0F2(3 + 3x0) + 3F1(3 + 3x0) + 3F2(0) + 6F2(3 + 3x0) > x0 + F1(x0) = [[_F1 _x0]] 0.00/0.42 [[caseb(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 3x0F2(3 + 3x0) + 3F1(3 + 3x0) + 3F2(0) + 6F2(3 + 3x0) > x0 + F2(x0) = [[_F2 _x0]] 0.00/0.42 [[caseb(_x0, /\x.~AP2(_F1, inl(x)), /\y.~AP2(_F1, inr(y)))]] = 57 + 6x0x0 + 45x0 + 3x0x0F1(3 + 3x0) + 3x0F1(0) + 18F1(3) + 24x0F1(3 + 3x0) + 27F1(0) + 36F1(3 + 3x0) > 2x0 + 3F1(0) + 3F1(x0) + x0F1(x0) = [[~AP2(_F1, _x0)]] 0.00/0.42 [[caseu(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 3F1(0) + 3F2(0) + 3F2(3 + 3x0) + 9x0F1(3 + 3x0) + 12F1(3 + 3x0) > x0 + F1(x0) = [[_F1 _x0]] 0.00/0.42 [[caseu(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 3F1(0) + 3F2(0) + 3F2(3 + 3x0) + 9x0F1(3 + 3x0) + 12F1(3 + 3x0) > x0 + F2(x0) = [[_F2 _x0]] 0.00/0.42 [[caseu(_x0, /\x.~AP3(_F1, inl(x)), /\y.~AP3(_F1, inr(y)))]] = 75 + 18x0x0 + 57x0 + 9x0F1(0) + 18x0x0F1(3 + 3x0) + 36F1(0) + 54F1(3) + 54F1(3 + 3x0) + 63x0F1(3 + 3x0) > 2x0 + 2x0F1(x0) + 3F1(0) + 3F1(x0) = [[~AP3(_F1, _x0)]] 0.00/0.42 [[~AP1(_F0, _x1)]] = 2 + x1 + 2F0(x1) > x1 + F0(x1) = [[_F0 _x1]] 0.00/0.42 [[~AP2(_F0, _x1)]] = 2x1 + 3F0(0) + 3F0(x1) + x1F0(x1) >= x1 + F0(x1) = [[_F0 _x1]] 0.00/0.42 [[~AP3(_F0, _x1)]] = 2x1 + 2x1F0(x1) + 3F0(0) + 3F0(x1) >= x1 + F0(x1) = [[_F0 _x1]] 0.00/0.42 0.00/0.42 We can thus remove the following rules: 0.00/0.42 0.00/0.42 casea(inl(X), F, G) => F X 0.00/0.42 casea(inr(X), F, G) => G X 0.00/0.42 casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) => ~AP1(F, X) 0.00/0.42 caseb(inl(X), F, G) => F X 0.00/0.42 caseb(inr(X), F, G) => G X 0.00/0.42 caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) => ~AP2(F, X) 0.00/0.42 caseu(inl(X), F, G) => F X 0.00/0.42 caseu(inr(X), F, G) => G X 0.00/0.42 caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) => ~AP3(F, X) 0.00/0.42 ~AP1(F, X) => F X 0.00/0.42 0.00/0.42 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.42 0.00/0.42 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.42 0.00/0.42 ~AP2(F, X) >? F X 0.00/0.42 ~AP3(F, X) >? F X 0.00/0.42 0.00/0.42 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.42 0.00/0.42 The following interpretation satisfies the requirements: 0.00/0.42 0.00/0.42 ~AP2 = \G0y1.3 + y1 + G0(y1) 0.00/0.42 ~AP3 = \G0y1.3 + y1 + G0(y1) 0.00/0.42 0.00/0.42 Using this interpretation, the requirements translate to: 0.00/0.42 0.00/0.42 [[~AP2(_F0, _x1)]] = 3 + x1 + F0(x1) > x1 + F0(x1) = [[_F0 _x1]] 0.00/0.42 [[~AP3(_F0, _x1)]] = 3 + x1 + F0(x1) > x1 + F0(x1) = [[_F0 _x1]] 0.00/0.42 0.00/0.42 We can thus remove the following rules: 0.00/0.42 0.00/0.42 ~AP2(F, X) => F X 0.00/0.42 ~AP3(F, X) => F X 0.00/0.42 0.00/0.42 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.42 0.00/0.42 0.00/0.42 +++ Citations +++ 0.00/0.42 0.00/0.42 [Kop11] C. Kop. Simplifying Algebraic Functional Systems. In Proceedings of CAI 2011, volume 6742 of LNCS. 201--215, Springer, 2011. 0.00/0.42 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.42 EOF