(0) Obligation:
The Runtime Complexity (innermost) of the given
CpxRelTRS could be proven to be
BOUNDS(1, n^2).
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) RelTrsToTrsProof (UPPER BOUND(ID) transformation)
transformed relative TRS to TRS
(2) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^2).
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)
<(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
(3) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted Cpx (relative) TRS to CDT
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
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)
<(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)
Tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
ISORT(Nil, z0) → c1
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
INSSORT(z0) → c3(ISORT(z0, Nil))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
<'(0, S(z0)) → c5
<'(z0, 0) → c6
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
INSERT[ITE](True, z0, z1) → c8
S tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
ISORT(Nil, z0) → c1
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
INSSORT(z0) → c3(ISORT(z0, Nil))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
<'(0, S(z0)) → c5
<'(z0, 0) → c6
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
INSERT[ITE](True, z0, z1) → c8
K tuples:none
Defined Rule Symbols:
isort, insert, inssort, <, insert[Ite]
Defined Pair Symbols:
ISORT, INSERT, INSSORT, <', INSERT[ITE]
Compound Symbols:
c, c1, c2, c3, c4, c5, c6, c7, c8
(5) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)
Removed 1 leading nodes:
INSSORT(z0) → c3(ISORT(z0, Nil))
Removed 4 trailing nodes:
<'(0, S(z0)) → c5
<'(z0, 0) → c6
INSERT[ITE](True, z0, z1) → c8
ISORT(Nil, z0) → c1
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
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)
<(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)
Tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
S tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
K tuples:none
Defined Rule Symbols:
isort, insert, inssort, <, insert[Ite]
Defined Pair Symbols:
ISORT, INSERT, <', INSERT[ITE]
Compound Symbols:
c, c2, c4, c7
(7) 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)
(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:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
S tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
K tuples:none
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
ISORT, INSERT, <', INSERT[ITE]
Compound Symbols:
c, c2, c4, c7
(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.
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
We considered the (Usable) Rules:none
And the Tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
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] + x2
POL(False) = 0
POL(INSERT(x1, x2)) = 0
POL(INSERT[ITE](x1, x2, x3)) = 0
POL(ISORT(x1, x2)) = x1
POL(S(x1)) = 0
POL(True) = 0
POL(c(x1, x2)) = x1 + x2
POL(c2(x1, x2)) = x1 + x2
POL(c4(x1)) = x1
POL(c7(x1)) = x1
POL(insert(x1, x2)) = 0
POL(insert[Ite](x1, x2, x3)) = 0
(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:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
S tuples:
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
K tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
ISORT, INSERT, <', INSERT[ITE]
Compound Symbols:
c, c2, c4, c7
(11) 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[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
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:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
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)) = [2] + x1 + x2
POL(False) = 0
POL(INSERT(x1, x2)) = [2]x2 + x1·x2
POL(INSERT[ITE](x1, x2, x3)) = [2]x3 + x2·x3
POL(ISORT(x1, x2)) = x1 + [2]x2 + x1·x2 + [2]x12
POL(S(x1)) = [2]
POL(True) = 0
POL(c(x1, x2)) = x1 + x2
POL(c2(x1, x2)) = x1 + x2
POL(c4(x1)) = x1
POL(c7(x1)) = x1
POL(insert(x1, x2)) = [2] + [2]x1 + x2
POL(insert[Ite](x1, x2, x3)) = [2] + [2]x2 + x3
(12) 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:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
S tuples:
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
K tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
ISORT, INSERT, <', INSERT[ITE]
Compound Symbols:
c, c2, c4, c7
(13) CdtKnowledgeProof (BOTH BOUNDS(ID, ID) transformation)
The following tuples could be moved from S to K by knowledge propagation:
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
(14) 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:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
S tuples:
<'(S(z0), S(z1)) → c4(<'(z0, z1))
K tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
ISORT, INSERT, <', INSERT[ITE]
Compound Symbols:
c, c2, c4, c7
(15) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
<'(S(z0), S(z1)) → c4(<'(z0, z1))
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:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [1]
POL(<(x1, x2)) = 0
POL(<'(x1, x2)) = [2]x1
POL(Cons(x1, x2)) = [2] + x1 + x2
POL(False) = 0
POL(INSERT(x1, x2)) = [2]x1 + x1·x2
POL(INSERT[ITE](x1, x2, x3)) = x2·x3
POL(ISORT(x1, x2)) = x1·x2 + x12
POL(S(x1)) = [1] + x1
POL(True) = 0
POL(c(x1, x2)) = x1 + x2
POL(c2(x1, x2)) = x1 + x2
POL(c4(x1)) = x1
POL(c7(x1)) = x1
POL(insert(x1, x2)) = [2] + x1 + x2
POL(insert[Ite](x1, x2, x3)) = [2] + x2 + x3
(16) 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:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
S tuples:none
K tuples:
ISORT(Cons(z0, z1), z2) → c(ISORT(z1, insert(z0, z2)), INSERT(z0, z2))
INSERT[ITE](False, z0, Cons(z1, z2)) → c7(INSERT(z0, z2))
INSERT(S(z0), z1) → c2(INSERT[ITE](<(S(z0), z0), S(z0), z1), <'(S(z0), z0))
<'(S(z0), S(z1)) → c4(<'(z0, z1))
Defined Rule Symbols:
insert, insert[Ite], <
Defined Pair Symbols:
ISORT, INSERT, <', INSERT[ITE]
Compound Symbols:
c, c2, c4, c7
(17) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(18) BOUNDS(1, 1)