(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
minus(0, Y) → 0
minus(s(X), s(Y)) → minus(X, Y)
geq(X, 0) → true
geq(0, s(Y)) → false
geq(s(X), s(Y)) → geq(X, Y)
div(0, s(Y)) → 0
div(s(X), s(Y)) → if(geq(X, Y), s(div(minus(X, Y), s(Y))), 0)
if(true, X, Y) → X
if(false, X, Y) → Y
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(0, z0) → 0
minus(s(z0), s(z1)) → minus(z0, z1)
geq(z0, 0) → true
geq(0, s(z0)) → false
geq(s(z0), s(z1)) → geq(z0, z1)
div(0, s(z0)) → 0
div(s(z0), s(z1)) → if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0)
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
S tuples:
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
K tuples:none
Defined Rule Symbols:
minus, geq, div, if
Defined Pair Symbols:
MINUS, GEQ, DIV
Compound Symbols:
c1, c4, c6
(3) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
We considered the (Usable) Rules:
geq(z0, 0) → true
geq(0, s(z0)) → false
geq(s(z0), s(z1)) → geq(z0, z1)
minus(0, z0) → 0
minus(s(z0), s(z1)) → minus(z0, z1)
div(0, s(z0)) → 0
div(s(z0), s(z1)) → if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0)
if(true, z0, z1) → z0
if(false, z0, z1) → z1
And the Tuples:
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(DIV(x1, x2)) = [4]x1
POL(GEQ(x1, x2)) = x1
POL(IF(x1, x2, x3)) = 0
POL(MINUS(x1, x2)) = 0
POL(c1(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1, x2, x3, x4)) = x1 + x2 + x3 + x4
POL(div(x1, x2)) = 0
POL(false) = [3]
POL(geq(x1, x2)) = [2] + [3]x1
POL(if(x1, x2, x3)) = [5] + [3]x1 + [2]x2 + [3]x3
POL(minus(x1, x2)) = 0
POL(s(x1)) = [4] + x1
POL(true) = [1]
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(0, z0) → 0
minus(s(z0), s(z1)) → minus(z0, z1)
geq(z0, 0) → true
geq(0, s(z0)) → false
geq(s(z0), s(z1)) → geq(z0, z1)
div(0, s(z0)) → 0
div(s(z0), s(z1)) → if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0)
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
S tuples:
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
K tuples:
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
Defined Rule Symbols:
minus, geq, div, if
Defined Pair Symbols:
MINUS, GEQ, DIV
Compound Symbols:
c1, c4, c6
(5) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
We considered the (Usable) Rules:
geq(z0, 0) → true
geq(0, s(z0)) → false
geq(s(z0), s(z1)) → geq(z0, z1)
minus(0, z0) → 0
minus(s(z0), s(z1)) → minus(z0, z1)
div(0, s(z0)) → 0
div(s(z0), s(z1)) → if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0)
if(true, z0, z1) → z0
if(false, z0, z1) → z1
And the Tuples:
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(DIV(x1, x2)) = x1
POL(GEQ(x1, x2)) = [2]
POL(IF(x1, x2, x3)) = 0
POL(MINUS(x1, x2)) = x1
POL(c1(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1, x2, x3, x4)) = x1 + x2 + x3 + x4
POL(div(x1, x2)) = [3] + [3]x2
POL(false) = [3]
POL(geq(x1, x2)) = [3] + [4]x1 + [5]x2
POL(if(x1, x2, x3)) = [4] + [4]x1 + [3]x2 + [4]x3
POL(minus(x1, x2)) = 0
POL(s(x1)) = [5] + x1
POL(true) = [4]
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(0, z0) → 0
minus(s(z0), s(z1)) → minus(z0, z1)
geq(z0, 0) → true
geq(0, s(z0)) → false
geq(s(z0), s(z1)) → geq(z0, z1)
div(0, s(z0)) → 0
div(s(z0), s(z1)) → if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0)
if(true, z0, z1) → z0
if(false, z0, z1) → z1
Tuples:
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
S tuples:none
K tuples:
GEQ(s(z0), s(z1)) → c4(GEQ(z0, z1))
DIV(s(z0), s(z1)) → c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1))
MINUS(s(z0), s(z1)) → c1(MINUS(z0, z1))
Defined Rule Symbols:
minus, geq, div, if
Defined Pair Symbols:
MINUS, GEQ, DIV
Compound Symbols:
c1, c4, c6
(7) SIsEmptyProof (EQUIVALENT transformation)
The set S is empty
(8) BOUNDS(O(1), O(1))