(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
active(p(0)) → mark(0)
active(p(s(X))) → mark(X)
active(leq(0, Y)) → mark(true)
active(leq(s(X), 0)) → mark(false)
active(leq(s(X), s(Y))) → mark(leq(X, Y))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(diff(X, Y)) → mark(if(leq(X, Y), 0, s(diff(p(X), Y))))
mark(p(X)) → active(p(mark(X)))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(leq(X1, X2)) → active(leq(mark(X1), mark(X2)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(X1, X2, X3)) → active(if(mark(X1), X2, X3))
mark(diff(X1, X2)) → active(diff(mark(X1), mark(X2)))
p(mark(X)) → p(X)
p(active(X)) → p(X)
s(mark(X)) → s(X)
s(active(X)) → s(X)
leq(mark(X1), X2) → leq(X1, X2)
leq(X1, mark(X2)) → leq(X1, X2)
leq(active(X1), X2) → leq(X1, X2)
leq(X1, active(X2)) → leq(X1, X2)
if(mark(X1), X2, X3) → if(X1, X2, X3)
if(X1, mark(X2), X3) → if(X1, X2, X3)
if(X1, X2, mark(X3)) → if(X1, X2, X3)
if(active(X1), X2, X3) → if(X1, X2, X3)
if(X1, active(X2), X3) → if(X1, X2, X3)
if(X1, X2, active(X3)) → if(X1, X2, X3)
diff(mark(X1), X2) → diff(X1, X2)
diff(X1, mark(X2)) → diff(X1, X2)
diff(active(X1), X2) → diff(X1, X2)
diff(X1, active(X2)) → diff(X1, X2)
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
active(p(0)) → mark(0)
active(p(s(z0))) → mark(z0)
active(leq(0, z0)) → mark(true)
active(leq(s(z0), 0)) → mark(false)
active(leq(s(z0), s(z1))) → mark(leq(z0, z1))
active(if(true, z0, z1)) → mark(z0)
active(if(false, z0, z1)) → mark(z1)
active(diff(z0, z1)) → mark(if(leq(z0, z1), 0, s(diff(p(z0), z1))))
mark(p(z0)) → active(p(mark(z0)))
mark(0) → active(0)
mark(s(z0)) → active(s(mark(z0)))
mark(leq(z0, z1)) → active(leq(mark(z0), mark(z1)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(z0, z1, z2)) → active(if(mark(z0), z1, z2))
mark(diff(z0, z1)) → active(diff(mark(z0), mark(z1)))
p(mark(z0)) → p(z0)
p(active(z0)) → p(z0)
s(mark(z0)) → s(z0)
s(active(z0)) → s(z0)
leq(mark(z0), z1) → leq(z0, z1)
leq(z0, mark(z1)) → leq(z0, z1)
leq(active(z0), z1) → leq(z0, z1)
leq(z0, active(z1)) → leq(z0, z1)
if(mark(z0), z1, z2) → if(z0, z1, z2)
if(z0, mark(z1), z2) → if(z0, z1, z2)
if(z0, z1, mark(z2)) → if(z0, z1, z2)
if(active(z0), z1, z2) → if(z0, z1, z2)
if(z0, active(z1), z2) → if(z0, z1, z2)
if(z0, z1, active(z2)) → if(z0, z1, z2)
diff(mark(z0), z1) → diff(z0, z1)
diff(z0, mark(z1)) → diff(z0, z1)
diff(active(z0), z1) → diff(z0, z1)
diff(z0, active(z1)) → diff(z0, z1)
Tuples:
ACTIVE(p(0)) → c(MARK(0))
ACTIVE(p(s(z0))) → c1(MARK(z0))
ACTIVE(leq(0, z0)) → c2(MARK(true))
ACTIVE(leq(s(z0), 0)) → c3(MARK(false))
ACTIVE(leq(s(z0), s(z1))) → c4(MARK(leq(z0, z1)), LEQ(z0, z1))
ACTIVE(if(true, z0, z1)) → c5(MARK(z0))
ACTIVE(if(false, z0, z1)) → c6(MARK(z1))
ACTIVE(diff(z0, z1)) → c7(MARK(if(leq(z0, z1), 0, s(diff(p(z0), z1)))), IF(leq(z0, z1), 0, s(diff(p(z0), z1))), LEQ(z0, z1), S(diff(p(z0), z1)), DIFF(p(z0), z1), P(z0))
MARK(p(z0)) → c8(ACTIVE(p(mark(z0))), P(mark(z0)), MARK(z0))
MARK(0) → c9(ACTIVE(0))
MARK(s(z0)) → c10(ACTIVE(s(mark(z0))), S(mark(z0)), MARK(z0))
MARK(leq(z0, z1)) → c11(ACTIVE(leq(mark(z0), mark(z1))), LEQ(mark(z0), mark(z1)), MARK(z0), MARK(z1))
MARK(true) → c12(ACTIVE(true))
MARK(false) → c13(ACTIVE(false))
MARK(if(z0, z1, z2)) → c14(ACTIVE(if(mark(z0), z1, z2)), IF(mark(z0), z1, z2), MARK(z0))
MARK(diff(z0, z1)) → c15(ACTIVE(diff(mark(z0), mark(z1))), DIFF(mark(z0), mark(z1)), MARK(z0), MARK(z1))
P(mark(z0)) → c16(P(z0))
P(active(z0)) → c17(P(z0))
S(mark(z0)) → c18(S(z0))
S(active(z0)) → c19(S(z0))
LEQ(mark(z0), z1) → c20(LEQ(z0, z1))
LEQ(z0, mark(z1)) → c21(LEQ(z0, z1))
LEQ(active(z0), z1) → c22(LEQ(z0, z1))
LEQ(z0, active(z1)) → c23(LEQ(z0, z1))
IF(mark(z0), z1, z2) → c24(IF(z0, z1, z2))
IF(z0, mark(z1), z2) → c25(IF(z0, z1, z2))
IF(z0, z1, mark(z2)) → c26(IF(z0, z1, z2))
IF(active(z0), z1, z2) → c27(IF(z0, z1, z2))
IF(z0, active(z1), z2) → c28(IF(z0, z1, z2))
IF(z0, z1, active(z2)) → c29(IF(z0, z1, z2))
DIFF(mark(z0), z1) → c30(DIFF(z0, z1))
DIFF(z0, mark(z1)) → c31(DIFF(z0, z1))
DIFF(active(z0), z1) → c32(DIFF(z0, z1))
DIFF(z0, active(z1)) → c33(DIFF(z0, z1))
S tuples:
ACTIVE(p(0)) → c(MARK(0))
ACTIVE(p(s(z0))) → c1(MARK(z0))
ACTIVE(leq(0, z0)) → c2(MARK(true))
ACTIVE(leq(s(z0), 0)) → c3(MARK(false))
ACTIVE(leq(s(z0), s(z1))) → c4(MARK(leq(z0, z1)), LEQ(z0, z1))
ACTIVE(if(true, z0, z1)) → c5(MARK(z0))
ACTIVE(if(false, z0, z1)) → c6(MARK(z1))
ACTIVE(diff(z0, z1)) → c7(MARK(if(leq(z0, z1), 0, s(diff(p(z0), z1)))), IF(leq(z0, z1), 0, s(diff(p(z0), z1))), LEQ(z0, z1), S(diff(p(z0), z1)), DIFF(p(z0), z1), P(z0))
MARK(p(z0)) → c8(ACTIVE(p(mark(z0))), P(mark(z0)), MARK(z0))
MARK(0) → c9(ACTIVE(0))
MARK(s(z0)) → c10(ACTIVE(s(mark(z0))), S(mark(z0)), MARK(z0))
MARK(leq(z0, z1)) → c11(ACTIVE(leq(mark(z0), mark(z1))), LEQ(mark(z0), mark(z1)), MARK(z0), MARK(z1))
MARK(true) → c12(ACTIVE(true))
MARK(false) → c13(ACTIVE(false))
MARK(if(z0, z1, z2)) → c14(ACTIVE(if(mark(z0), z1, z2)), IF(mark(z0), z1, z2), MARK(z0))
MARK(diff(z0, z1)) → c15(ACTIVE(diff(mark(z0), mark(z1))), DIFF(mark(z0), mark(z1)), MARK(z0), MARK(z1))
P(mark(z0)) → c16(P(z0))
P(active(z0)) → c17(P(z0))
S(mark(z0)) → c18(S(z0))
S(active(z0)) → c19(S(z0))
LEQ(mark(z0), z1) → c20(LEQ(z0, z1))
LEQ(z0, mark(z1)) → c21(LEQ(z0, z1))
LEQ(active(z0), z1) → c22(LEQ(z0, z1))
LEQ(z0, active(z1)) → c23(LEQ(z0, z1))
IF(mark(z0), z1, z2) → c24(IF(z0, z1, z2))
IF(z0, mark(z1), z2) → c25(IF(z0, z1, z2))
IF(z0, z1, mark(z2)) → c26(IF(z0, z1, z2))
IF(active(z0), z1, z2) → c27(IF(z0, z1, z2))
IF(z0, active(z1), z2) → c28(IF(z0, z1, z2))
IF(z0, z1, active(z2)) → c29(IF(z0, z1, z2))
DIFF(mark(z0), z1) → c30(DIFF(z0, z1))
DIFF(z0, mark(z1)) → c31(DIFF(z0, z1))
DIFF(active(z0), z1) → c32(DIFF(z0, z1))
DIFF(z0, active(z1)) → c33(DIFF(z0, z1))
K tuples:none
Defined Rule Symbols:
active, mark, p, s, leq, if, diff
Defined Pair Symbols:
ACTIVE, MARK, P, S, LEQ, IF, DIFF
Compound Symbols:
c, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33
(3) CdtUnreachableProof (EQUIVALENT transformation)
The following tuples could be removed as they are not reachable from basic start terms:
ACTIVE(p(0)) → c(MARK(0))
ACTIVE(p(s(z0))) → c1(MARK(z0))
ACTIVE(leq(0, z0)) → c2(MARK(true))
ACTIVE(leq(s(z0), 0)) → c3(MARK(false))
ACTIVE(leq(s(z0), s(z1))) → c4(MARK(leq(z0, z1)), LEQ(z0, z1))
ACTIVE(if(true, z0, z1)) → c5(MARK(z0))
ACTIVE(if(false, z0, z1)) → c6(MARK(z1))
ACTIVE(diff(z0, z1)) → c7(MARK(if(leq(z0, z1), 0, s(diff(p(z0), z1)))), IF(leq(z0, z1), 0, s(diff(p(z0), z1))), LEQ(z0, z1), S(diff(p(z0), z1)), DIFF(p(z0), z1), P(z0))
MARK(p(z0)) → c8(ACTIVE(p(mark(z0))), P(mark(z0)), MARK(z0))
MARK(s(z0)) → c10(ACTIVE(s(mark(z0))), S(mark(z0)), MARK(z0))
MARK(leq(z0, z1)) → c11(ACTIVE(leq(mark(z0), mark(z1))), LEQ(mark(z0), mark(z1)), MARK(z0), MARK(z1))
MARK(if(z0, z1, z2)) → c14(ACTIVE(if(mark(z0), z1, z2)), IF(mark(z0), z1, z2), MARK(z0))
MARK(diff(z0, z1)) → c15(ACTIVE(diff(mark(z0), mark(z1))), DIFF(mark(z0), mark(z1)), MARK(z0), MARK(z1))
P(mark(z0)) → c16(P(z0))
P(active(z0)) → c17(P(z0))
S(mark(z0)) → c18(S(z0))
S(active(z0)) → c19(S(z0))
LEQ(mark(z0), z1) → c20(LEQ(z0, z1))
LEQ(z0, mark(z1)) → c21(LEQ(z0, z1))
LEQ(active(z0), z1) → c22(LEQ(z0, z1))
LEQ(z0, active(z1)) → c23(LEQ(z0, z1))
IF(mark(z0), z1, z2) → c24(IF(z0, z1, z2))
IF(z0, mark(z1), z2) → c25(IF(z0, z1, z2))
IF(z0, z1, mark(z2)) → c26(IF(z0, z1, z2))
IF(active(z0), z1, z2) → c27(IF(z0, z1, z2))
IF(z0, active(z1), z2) → c28(IF(z0, z1, z2))
IF(z0, z1, active(z2)) → c29(IF(z0, z1, z2))
DIFF(mark(z0), z1) → c30(DIFF(z0, z1))
DIFF(z0, mark(z1)) → c31(DIFF(z0, z1))
DIFF(active(z0), z1) → c32(DIFF(z0, z1))
DIFF(z0, active(z1)) → c33(DIFF(z0, z1))
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
active(p(0)) → mark(0)
active(p(s(z0))) → mark(z0)
active(leq(0, z0)) → mark(true)
active(leq(s(z0), 0)) → mark(false)
active(leq(s(z0), s(z1))) → mark(leq(z0, z1))
active(if(true, z0, z1)) → mark(z0)
active(if(false, z0, z1)) → mark(z1)
active(diff(z0, z1)) → mark(if(leq(z0, z1), 0, s(diff(p(z0), z1))))
mark(p(z0)) → active(p(mark(z0)))
mark(0) → active(0)
mark(s(z0)) → active(s(mark(z0)))
mark(leq(z0, z1)) → active(leq(mark(z0), mark(z1)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(z0, z1, z2)) → active(if(mark(z0), z1, z2))
mark(diff(z0, z1)) → active(diff(mark(z0), mark(z1)))
p(mark(z0)) → p(z0)
p(active(z0)) → p(z0)
s(mark(z0)) → s(z0)
s(active(z0)) → s(z0)
leq(mark(z0), z1) → leq(z0, z1)
leq(z0, mark(z1)) → leq(z0, z1)
leq(active(z0), z1) → leq(z0, z1)
leq(z0, active(z1)) → leq(z0, z1)
if(mark(z0), z1, z2) → if(z0, z1, z2)
if(z0, mark(z1), z2) → if(z0, z1, z2)
if(z0, z1, mark(z2)) → if(z0, z1, z2)
if(active(z0), z1, z2) → if(z0, z1, z2)
if(z0, active(z1), z2) → if(z0, z1, z2)
if(z0, z1, active(z2)) → if(z0, z1, z2)
diff(mark(z0), z1) → diff(z0, z1)
diff(z0, mark(z1)) → diff(z0, z1)
diff(active(z0), z1) → diff(z0, z1)
diff(z0, active(z1)) → diff(z0, z1)
Tuples:
MARK(0) → c9(ACTIVE(0))
MARK(true) → c12(ACTIVE(true))
MARK(false) → c13(ACTIVE(false))
S tuples:
MARK(0) → c9(ACTIVE(0))
MARK(true) → c12(ACTIVE(true))
MARK(false) → c13(ACTIVE(false))
K tuples:none
Defined Rule Symbols:
active, mark, p, s, leq, if, diff
Defined Pair Symbols:
MARK
Compound Symbols:
c9, c12, c13
(5) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)
Removed 3 trailing nodes:
MARK(false) → c13(ACTIVE(false))
MARK(0) → c9(ACTIVE(0))
MARK(true) → c12(ACTIVE(true))
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
active(p(0)) → mark(0)
active(p(s(z0))) → mark(z0)
active(leq(0, z0)) → mark(true)
active(leq(s(z0), 0)) → mark(false)
active(leq(s(z0), s(z1))) → mark(leq(z0, z1))
active(if(true, z0, z1)) → mark(z0)
active(if(false, z0, z1)) → mark(z1)
active(diff(z0, z1)) → mark(if(leq(z0, z1), 0, s(diff(p(z0), z1))))
mark(p(z0)) → active(p(mark(z0)))
mark(0) → active(0)
mark(s(z0)) → active(s(mark(z0)))
mark(leq(z0, z1)) → active(leq(mark(z0), mark(z1)))
mark(true) → active(true)
mark(false) → active(false)
mark(if(z0, z1, z2)) → active(if(mark(z0), z1, z2))
mark(diff(z0, z1)) → active(diff(mark(z0), mark(z1)))
p(mark(z0)) → p(z0)
p(active(z0)) → p(z0)
s(mark(z0)) → s(z0)
s(active(z0)) → s(z0)
leq(mark(z0), z1) → leq(z0, z1)
leq(z0, mark(z1)) → leq(z0, z1)
leq(active(z0), z1) → leq(z0, z1)
leq(z0, active(z1)) → leq(z0, z1)
if(mark(z0), z1, z2) → if(z0, z1, z2)
if(z0, mark(z1), z2) → if(z0, z1, z2)
if(z0, z1, mark(z2)) → if(z0, z1, z2)
if(active(z0), z1, z2) → if(z0, z1, z2)
if(z0, active(z1), z2) → if(z0, z1, z2)
if(z0, z1, active(z2)) → if(z0, z1, z2)
diff(mark(z0), z1) → diff(z0, z1)
diff(z0, mark(z1)) → diff(z0, z1)
diff(active(z0), z1) → diff(z0, z1)
diff(z0, active(z1)) → diff(z0, z1)
Tuples:none
S tuples:none
K tuples:none
Defined Rule Symbols:
active, mark, p, s, leq, if, diff
Defined Pair Symbols:none
Compound Symbols:none
(7) SIsEmptyProof (EQUIVALENT transformation)
The set S is empty
(8) BOUNDS(O(1), O(1))