(0) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
merge(x, nil) → x
merge(nil, y) → y
merge(++(x, y), ++(u, v)) → ++(x, merge(y, ++(u, v)))
merge(++(x, y), ++(u, v)) → ++(u, merge(++(x, y), v))
Rewrite Strategy: INNERMOST
(1) CpxTrsMatchBoundsTAProof (EQUIVALENT transformation)
A linear upper bound on the runtime complexity of the TRS R could be shown with a Match-Bound[TAB_LEFTLINEAR,TAB_NONLEFTLINEAR] (for contructor-based start-terms) of 1.
The compatible tree automaton used to show the Match-Boundedness (for constructor-based start-terms) is represented by:
final states : [1]
transitions:
nil0() → 0
++0(0, 0) → 0
u0() → 0
v0() → 0
merge0(0, 0) → 1
u1() → 4
v1() → 5
++1(4, 5) → 3
merge1(0, 3) → 2
++1(0, 2) → 1
++1(0, 0) → 7
v1() → 8
merge1(7, 8) → 6
++1(4, 6) → 1
++1(0, 2) → 2
++1(4, 6) → 2
0 → 1
3 → 2
(2) BOUNDS(1, n^1)
(3) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted Cpx (relative) TRS to CDT
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
merge(z0, nil) → z0
merge(nil, z0) → z0
merge(++(z0, z1), ++(u, v)) → ++(z0, merge(z1, ++(u, v)))
merge(++(z0, z1), ++(u, v)) → ++(u, merge(++(z0, z1), v))
Tuples:
MERGE(z0, nil) → c
MERGE(nil, z0) → c1
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
MERGE(++(z0, z1), ++(u, v)) → c3(MERGE(++(z0, z1), v))
S tuples:
MERGE(z0, nil) → c
MERGE(nil, z0) → c1
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
MERGE(++(z0, z1), ++(u, v)) → c3(MERGE(++(z0, z1), v))
K tuples:none
Defined Rule Symbols:
merge
Defined Pair Symbols:
MERGE
Compound Symbols:
c, c1, c2, c3
(5) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)
Removed 3 trailing nodes:
MERGE(nil, z0) → c1
MERGE(++(z0, z1), ++(u, v)) → c3(MERGE(++(z0, z1), v))
MERGE(z0, nil) → c
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
merge(z0, nil) → z0
merge(nil, z0) → z0
merge(++(z0, z1), ++(u, v)) → ++(z0, merge(z1, ++(u, v)))
merge(++(z0, z1), ++(u, v)) → ++(u, merge(++(z0, z1), v))
Tuples:
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
S tuples:
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
K tuples:none
Defined Rule Symbols:
merge
Defined Pair Symbols:
MERGE
Compound Symbols:
c2
(7) CdtUsableRulesProof (EQUIVALENT transformation)
The following rules are not usable and were removed:
merge(z0, nil) → z0
merge(nil, z0) → z0
merge(++(z0, z1), ++(u, v)) → ++(z0, merge(z1, ++(u, v)))
merge(++(z0, z1), ++(u, v)) → ++(u, merge(++(z0, z1), v))
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
S tuples:
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
K tuples:none
Defined Rule Symbols:none
Defined Pair Symbols:
MERGE
Compound Symbols:
c2
(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.
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
We considered the (Usable) Rules:none
And the Tuples:
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(++(x1, x2)) = [1] + x2
POL(MERGE(x1, x2)) = x1
POL(c2(x1)) = x1
POL(u) = 0
POL(v) = 0
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
S tuples:none
K tuples:
MERGE(++(z0, z1), ++(u, v)) → c2(MERGE(z1, ++(u, v)))
Defined Rule Symbols:none
Defined Pair Symbols:
MERGE
Compound Symbols:
c2
(11) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(12) BOUNDS(1, 1)