(0) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
isort(Nil, r) → Nil
insert(S(x), r) → insert[Ite](<(S(x), x), S(x), r)
inssort(xs) → isort(xs, Nil)
The (relative) TRS S consists of the following rules:
<(S(x), S(y)) → <(x, y)
<(0, S(y)) → True
<(x, 0) → False
insert[Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite](True, x, r) → Cons(x, r)
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (UPPER BOUND(ID) transformation)
Converted Cpx (relative) TRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
<(S(z0), S(z1)) → <(z0, z1)
<(0, S(z0)) → True
<(z0, 0) → False
insert[Ite](False, z0, Cons(z1, z2)) → Cons(z1, insert(z0, z2))
insert[Ite](True, z0, z1) → Cons(z0, z1)
isort(Cons(z0, z1), z2) → isort(z1, insert(z0, z2))
isort(Nil, z0) → Nil
insert(S(z0), z1) → insert[Ite](<(S(z0), z0), S(z0), z1)
inssort(z0) → isort(z0, Nil)
Tuples:
<'(S(z0), S(z1)) → c(<'(z0, z1))
<'(0, S(z0)) → c1
<'(z0, 0) → c2
INSERT[ITE](False, z0, Cons(z1, z2)) → c3(INSERT(z0, z2))
INSERT[ITE](True, z0, z1) → c4
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
ISORT(Nil, z0) → c6
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
INSSORT(z0) → c8(ISORT(z0, Nil))
S tuples:
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
ISORT(Nil, z0) → c6
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
INSSORT(z0) → c8(ISORT(z0, Nil))
K tuples:none
Defined Rule Symbols:
isort, insert, inssort, <, insert[Ite]
Defined Pair Symbols:
<', INSERT[ITE], ISORT, INSERT, INSSORT
Compound Symbols:
c, c1, c2, c3, c4, c5, c6, c7, c8
(3) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)
Removed 1 leading nodes:
INSSORT(z0) → c8(ISORT(z0, Nil))
Removed 4 trailing nodes:
ISORT(Nil, z0) → c6
<'(z0, 0) → c2
<'(0, S(z0)) → c1
INSERT[ITE](True, z0, z1) → c4
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
<(S(z0), S(z1)) → <(z0, z1)
<(0, S(z0)) → True
<(z0, 0) → False
insert[Ite](False, z0, Cons(z1, z2)) → Cons(z1, insert(z0, z2))
insert[Ite](True, z0, z1) → Cons(z0, z1)
isort(Cons(z0, z1), z2) → isort(z1, insert(z0, z2))
isort(Nil, z0) → Nil
insert(S(z0), z1) → insert[Ite](<(S(z0), z0), S(z0), z1)
inssort(z0) → isort(z0, Nil)
Tuples:
<'(S(z0), S(z1)) → c(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c3(INSERT(z0, z2))
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
S tuples:
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
K tuples:none
Defined Rule Symbols:
isort, insert, inssort, <, insert[Ite]
Defined Pair Symbols:
<', INSERT[ITE], ISORT, INSERT
Compound Symbols:
c, c3, c5, c7
(5) CdtUsableRulesProof (EQUIVALENT transformation)
The following rules are not usable and were removed:
isort(Cons(z0, z1), z2) → isort(z1, insert(z0, z2))
isort(Nil, z0) → Nil
inssort(z0) → isort(z0, Nil)
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
insert(S(z0), z1) → insert[Ite](<(S(z0), z0), S(z0), z1)
insert[Ite](False, z0, Cons(z1, z2)) → Cons(z1, insert(z0, z2))
insert[Ite](True, z0, z1) → Cons(z0, z1)
<(S(z0), S(z1)) → <(z0, z1)
<(z0, 0) → False
<(0, S(z0)) → True
Tuples:
<'(S(z0), S(z1)) → c(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c3(INSERT(z0, z2))
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
S tuples:
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
K tuples:none
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
<', INSERT[ITE], ISORT, INSERT
Compound Symbols:
c, c3, c5, c7
(7) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
We considered the (Usable) Rules:none
And the Tuples:
<'(S(z0), S(z1)) → c(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c3(INSERT(z0, z2))
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [5]
POL(<(x1, x2)) = [2]x1
POL(<'(x1, x2)) = 0
POL(Cons(x1, x2)) = [2] + x2
POL(False) = 0
POL(INSERT(x1, x2)) = 0
POL(INSERT[ITE](x1, x2, x3)) = 0
POL(ISORT(x1, x2)) = [4]x1
POL(S(x1)) = 0
POL(True) = [3]
POL(c(x1)) = x1
POL(c3(x1)) = x1
POL(c5(x1, x2)) = x1 + x2
POL(c7(x1, x2)) = x1 + x2
POL(insert(x1, x2)) = 0
POL(insert[Ite](x1, x2, x3)) = [3] + [4]x1 + [4]x2
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
insert(S(z0), z1) → insert[Ite](<(S(z0), z0), S(z0), z1)
insert[Ite](False, z0, Cons(z1, z2)) → Cons(z1, insert(z0, z2))
insert[Ite](True, z0, z1) → Cons(z0, z1)
<(S(z0), S(z1)) → <(z0, z1)
<(z0, 0) → False
<(0, S(z0)) → True
Tuples:
<'(S(z0), S(z1)) → c(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c3(INSERT(z0, z2))
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
S tuples:
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
K tuples:
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
<', INSERT[ITE], ISORT, INSERT
Compound Symbols:
c, c3, c5, c7
(9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
We considered the (Usable) Rules:
insert[Ite](True, z0, z1) → Cons(z0, z1)
insert(S(z0), z1) → insert[Ite](<(S(z0), z0), S(z0), z1)
insert[Ite](False, z0, Cons(z1, z2)) → Cons(z1, insert(z0, z2))
And the Tuples:
<'(S(z0), S(z1)) → c(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c3(INSERT(z0, z2))
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(<(x1, x2)) = 0
POL(<'(x1, x2)) = 0
POL(Cons(x1, x2)) = [1] + x1 + x2
POL(False) = 0
POL(INSERT(x1, x2)) = [2]x1 + x1·x2
POL(INSERT[ITE](x1, x2, x3)) = x2 + x2·x3
POL(ISORT(x1, x2)) = x1·x2 + [2]x12
POL(S(x1)) = [2]
POL(True) = 0
POL(c(x1)) = x1
POL(c3(x1)) = x1
POL(c5(x1, x2)) = x1 + x2
POL(c7(x1, x2)) = x1 + x2
POL(insert(x1, x2)) = [1] + x1 + x2
POL(insert[Ite](x1, x2, x3)) = [1] + x2 + x3
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
insert(S(z0), z1) → insert[Ite](<(S(z0), z0), S(z0), z1)
insert[Ite](False, z0, Cons(z1, z2)) → Cons(z1, insert(z0, z2))
insert[Ite](True, z0, z1) → Cons(z0, z1)
<(S(z0), S(z1)) → <(z0, z1)
<(z0, 0) → False
<(0, S(z0)) → True
Tuples:
<'(S(z0), S(z1)) → c(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c3(INSERT(z0, z2))
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
S tuples:none
K tuples:
ISORT(Cons(z0, z1), z2) → c5(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c7(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
<', INSERT[ITE], ISORT, INSERT
Compound Symbols:
c, c3, c5, c7
(11) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(12) BOUNDS(1, 1)