(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
shuffle(Cons(x, xs)) → Cons(x, shuffle(reverse(xs)))
reverse(Cons(x, xs)) → append(reverse(xs), Cons(x, Nil))
append(Cons(x, xs), ys) → Cons(x, append(xs, ys))
shuffle(Nil) → Nil
reverse(Nil) → Nil
append(Nil, ys) → ys
goal(xs) → shuffle(xs)
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted Cpx (relative) TRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
shuffle(Cons(z0, z1)) → Cons(z0, shuffle(reverse(z1)))
shuffle(Nil) → Nil
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
append(Nil, z0) → z0
goal(z0) → shuffle(z0)
Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
SHUFFLE(Nil) → c1
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
REVERSE(Nil) → c3
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
APPEND(Nil, z0) → c5
GOAL(z0) → c6(SHUFFLE(z0))
S tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
SHUFFLE(Nil) → c1
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
REVERSE(Nil) → c3
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
APPEND(Nil, z0) → c5
GOAL(z0) → c6(SHUFFLE(z0))
K tuples:none
Defined Rule Symbols:
shuffle, reverse, append, goal
Defined Pair Symbols:
SHUFFLE, REVERSE, APPEND, GOAL
Compound Symbols:
c, c1, c2, c3, c4, c5, c6
(3) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)
Removed 1 leading nodes:
GOAL(z0) → c6(SHUFFLE(z0))
Removed 3 trailing nodes:
REVERSE(Nil) → c3
SHUFFLE(Nil) → c1
APPEND(Nil, z0) → c5
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
shuffle(Cons(z0, z1)) → Cons(z0, shuffle(reverse(z1)))
shuffle(Nil) → Nil
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
append(Nil, z0) → z0
goal(z0) → shuffle(z0)
Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
S tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
K tuples:none
Defined Rule Symbols:
shuffle, reverse, append, goal
Defined Pair Symbols:
SHUFFLE, REVERSE, APPEND
Compound Symbols:
c, c2, c4
(5) CdtUsableRulesProof (EQUIVALENT transformation)
The following rules are not usable and were removed:
shuffle(Cons(z0, z1)) → Cons(z0, shuffle(reverse(z1)))
shuffle(Nil) → Nil
goal(z0) → shuffle(z0)
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
append(Nil, z0) → z0
Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
S tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
K tuples:none
Defined Rule Symbols:
reverse, append
Defined Pair Symbols:
SHUFFLE, REVERSE, APPEND
Compound Symbols:
c, c2, c4
(7) CdtRuleRemovalProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
We considered the (Usable) Rules:
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
append(Nil, z0) → z0
And the Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(APPEND(x1, x2)) = 0
POL(Cons(x1, x2)) = [1] + x2
POL(Nil) = 0
POL(REVERSE(x1)) = [1]
POL(SHUFFLE(x1)) = [2]x1
POL(append(x1, x2)) = x1 + x2
POL(c(x1, x2)) = x1 + x2
POL(c2(x1, x2)) = x1 + x2
POL(c4(x1)) = x1
POL(reverse(x1)) = x1
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
append(Nil, z0) → z0
Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
S tuples:
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
K tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
Defined Rule Symbols:
reverse, append
Defined Pair Symbols:
SHUFFLE, REVERSE, APPEND
Compound Symbols:
c, c2, c4
(9) CdtRuleRemovalProof (UPPER BOUND (ADD(O(n^2))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
We considered the (Usable) Rules:
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
append(Nil, z0) → z0
And the Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(APPEND(x1, x2)) = 0
POL(Cons(x1, x2)) = [1] + x2
POL(Nil) = 0
POL(REVERSE(x1)) = [1] + x1
POL(SHUFFLE(x1)) = x12
POL(append(x1, x2)) = x1 + x2
POL(c(x1, x2)) = x1 + x2
POL(c2(x1, x2)) = x1 + x2
POL(c4(x1)) = x1
POL(reverse(x1)) = x1
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
append(Nil, z0) → z0
Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
S tuples:
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
K tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
Defined Rule Symbols:
reverse, append
Defined Pair Symbols:
SHUFFLE, REVERSE, APPEND
Compound Symbols:
c, c2, c4
(11) CdtRuleRemovalProof (UPPER BOUND (ADD(O(n^3))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
We considered the (Usable) Rules:
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
append(Nil, z0) → z0
And the Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(APPEND(x1, x2)) = x1 + x2 + x23
POL(Cons(x1, x2)) = [1] + x2
POL(Nil) = 0
POL(REVERSE(x1)) = [1] + x1 + x12
POL(SHUFFLE(x1)) = x1 + x13
POL(append(x1, x2)) = x1 + x2
POL(c(x1, x2)) = x1 + x2
POL(c2(x1, x2)) = x1 + x2
POL(c4(x1)) = x1
POL(reverse(x1)) = x1
(12) Obligation:
Complexity Dependency Tuples Problem
Rules:
reverse(Cons(z0, z1)) → append(reverse(z1), Cons(z0, Nil))
reverse(Nil) → Nil
append(Cons(z0, z1), z2) → Cons(z0, append(z1, z2))
append(Nil, z0) → z0
Tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
S tuples:none
K tuples:
SHUFFLE(Cons(z0, z1)) → c(SHUFFLE(reverse(z1)), REVERSE(z1))
REVERSE(Cons(z0, z1)) → c2(APPEND(reverse(z1), Cons(z0, Nil)), REVERSE(z1))
APPEND(Cons(z0, z1), z2) → c4(APPEND(z1, z2))
Defined Rule Symbols:
reverse, append
Defined Pair Symbols:
SHUFFLE, REVERSE, APPEND
Compound Symbols:
c, c2, c4
(13) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(14) BOUNDS(O(1), O(1))