We consider the system sdu. Alphabet: casea : [u * a -> a * b -> a] --> a caseb : [u * a -> b * b -> b] --> b caseu : [u * a -> u * b -> u] --> u inl : [a] --> u inr : [b] --> u Rules: casea(inl(x), f, g) => f x casea(inr(x), f, g) => g x casea(x, /\y.f inl(y), /\z.f inr(z)) => f x caseb(inl(x), f, g) => f x caseb(inr(x), f, g) => g x caseb(x, /\y.f inl(y), /\z.f inr(z)) => f x caseu(inl(x), f, g) => f x caseu(inr(x), f, g) => g x caseu(x, /\y.f inl(y), /\z.f inr(z)) => f x 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. 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: Alphabet: casea : [u * a -> a * b -> a] --> a caseb : [u * a -> b * b -> b] --> b caseu : [u * a -> u * b -> u] --> u inl : [a] --> u inr : [b] --> u ~AP1 : [u -> a * u] --> a ~AP2 : [u -> b * u] --> b ~AP3 : [u -> u * u] --> u Rules: casea(inl(X), F, G) => F X casea(inr(X), F, G) => G X casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) => ~AP1(F, X) caseb(inl(X), F, G) => F X caseb(inr(X), F, G) => G X caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) => ~AP2(F, X) caseu(inl(X), F, G) => F X caseu(inr(X), F, G) => G X caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) => ~AP3(F, X) ~AP1(F, X) => F X ~AP2(F, X) => F X ~AP3(F, X) => F X We use the dependency pair framework as described in [Kop12, Ch. 6/7], with dynamic dependency pairs. After applying [Kop12, Thm. 7.22] to denote collapsing dependency pairs in an extended form, we thus obtain the following dependency pair problem (P_0, R_0, minimal, all): Dependency Pairs P_0: 0] casea#(inl(X), F, G) =#> F(X) 1] casea#(inr(X), F, G) =#> G(X) 2] casea#(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) =#> ~AP1#(F, X) 3] caseb#(inl(X), F, G) =#> F(X) 4] caseb#(inr(X), F, G) =#> G(X) 5] caseb#(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) =#> ~AP2#(F, X) 6] caseu#(inl(X), F, G) =#> F(X) 7] caseu#(inr(X), F, G) =#> G(X) 8] caseu#(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) =#> ~AP3#(F, X) 9] ~AP1#(F, X) =#> F(X) 10] ~AP2#(F, X) =#> F(X) 11] ~AP3#(F, X) =#> F(X) Rules R_0: casea(inl(X), F, G) => F X casea(inr(X), F, G) => G X casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) => ~AP1(F, X) caseb(inl(X), F, G) => F X caseb(inr(X), F, G) => G X caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) => ~AP2(F, X) caseu(inl(X), F, G) => F X caseu(inr(X), F, G) => G X caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) => ~AP3(F, X) ~AP1(F, X) => F X ~AP2(F, X) => F X ~AP3(F, X) => F X Thus, the original system is terminating if (P_0, R_0, minimal, all) is finite. We consider the dependency pair problem (P_0, R_0, minimal, all). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: casea#(inl(X), F, G) >? F(X) casea#(inr(X), F, G) >? G(X) casea#(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) >? ~AP1#(F, X) caseb#(inl(X), F, G) >? F(X) caseb#(inr(X), F, G) >? G(X) caseb#(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) >? ~AP2#(F, X) caseu#(inl(X), F, G) >? F(X) caseu#(inr(X), F, G) >? G(X) caseu#(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) >? ~AP3#(F, X) ~AP1#(F, X) >? F(X) ~AP2#(F, X) >? F(X) ~AP3#(F, X) >? F(X) casea(inl(X), F, G) >= F X casea(inr(X), F, G) >= G X casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) >= ~AP1(F, X) caseb(inl(X), F, G) >= F X caseb(inr(X), F, G) >= G X caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) >= ~AP2(F, X) caseu(inl(X), F, G) >= F X caseu(inr(X), F, G) >= G X caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) >= ~AP3(F, X) ~AP1(F, X) >= F X ~AP2(F, X) >= F X ~AP3(F, X) >= F X casea(X, F, G) >= casea#(X, F, G) caseb(X, F, G) >= caseb#(X, F, G) caseu(X, F, G) >= caseu#(X, F, G) ~AP1(F, X) >= ~AP1#(F, X) ~AP2(F, X) >= ~AP2#(F, X) ~AP3(F, X) >= ~AP3#(F, X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( ~AP1#(F, X) ) = #argfun-~AP1##(F X) pi( ~AP2#(F, X) ) = #argfun-~AP2##(F X) pi( ~AP3#(F, X) ) = #argfun-~AP3##(F X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-~AP1## = \y0.y0 #argfun-~AP2## = \y0.y0 #argfun-~AP3## = \y0.y0 casea = \y0G1G2.3 + 3y0 + G2(y0) + 2y0G2(y0) + 2G1(y0) + 2G2(0) + y0G1(y0) casea# = \y0G1G2.3 + 2y0 + G2(y0) + y0G1(y0) caseb = \y0G1G2.3 + 3y0 + 2y0G1(y0) + 2G1(y0) + 2G2(y0) caseb# = \y0G1G2.3 + y0 + G2(y0) + 2y0G1(y0) caseu = \y0G1G2.3 + 3y0 + 2G1(0) + 2G1(y0) + 2G2(y0) + y0G1(y0) caseu# = \y0G1G2.3 + 2y0 + 2G1(y0) + 2G2(y0) inl = \y0.3 + 3y0 inr = \y0.3 + 3y0 ~AP1 = \G0y1.y1 + 2G0(y1) ~AP1# = \G0y1.0 ~AP2 = \G0y1.2y1 + G0(y1) ~AP2# = \G0y1.0 ~AP3 = \G0y1.2y1 + G0(y1) ~AP3# = \G0y1.0 Using this interpretation, the requirements translate to: [[casea#(inl(_x0), _F1, _F2)]] = 9 + 6x0 + F2(3 + 3x0) + 3x0F1(3 + 3x0) + 3F1(3 + 3x0) > F1(x0) = [[_F1(_x0)]] [[casea#(inr(_x0), _F1, _F2)]] = 9 + 6x0 + F2(3 + 3x0) + 3x0F1(3 + 3x0) + 3F1(3 + 3x0) > F2(x0) = [[_F2(_x0)]] [[casea#(_x0, /\x.~AP1(_F1, inl(x)), /\y.~AP1(_F1, inr(y)))]] = 6 + 3x0x0 + 8x0 + 2x0F1(3 + 3x0) + 2F1(3 + 3x0) > max(x0, F1(x0)) = [[#argfun-~AP1##(_F1 _x0)]] [[caseb#(inl(_x0), _F1, _F2)]] = 6 + 3x0 + F2(3 + 3x0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) > F1(x0) = [[_F1(_x0)]] [[caseb#(inr(_x0), _F1, _F2)]] = 6 + 3x0 + F2(3 + 3x0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) > F2(x0) = [[_F2(_x0)]] [[caseb#(_x0, /\x.~AP2(_F1, inl(x)), /\y.~AP2(_F1, inr(y)))]] = 9 + 12x0x0 + 19x0 + F1(3 + 3x0) + 2x0F1(3 + 3x0) > max(x0, F1(x0)) = [[#argfun-~AP2##(_F1 _x0)]] [[caseu#(inl(_x0), _F1, _F2)]] = 9 + 6x0 + 2F1(3 + 3x0) + 2F2(3 + 3x0) > F1(x0) = [[_F1(_x0)]] [[caseu#(inr(_x0), _F1, _F2)]] = 9 + 6x0 + 2F1(3 + 3x0) + 2F2(3 + 3x0) > F2(x0) = [[_F2(_x0)]] [[caseu#(_x0, /\x.~AP3(_F1, inl(x)), /\y.~AP3(_F1, inr(y)))]] = 27 + 26x0 + 4F1(3 + 3x0) > max(x0, F1(x0)) = [[#argfun-~AP3##(_F1 _x0)]] [[#argfun-~AP1##(_F0 _x1)]] = max(x1, F0(x1)) >= F0(x1) = [[_F0(_x1)]] [[#argfun-~AP2##(_F0 _x1)]] = max(x1, F0(x1)) >= F0(x1) = [[_F0(_x1)]] [[#argfun-~AP3##(_F0 _x1)]] = max(x1, F0(x1)) >= F0(x1) = [[_F0(_x1)]] [[casea(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F2(0) + 3x0F1(3 + 3x0) + 5F1(3 + 3x0) + 6x0F2(3 + 3x0) + 7F2(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[casea(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F2(0) + 3x0F1(3 + 3x0) + 5F1(3 + 3x0) + 6x0F2(3 + 3x0) + 7F2(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[casea(_x0, /\x.~AP1(_F1, inl(x)), /\y.~AP1(_F1, inr(y)))]] = 18 + 9x0x0 + 21x0 + 4F1(3) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= x0 + 2F1(x0) = [[~AP1(_F1, _x0)]] [[caseb(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 8F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseb(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 8F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseb(_x0, /\x.~AP2(_F1, inl(x)), /\y.~AP2(_F1, inr(y)))]] = 27 + 12x0x0 + 39x0 + 2x0F1(3 + 3x0) + 4F1(3 + 3x0) >= 2x0 + F1(x0) = [[~AP2(_F1, _x0)]] [[caseu(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(3 + 3x0) + 3x0F1(3 + 3x0) + 5F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseu(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(3 + 3x0) + 3x0F1(3 + 3x0) + 5F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseu(_x0, /\x.~AP3(_F1, inl(x)), /\y.~AP3(_F1, inr(y)))]] = 39 + 6x0x0 + 33x0 + 2F1(3) + 4F1(3 + 3x0) + x0F1(3 + 3x0) >= 2x0 + F1(x0) = [[~AP3(_F1, _x0)]] [[~AP1(_F0, _x1)]] = x1 + 2F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP2(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP3(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[casea(_x0, _F1, _F2)]] = 3 + 3x0 + F2(x0) + 2x0F2(x0) + 2F1(x0) + 2F2(0) + x0F1(x0) >= 3 + 2x0 + F2(x0) + x0F1(x0) = [[casea#(_x0, _F1, _F2)]] [[caseb(_x0, _F1, _F2)]] = 3 + 3x0 + 2x0F1(x0) + 2F1(x0) + 2F2(x0) >= 3 + x0 + F2(x0) + 2x0F1(x0) = [[caseb#(_x0, _F1, _F2)]] [[caseu(_x0, _F1, _F2)]] = 3 + 3x0 + 2F1(0) + 2F1(x0) + 2F2(x0) + x0F1(x0) >= 3 + 2x0 + 2F1(x0) + 2F2(x0) = [[caseu#(_x0, _F1, _F2)]] [[~AP1(_F0, _x1)]] = x1 + 2F0(x1) >= max(x1, F0(x1)) = [[#argfun-~AP1##(_F0 _x1)]] [[~AP2(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[#argfun-~AP2##(_F0 _x1)]] [[~AP3(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[#argfun-~AP3##(_F0 _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_0, R_0, minimal, all) by (P_1, R_0, minimal, all), where P_1 consists of: ~AP1#(F, X) =#> F(X) ~AP2#(F, X) =#> F(X) ~AP3#(F, X) =#> F(X) Thus, the original system is terminating if (P_1, R_0, minimal, all) is finite. We consider the dependency pair problem (P_1, R_0, minimal, all). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: ~AP1#(F, X) >? F(X) ~AP2#(F, X) >? F(X) ~AP3#(F, X) >? F(X) casea(inl(X), F, G) >= F X casea(inr(X), F, G) >= G X casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) >= ~AP1(F, X) caseb(inl(X), F, G) >= F X caseb(inr(X), F, G) >= G X caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) >= ~AP2(F, X) caseu(inl(X), F, G) >= F X caseu(inr(X), F, G) >= G X caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) >= ~AP3(F, X) ~AP1(F, X) >= F X ~AP2(F, X) >= F X ~AP3(F, X) >= F X ~AP1(F, X) >= ~AP1#(F, X) ~AP2(F, X) >= ~AP2#(F, X) ~AP3(F, X) >= ~AP3#(F, X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( ~AP1#(F, X) ) = #argfun-~AP1##(F X) pi( ~AP2#(F, X) ) = #argfun-~AP2##(F X) pi( ~AP3#(F, X) ) = #argfun-~AP3##(F X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-~AP1## = \y0.1 + y0 #argfun-~AP2## = \y0.y0 #argfun-~AP3## = \y0.y0 casea = \y0G1G2.3 + 3y0 + G1(0) + 2y0G1(y0) + 2G2(y0) + 3G2(0) caseb = \y0G1G2.3 + 3y0 + 2y0G2(y0) + 2G1(0) + 2G2(0) + 2G2(y0) + y0G1(y0) caseu = \y0G1G2.3 + 3y0 + G1(y0) + 2y0G2(y0) + 2G1(0) + 2G2(0) + 3y0G1(y0) inl = \y0.3 + 3y0 inr = \y0.3 + 3y0 ~AP1 = \G0y1.1 + 2y1 + G0(y1) ~AP1# = \G0y1.0 ~AP2 = \G0y1.2y1 + G0(y1) + 2G0(0) + y1G0(y1) ~AP2# = \G0y1.0 ~AP3 = \G0y1.2y1 + G0(y1) ~AP3# = \G0y1.0 Using this interpretation, the requirements translate to: [[#argfun-~AP1##(_F0 _x1)]] = 1 + max(x1, F0(x1)) > F0(x1) = [[_F0(_x1)]] [[#argfun-~AP2##(_F0 _x1)]] = max(x1, F0(x1)) >= F0(x1) = [[_F0(_x1)]] [[#argfun-~AP3##(_F0 _x1)]] = max(x1, F0(x1)) >= F0(x1) = [[_F0(_x1)]] [[casea(inl(_x0), _F1, _F2)]] = 12 + 9x0 + F1(0) + 2F2(3 + 3x0) + 3F2(0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[casea(inr(_x0), _F1, _F2)]] = 12 + 9x0 + F1(0) + 2F2(3 + 3x0) + 3F2(0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[casea(_x0, /\x.~AP1(_F1, inl(x)), /\y.~AP1(_F1, inr(y)))]] = 45 + 12x0x0 + 29x0 + 2x0F1(3 + 3x0) + 2F1(3 + 3x0) + 4F1(3) >= 1 + 2x0 + F1(x0) = [[~AP1(_F1, _x0)]] [[caseb(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(0) + 3x0F1(3 + 3x0) + 3F1(3 + 3x0) + 6x0F2(3 + 3x0) + 8F2(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseb(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(0) + 3x0F1(3 + 3x0) + 3F1(3 + 3x0) + 6x0F2(3 + 3x0) + 8F2(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseb(_x0, /\x.~AP2(_F1, inl(x)), /\y.~AP2(_F1, inr(y)))]] = 39 + 18x0x0 + 33x0 + 6x0F1(0) + 8F1(3 + 3x0) + 9x0x0F1(3 + 3x0) + 12F1(0) + 16F1(3) + 18x0F1(3 + 3x0) >= 2x0 + F1(x0) + 2F1(0) + x0F1(x0) = [[~AP2(_F1, _x0)]] [[caseu(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(0) + 6x0F2(3 + 3x0) + 6F2(3 + 3x0) + 9x0F1(3 + 3x0) + 10F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseu(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(0) + 6x0F2(3 + 3x0) + 6F2(3 + 3x0) + 9x0F1(3 + 3x0) + 10F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseu(_x0, /\x.~AP3(_F1, inl(x)), /\y.~AP3(_F1, inr(y)))]] = 33 + 30x0x0 + 39x0 + F1(3 + 3x0) + 4F1(3) + 5x0F1(3 + 3x0) >= 2x0 + F1(x0) = [[~AP3(_F1, _x0)]] [[~AP1(_F0, _x1)]] = 1 + 2x1 + F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP2(_F0, _x1)]] = 2x1 + F0(x1) + 2F0(0) + x1F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP3(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP1(_F0, _x1)]] = 1 + 2x1 + F0(x1) >= 1 + max(x1, F0(x1)) = [[#argfun-~AP1##(_F0 _x1)]] [[~AP2(_F0, _x1)]] = 2x1 + F0(x1) + 2F0(0) + x1F0(x1) >= max(x1, F0(x1)) = [[#argfun-~AP2##(_F0 _x1)]] [[~AP3(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[#argfun-~AP3##(_F0 _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_0, minimal, all) by (P_2, R_0, minimal, all), where P_2 consists of: ~AP2#(F, X) =#> F(X) ~AP3#(F, X) =#> F(X) Thus, the original system is terminating if (P_2, R_0, minimal, all) is finite. We consider the dependency pair problem (P_2, R_0, minimal, all). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: ~AP2#(F, X) >? F(X) ~AP3#(F, X) >? F(X) casea(inl(X), F, G) >= F X casea(inr(X), F, G) >= G X casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) >= ~AP1(F, X) caseb(inl(X), F, G) >= F X caseb(inr(X), F, G) >= G X caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) >= ~AP2(F, X) caseu(inl(X), F, G) >= F X caseu(inr(X), F, G) >= G X caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) >= ~AP3(F, X) ~AP1(F, X) >= F X ~AP2(F, X) >= F X ~AP3(F, X) >= F X ~AP2(F, X) >= ~AP2#(F, X) ~AP3(F, X) >= ~AP3#(F, X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( ~AP2#(F, X) ) = #argfun-~AP2##(F X) pi( ~AP3#(F, X) ) = #argfun-~AP3##(F X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-~AP2## = \y0.1 + y0 #argfun-~AP3## = \y0.y0 casea = \y0G1G2.3 + 3y0 + 2y0G1(y0) + 2G1(0) + 2G1(y0) + 2G2(y0) caseb = \y0G1G2.3 + 3y0 + G1(0) + 2y0G1(y0) + 2G2(y0) caseu = \y0G1G2.3 + 3y0 + 2G1(y0) + 2G2(0) + 2G2(y0) inl = \y0.3 + 3y0 inr = \y0.3 + 3y0 ~AP1 = \G0y1.2y1 + G0(y1) ~AP2 = \G0y1.2 + y1 + G0(0) + 2G0(y1) ~AP2# = \G0y1.0 ~AP3 = \G0y1.2y1 + 2G0(y1) ~AP3# = \G0y1.0 Using this interpretation, the requirements translate to: [[#argfun-~AP2##(_F0 _x1)]] = 1 + max(x1, F0(x1)) > F0(x1) = [[_F0(_x1)]] [[#argfun-~AP3##(_F0 _x1)]] = max(x1, F0(x1)) >= F0(x1) = [[_F0(_x1)]] [[casea(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 8F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[casea(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(0) + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 8F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[casea(_x0, /\x.~AP1(_F1, inl(x)), /\y.~AP1(_F1, inr(y)))]] = 39 + 12x0x0 + 39x0 + 2x0F1(3 + 3x0) + 2F1(3) + 4F1(3 + 3x0) >= 2x0 + F1(x0) = [[~AP1(_F1, _x0)]] [[caseb(inl(_x0), _F1, _F2)]] = 12 + 9x0 + F1(0) + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseb(inr(_x0), _F1, _F2)]] = 12 + 9x0 + F1(0) + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseb(_x0, /\x.~AP2(_F1, inl(x)), /\y.~AP2(_F1, inr(y)))]] = 18 + 6x0x0 + 19x0 + 2x0F1(0) + 2F1(3) + 3F1(0) + 4x0F1(3 + 3x0) + 4F1(3 + 3x0) >= 2 + x0 + F1(0) + 2F1(x0) = [[~AP2(_F1, _x0)]] [[caseu(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(3 + 3x0) + 2F2(0) + 2F2(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseu(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(3 + 3x0) + 2F2(0) + 2F2(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseu(_x0, /\x.~AP3(_F1, inl(x)), /\y.~AP3(_F1, inr(y)))]] = 39 + 27x0 + 4F1(3) + 8F1(3 + 3x0) >= 2x0 + 2F1(x0) = [[~AP3(_F1, _x0)]] [[~AP1(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP2(_F0, _x1)]] = 2 + x1 + F0(0) + 2F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP3(_F0, _x1)]] = 2x1 + 2F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP2(_F0, _x1)]] = 2 + x1 + F0(0) + 2F0(x1) >= 1 + max(x1, F0(x1)) = [[#argfun-~AP2##(_F0 _x1)]] [[~AP3(_F0, _x1)]] = 2x1 + 2F0(x1) >= max(x1, F0(x1)) = [[#argfun-~AP3##(_F0 _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_2, R_0, minimal, all) by (P_3, R_0, minimal, all), where P_3 consists of: ~AP3#(F, X) =#> F(X) Thus, the original system is terminating if (P_3, R_0, minimal, all) is finite. We consider the dependency pair problem (P_3, R_0, minimal, all). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: ~AP3#(F, X) >? F(X) casea(inl(X), F, G) >= F X casea(inr(X), F, G) >= G X casea(X, /\x.~AP1(F, inl(x)), /\y.~AP1(F, inr(y))) >= ~AP1(F, X) caseb(inl(X), F, G) >= F X caseb(inr(X), F, G) >= G X caseb(X, /\x.~AP2(F, inl(x)), /\y.~AP2(F, inr(y))) >= ~AP2(F, X) caseu(inl(X), F, G) >= F X caseu(inr(X), F, G) >= G X caseu(X, /\x.~AP3(F, inl(x)), /\y.~AP3(F, inr(y))) >= ~AP3(F, X) ~AP1(F, X) >= F X ~AP2(F, X) >= F X ~AP3(F, X) >= F X ~AP3(F, X) >= ~AP3#(F, X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( ~AP3#(F, X) ) = #argfun-~AP3##(F X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: #argfun-~AP3## = \y0.1 + y0 casea = \y0G1G2.3 + 3y0 + G2(y0) + 2y0G1(y0) + 2G1(0) caseb = \y0G1G2.3 + 3y0 + G1(0) + 2y0G1(y0) + 2G2(y0) caseu = \y0G1G2.3 + 3y0 + 2G1(y0) + 2G2(0) + y0G2(y0) inl = \y0.3 + 3y0 inr = \y0.3 + 3y0 ~AP1 = \G0y1.2y1 + G0(y1) ~AP2 = \G0y1.y1 + G0(y1) ~AP3 = \G0y1.1 + 2y1 + 2G0(y1) + y1G0(y1) ~AP3# = \G0y1.0 Using this interpretation, the requirements translate to: [[#argfun-~AP3##(_F0 _x1)]] = 1 + max(x1, F0(x1)) > F0(x1) = [[_F0(_x1)]] [[casea(inl(_x0), _F1, _F2)]] = 12 + 9x0 + F2(3 + 3x0) + 2F1(0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[casea(inr(_x0), _F1, _F2)]] = 12 + 9x0 + F2(3 + 3x0) + 2F1(0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[casea(_x0, /\x.~AP1(_F1, inl(x)), /\y.~AP1(_F1, inr(y)))]] = 21 + 12x0x0 + 21x0 + F1(3 + 3x0) + 2x0F1(3 + 3x0) + 2F1(3) >= 2x0 + F1(x0) = [[~AP1(_F1, _x0)]] [[caseb(inl(_x0), _F1, _F2)]] = 12 + 9x0 + F1(0) + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseb(inr(_x0), _F1, _F2)]] = 12 + 9x0 + F1(0) + 2F2(3 + 3x0) + 6x0F1(3 + 3x0) + 6F1(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseb(_x0, /\x.~AP2(_F1, inl(x)), /\y.~AP2(_F1, inr(y)))]] = 12 + 6x0x0 + 15x0 + F1(3) + 2x0F1(3 + 3x0) + 2F1(3 + 3x0) >= x0 + F1(x0) = [[~AP2(_F1, _x0)]] [[caseu(inl(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(3 + 3x0) + 2F2(0) + 3x0F2(3 + 3x0) + 3F2(3 + 3x0) >= max(x0, F1(x0)) = [[_F1 _x0]] [[caseu(inr(_x0), _F1, _F2)]] = 12 + 9x0 + 2F1(3 + 3x0) + 2F2(0) + 3x0F2(3 + 3x0) + 3F2(3 + 3x0) >= max(x0, F2(x0)) = [[_F2 _x0]] [[caseu(_x0, /\x.~AP3(_F1, inl(x)), /\y.~AP3(_F1, inr(y)))]] = 31 + 6x0x0 + 22x0 + 3x0x0F1(3 + 3x0) + 10F1(3) + 10F1(3 + 3x0) + 11x0F1(3 + 3x0) >= 1 + 2x0 + 2F1(x0) + x0F1(x0) = [[~AP3(_F1, _x0)]] [[~AP1(_F0, _x1)]] = 2x1 + F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP2(_F0, _x1)]] = x1 + F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP3(_F0, _x1)]] = 1 + 2x1 + 2F0(x1) + x1F0(x1) >= max(x1, F0(x1)) = [[_F0 _x1]] [[~AP3(_F0, _x1)]] = 1 + 2x1 + 2F0(x1) + x1F0(x1) >= 1 + max(x1, F0(x1)) = [[#argfun-~AP3##(_F0 _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_3, R_0) by ({}, R_0). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. As all dependency pair problems were succesfully simplified with sound (and complete) processors until nothing remained, we conclude termination. +++ Citations +++ [Kop11] C. Kop. Simplifying Algebraic Functional Systems. In Proceedings of CAI 2011, volume 6742 of LNCS. 201--215, Springer, 2011. [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012.