(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
perfectp(0) → false
perfectp(s(x)) → f(x, s(0), s(x), s(x))
f(0, y, 0, u) → true
f(0, y, s(z), u) → false
f(s(x), 0, z, u) → f(x, u, minus(z, s(x)), u)
f(s(x), s(y), z, u) → if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u))
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted Cpx (relative) TRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
perfectp(0) → false
perfectp(s(z0)) → f(z0, s(0), s(z0), s(z0))
f(0, z0, 0, z1) → true
f(0, z0, s(z1), z2) → false
f(s(z0), 0, z1, z2) → f(z0, z2, minus(z1, s(z0)), z2)
f(s(z0), s(z1), z2, z3) → if(le(z0, z1), f(s(z0), minus(z1, z0), z2, z3), f(z0, z3, z2, z3))
Tuples:
PERFECTP(0) → c
PERFECTP(s(z0)) → c1(F(z0, s(0), s(z0), s(z0)))
F(0, z0, 0, z1) → c2
F(0, z0, s(z1), z2) → c3
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(s(z0), minus(z1, z0), z2, z3), F(z0, z3, z2, z3))
S tuples:
PERFECTP(0) → c
PERFECTP(s(z0)) → c1(F(z0, s(0), s(z0), s(z0)))
F(0, z0, 0, z1) → c2
F(0, z0, s(z1), z2) → c3
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(s(z0), minus(z1, z0), z2, z3), F(z0, z3, z2, z3))
K tuples:none
Defined Rule Symbols:
perfectp, f
Defined Pair Symbols:
PERFECTP, F
Compound Symbols:
c, c1, c2, c3, c4, c5
(3) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)
Removed 1 leading nodes:
PERFECTP(s(z0)) → c1(F(z0, s(0), s(z0), s(z0)))
Removed 3 trailing nodes:
F(0, z0, s(z1), z2) → c3
F(0, z0, 0, z1) → c2
PERFECTP(0) → c
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
perfectp(0) → false
perfectp(s(z0)) → f(z0, s(0), s(z0), s(z0))
f(0, z0, 0, z1) → true
f(0, z0, s(z1), z2) → false
f(s(z0), 0, z1, z2) → f(z0, z2, minus(z1, s(z0)), z2)
f(s(z0), s(z1), z2, z3) → if(le(z0, z1), f(s(z0), minus(z1, z0), z2, z3), f(z0, z3, z2, z3))
Tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(s(z0), minus(z1, z0), z2, z3), F(z0, z3, z2, z3))
S tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(s(z0), minus(z1, z0), z2, z3), F(z0, z3, z2, z3))
K tuples:none
Defined Rule Symbols:
perfectp, f
Defined Pair Symbols:
F
Compound Symbols:
c4, c5
(5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID) transformation)
Removed 1 trailing tuple parts
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
perfectp(0) → false
perfectp(s(z0)) → f(z0, s(0), s(z0), s(z0))
f(0, z0, 0, z1) → true
f(0, z0, s(z1), z2) → false
f(s(z0), 0, z1, z2) → f(z0, z2, minus(z1, s(z0)), z2)
f(s(z0), s(z1), z2, z3) → if(le(z0, z1), f(s(z0), minus(z1, z0), z2, z3), f(z0, z3, z2, z3))
Tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
S tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
K tuples:none
Defined Rule Symbols:
perfectp, f
Defined Pair Symbols:
F
Compound Symbols:
c4, c5
(7) CdtUsableRulesProof (EQUIVALENT transformation)
The following rules are not usable and were removed:
perfectp(0) → false
perfectp(s(z0)) → f(z0, s(0), s(z0), s(z0))
f(0, z0, 0, z1) → true
f(0, z0, s(z1), z2) → false
f(s(z0), 0, z1, z2) → f(z0, z2, minus(z1, s(z0)), z2)
f(s(z0), s(z1), z2, z3) → if(le(z0, z1), f(s(z0), minus(z1, z0), z2, z3), f(z0, z3, z2, z3))
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
S tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
K tuples:none
Defined Rule Symbols:none
Defined Pair Symbols:
F
Compound Symbols:
c4, c5
(9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
We considered the (Usable) Rules:none
And the Tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(F(x1, x2, x3, x4)) = [2]x1 + [3]x3
POL(c4(x1)) = x1
POL(c5(x1)) = x1
POL(minus(x1, x2)) = [1]
POL(s(x1)) = [2] + x1
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
S tuples:none
K tuples:
F(s(z0), 0, z1, z2) → c4(F(z0, z2, minus(z1, s(z0)), z2))
F(s(z0), s(z1), z2, z3) → c5(F(z0, z3, z2, z3))
Defined Rule Symbols:none
Defined Pair Symbols:
F
Compound Symbols:
c4, c5
(11) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(12) BOUNDS(1, 1)