(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
SPLIT(z0, add(z1, z2)) → c6(F_1(split(z0, z2), z0, z1, z2), SPLIT(z0, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
S tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
SPLIT(z0, add(z1, z2)) → c6(F_1(split(z0, z2), z0, z1, z2), SPLIT(z0, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
K tuples:none
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, SPLIT, F_1, QSORT, F_3
Compound Symbols:
c2, c4, c6, c7, c11, c12
(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.
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
We considered the (Usable) Rules:
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
And the Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
SPLIT(z0, add(z1, z2)) → c6(F_1(split(z0, z2), z0, z1, z2), SPLIT(z0, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [1]
POL(APPEND(x1, x2)) = 0
POL(F_1(x1, x2, x3, x4)) = 0
POL(F_2(x1, x2, x3, x4, x5, x6)) = 0
POL(F_3(x1, x2, x3)) = [4] + [4]x1
POL(LT(x1, x2)) = 0
POL(QSORT(x1)) = [4]x1
POL(SPLIT(x1, x2)) = 0
POL(add(x1, x2)) = [1] + x2
POL(append(x1, x2)) = 0
POL(c11(x1, x2)) = x1 + x2
POL(c12(x1, x2, x3)) = x1 + x2 + x3
POL(c2(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1, x2)) = x1 + x2
POL(c7(x1, x2)) = x1 + x2
POL(f_1(x1, x2, x3, x4)) = [1] + x1
POL(f_2(x1, x2, x3, x4, x5, x6)) = [1] + x5 + x6
POL(f_3(x1, x2, x3)) = [3] + [2]x2 + [3]x3
POL(false) = 0
POL(lt(x1, x2)) = 0
POL(nil) = 0
POL(pair(x1, x2)) = x1 + x2
POL(qsort(x1)) = 0
POL(s(x1)) = 0
POL(split(x1, x2)) = x2
POL(true) = 0
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
SPLIT(z0, add(z1, z2)) → c6(F_1(split(z0, z2), z0, z1, z2), SPLIT(z0, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
S tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
SPLIT(z0, add(z1, z2)) → c6(F_1(split(z0, z2), z0, z1, z2), SPLIT(z0, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, SPLIT, F_1, QSORT, F_3
Compound Symbols:
c2, c4, c6, c7, c11, c12
(5) CdtKnowledgeProof (EQUIVALENT transformation)
The following tuples could be moved from S to K by knowledge propagation:
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
SPLIT(z0, add(z1, z2)) → c6(F_1(split(z0, z2), z0, z1, z2), SPLIT(z0, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
S tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
SPLIT(z0, add(z1, z2)) → c6(F_1(split(z0, z2), z0, z1, z2), SPLIT(z0, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, SPLIT, F_1, QSORT, F_3
Compound Symbols:
c2, c4, c6, c7, c11, c12
(7) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)
Use narrowing to replace
SPLIT(
z0,
add(
z1,
z2)) →
c6(
F_1(
split(
z0,
z2),
z0,
z1,
z2),
SPLIT(
z0,
z2)) by
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
SPLIT(x0, add(x1, x2)) → c6
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
SPLIT(x0, add(x1, x2)) → c6
S tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
SPLIT(x0, add(x1, x2)) → c6
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, F_1, QSORT, F_3, SPLIT
Compound Symbols:
c2, c4, c7, c11, c12, c6, c6
(9) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)
Removed 1 trailing nodes:
SPLIT(x0, add(x1, x2)) → c6
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
S tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, F_1, QSORT, F_3, SPLIT
Compound Symbols:
c2, c4, c7, c11, c12, c6
(11) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
LT(s(z0), s(z1)) → c2(LT(z0, z1))
We considered the (Usable) Rules:
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
And the Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(APPEND(x1, x2)) = 0
POL(F_1(x1, x2, x3, x4)) = x2·x3
POL(F_2(x1, x2, x3, x4, x5, x6)) = 0
POL(F_3(x1, x2, x3)) = x12
POL(LT(x1, x2)) = x1·x2
POL(QSORT(x1)) = x12
POL(SPLIT(x1, x2)) = x1·x2
POL(add(x1, x2)) = x1 + x2
POL(append(x1, x2)) = 0
POL(c11(x1, x2)) = x1 + x2
POL(c12(x1, x2, x3)) = x1 + x2 + x3
POL(c2(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1, x2)) = x1 + x2
POL(c7(x1, x2)) = x1 + x2
POL(f_1(x1, x2, x3, x4)) = x1 + x3
POL(f_2(x1, x2, x3, x4, x5, x6)) = x3 + x5 + x6
POL(f_3(x1, x2, x3)) = 0
POL(false) = 0
POL(lt(x1, x2)) = 0
POL(nil) = 0
POL(pair(x1, x2)) = x1 + x2
POL(qsort(x1)) = 0
POL(s(x1)) = [2] + x1
POL(split(x1, x2)) = x2
POL(true) = 0
(12) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
S tuples:
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
LT(s(z0), s(z1)) → c2(LT(z0, z1))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, F_1, QSORT, F_3, SPLIT
Compound Symbols:
c2, c4, c7, c11, c12, c6
(13) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
We considered the (Usable) Rules:
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
And the Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(APPEND(x1, x2)) = 0
POL(F_1(x1, x2, x3, x4)) = 0
POL(F_2(x1, x2, x3, x4, x5, x6)) = 0
POL(F_3(x1, x2, x3)) = [1] + x12
POL(LT(x1, x2)) = 0
POL(QSORT(x1)) = x12
POL(SPLIT(x1, x2)) = x2
POL(add(x1, x2)) = [1] + x2
POL(append(x1, x2)) = 0
POL(c11(x1, x2)) = x1 + x2
POL(c12(x1, x2, x3)) = x1 + x2 + x3
POL(c2(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1, x2)) = x1 + x2
POL(c7(x1, x2)) = x1 + x2
POL(f_1(x1, x2, x3, x4)) = [1] + x1
POL(f_2(x1, x2, x3, x4, x5, x6)) = [1] + x5 + x6
POL(f_3(x1, x2, x3)) = 0
POL(false) = 0
POL(lt(x1, x2)) = 0
POL(nil) = 0
POL(pair(x1, x2)) = x1 + x2
POL(qsort(x1)) = 0
POL(s(x1)) = 0
POL(split(x1, x2)) = x2
POL(true) = 0
(14) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
S tuples:
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
LT(s(z0), s(z1)) → c2(LT(z0, z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, F_1, QSORT, F_3, SPLIT
Compound Symbols:
c2, c4, c7, c11, c12, c6
(15) CdtKnowledgeProof (EQUIVALENT transformation)
The following tuples could be moved from S to K by knowledge propagation:
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
LT(s(z0), s(z1)) → c2(LT(z0, z1))
(16) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
S tuples:
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
LT(s(z0), s(z1)) → c2(LT(z0, z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, F_1, QSORT, F_3, SPLIT
Compound Symbols:
c2, c4, c7, c11, c12, c6
(17) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
We considered the (Usable) Rules:
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
And the Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(APPEND(x1, x2)) = x1
POL(F_1(x1, x2, x3, x4)) = 0
POL(F_2(x1, x2, x3, x4, x5, x6)) = 0
POL(F_3(x1, x2, x3)) = [2]x1 + [2]x12
POL(LT(x1, x2)) = 0
POL(QSORT(x1)) = [2]x12
POL(SPLIT(x1, x2)) = 0
POL(add(x1, x2)) = [1] + x2
POL(append(x1, x2)) = x1 + x2
POL(c11(x1, x2)) = x1 + x2
POL(c12(x1, x2, x3)) = x1 + x2 + x3
POL(c2(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1, x2)) = x1 + x2
POL(c7(x1, x2)) = x1 + x2
POL(f_1(x1, x2, x3, x4)) = [1] + x1
POL(f_2(x1, x2, x3, x4, x5, x6)) = [1] + x5 + x6
POL(f_3(x1, x2, x3)) = [2] + [2]x1
POL(false) = 0
POL(lt(x1, x2)) = 0
POL(nil) = 0
POL(pair(x1, x2)) = x1 + x2
POL(qsort(x1)) = [2]x1
POL(s(x1)) = 0
POL(split(x1, x2)) = x2
POL(true) = 0
(18) Obligation:
Complexity Dependency Tuples Problem
Rules:
lt(0, s(z0)) → true
lt(s(z0), 0) → false
lt(s(z0), s(z1)) → lt(z0, z1)
append(nil, z0) → z0
append(add(z0, z1), z2) → add(z0, append(z1, z2))
split(z0, nil) → pair(nil, nil)
split(z0, add(z1, z2)) → f_1(split(z0, z2), z0, z1, z2)
f_1(pair(z0, z1), z2, z3, z4) → f_2(lt(z2, z3), z2, z3, z4, z0, z1)
f_2(true, z0, z1, z2, z3, z4) → pair(z3, add(z1, z4))
f_2(false, z0, z1, z2, z3, z4) → pair(add(z1, z3), z4)
qsort(nil) → nil
qsort(add(z0, z1)) → f_3(split(z0, z1), z0, z1)
f_3(pair(z0, z1), z2, z3) → append(qsort(z0), add(z3, qsort(z1)))
Tuples:
LT(s(z0), s(z1)) → c2(LT(z0, z1))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
S tuples:none
K tuples:
F_3(pair(z0, z1), z2, z3) → c12(APPEND(qsort(z0), add(z3, qsort(z1))), QSORT(z0), QSORT(z1))
QSORT(add(z0, z1)) → c11(F_3(split(z0, z1), z0, z1), SPLIT(z0, z1))
LT(s(z0), s(z1)) → c2(LT(z0, z1))
SPLIT(z0, add(x1, nil)) → c6(F_1(pair(nil, nil), z0, x1, nil), SPLIT(z0, nil))
SPLIT(z0, add(x1, add(z1, z2))) → c6(F_1(f_1(split(z0, z2), z0, z1, z2), z0, x1, add(z1, z2)), SPLIT(z0, add(z1, z2)))
F_1(pair(z0, z1), z2, z3, z4) → c7(F_2(lt(z2, z3), z2, z3, z4, z0, z1), LT(z2, z3))
APPEND(add(z0, z1), z2) → c4(APPEND(z1, z2))
Defined Rule Symbols:
lt, append, split, f_1, f_2, qsort, f_3
Defined Pair Symbols:
LT, APPEND, F_1, QSORT, F_3, SPLIT
Compound Symbols:
c2, c4, c7, c11, c12, c6
(19) SIsEmptyProof (EQUIVALENT transformation)
The set S is empty
(20) BOUNDS(O(1), O(1))