(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:

merge(Cons(x, xs), Nil) → Cons(x, xs)
merge(Cons(x', xs'), Cons(x, xs)) → merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs))
merge(Nil, ys) → ys
goal(xs, ys) → merge(xs, ys)

The (relative) TRS S consists of the following rules:

<=(S(x), S(y)) → <=(x, y)
<=(0, y) → True
<=(S(x), 0) → False
merge[Ite](False, xs', Cons(x, xs)) → Cons(x, merge(xs', xs))
merge[Ite](True, Cons(x, xs), ys) → Cons(x, merge(xs, ys))

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:

merge(Cons(x, xs), Nil) → Cons(x, xs)
merge(Cons(x', xs'), Cons(x, xs)) → merge[Ite](<=(x', x), Cons(x', xs'), Cons(x, xs))
merge(Nil, ys) → ys
goal(xs, ys) → merge(xs, ys)
<=(S(x), S(y)) → <=(x, y)
<=(0, y) → True
<=(S(x), 0) → False
merge[Ite](False, xs', Cons(x, xs)) → Cons(x, merge(xs', xs))
merge[Ite](True, Cons(x, xs), ys) → Cons(x, merge(xs, ys))

Rewrite Strategy: INNERMOST

(3) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted Cpx (relative) TRS to CDT

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

merge(Cons(z0, z1), Nil) → Cons(z0, z1)
merge(Cons(z0, z1), Cons(z2, z3)) → merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3))
merge(Nil, z0) → z0
goal(z0, z1) → merge(z0, z1)
<=(S(z0), S(z1)) → <=(z0, z1)
<=(0, z0) → True
<=(S(z0), 0) → False
merge[Ite](False, z0, Cons(z1, z2)) → Cons(z1, merge(z0, z2))
merge[Ite](True, Cons(z0, z1), z2) → Cons(z0, merge(z1, z2))
Tuples:

MERGE(Cons(z0, z1), Nil) → c
MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
MERGE(Nil, z0) → c2
GOAL(z0, z1) → c3(MERGE(z0, z1))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
<='(0, z0) → c5
<='(S(z0), 0) → c6
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
S tuples:

MERGE(Cons(z0, z1), Nil) → c
MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
MERGE(Nil, z0) → c2
GOAL(z0, z1) → c3(MERGE(z0, z1))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
<='(0, z0) → c5
<='(S(z0), 0) → c6
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
K tuples:none
Defined Rule Symbols:

merge, goal, <=, merge[Ite]

Defined Pair Symbols:

MERGE, GOAL, <=', MERGE[ITE]

Compound Symbols:

c, c1, c2, c3, c4, c5, c6, c7, c8

(5) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)

Removed 1 leading nodes:

GOAL(z0, z1) → c3(MERGE(z0, z1))
Removed 4 trailing nodes:

MERGE(Cons(z0, z1), Nil) → c
<='(S(z0), 0) → c6
<='(0, z0) → c5
MERGE(Nil, z0) → c2

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

merge(Cons(z0, z1), Nil) → Cons(z0, z1)
merge(Cons(z0, z1), Cons(z2, z3)) → merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3))
merge(Nil, z0) → z0
goal(z0, z1) → merge(z0, z1)
<=(S(z0), S(z1)) → <=(z0, z1)
<=(0, z0) → True
<=(S(z0), 0) → False
merge[Ite](False, z0, Cons(z1, z2)) → Cons(z1, merge(z0, z2))
merge[Ite](True, Cons(z0, z1), z2) → Cons(z0, merge(z1, z2))
Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
S tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
K tuples:none
Defined Rule Symbols:

merge, goal, <=, merge[Ite]

Defined Pair Symbols:

MERGE, <=', MERGE[ITE]

Compound Symbols:

c1, c4, c7, c8

(7) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

merge(Cons(z0, z1), Nil) → Cons(z0, z1)
merge(Cons(z0, z1), Cons(z2, z3)) → merge[Ite](<=(z0, z2), Cons(z0, z1), Cons(z2, z3))
merge(Nil, z0) → z0
goal(z0, z1) → merge(z0, z1)
merge[Ite](False, z0, Cons(z1, z2)) → Cons(z1, merge(z0, z2))
merge[Ite](True, Cons(z0, z1), z2) → Cons(z0, merge(z1, z2))

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

<=(S(z0), S(z1)) → <=(z0, z1)
<=(0, z0) → True
<=(S(z0), 0) → False
Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
S tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
K tuples:none
Defined Rule Symbols:

<=

Defined Pair Symbols:

MERGE, <=', MERGE[ITE]

Compound Symbols:

c1, c4, c7, c8

(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[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
We considered the (Usable) Rules:none
And the Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, 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] + x2   
POL(False) = 0   
POL(MERGE(x1, x2)) = x2   
POL(MERGE[ITE](x1, x2, x3)) = x3   
POL(S(x1)) = 0   
POL(True) = 0   
POL(c1(x1, x2)) = x1 + x2   
POL(c4(x1)) = x1   
POL(c7(x1)) = x1   
POL(c8(x1)) = x1   

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

<=(S(z0), S(z1)) → <=(z0, z1)
<=(0, z0) → True
<=(S(z0), 0) → False
Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
S tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
K tuples:

MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
Defined Rule Symbols:

<=

Defined Pair Symbols:

MERGE, <=', MERGE[ITE]

Compound Symbols:

c1, c4, c7, c8

(11) 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[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
We considered the (Usable) Rules:none
And the Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(<=(x1, x2)) = [1]   
POL(<='(x1, x2)) = 0   
POL(Cons(x1, x2)) = [1] + x2   
POL(False) = 0   
POL(MERGE(x1, x2)) = x1 + x2   
POL(MERGE[ITE](x1, x2, x3)) = x2 + x3   
POL(S(x1)) = 0   
POL(True) = 0   
POL(c1(x1, x2)) = x1 + x2   
POL(c4(x1)) = x1   
POL(c7(x1)) = x1   
POL(c8(x1)) = x1   

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

<=(S(z0), S(z1)) → <=(z0, z1)
<=(0, z0) → True
<=(S(z0), 0) → False
Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
S tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
K tuples:

MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
Defined Rule Symbols:

<=

Defined Pair Symbols:

MERGE, <=', MERGE[ITE]

Compound Symbols:

c1, c4, c7, c8

(13) CdtKnowledgeProof (BOTH BOUNDS(ID, ID) transformation)

The following tuples could be moved from S to K by knowledge propagation:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))

(14) Obligation:

Complexity Dependency Tuples Problem
Rules:

<=(S(z0), S(z1)) → <=(z0, z1)
<=(0, z0) → True
<=(S(z0), 0) → False
Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
S tuples:

<='(S(z0), S(z1)) → c4(<='(z0, z1))
K tuples:

MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
Defined Rule Symbols:

<=

Defined Pair Symbols:

MERGE, <=', MERGE[ITE]

Compound Symbols:

c1, c4, c7, c8

(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:none
And the Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(<=(x1, x2)) = 0   
POL(<='(x1, x2)) = x1   
POL(Cons(x1, x2)) = [1] + x1 + x2   
POL(False) = 0   
POL(MERGE(x1, x2)) = x1 + x1·x2 + x12   
POL(MERGE[ITE](x1, x2, x3)) = x2·x3 + x22   
POL(S(x1)) = [2] + x1   
POL(True) = 0   
POL(c1(x1, x2)) = x1 + x2   
POL(c4(x1)) = x1   
POL(c7(x1)) = x1   
POL(c8(x1)) = x1   

(16) Obligation:

Complexity Dependency Tuples Problem
Rules:

<=(S(z0), S(z1)) → <=(z0, z1)
<=(0, z0) → True
<=(S(z0), 0) → False
Tuples:

MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
S tuples:none
K tuples:

MERGE[ITE](False, z0, Cons(z1, z2)) → c7(MERGE(z0, z2))
MERGE[ITE](True, Cons(z0, z1), z2) → c8(MERGE(z1, z2))
MERGE(Cons(z0, z1), Cons(z2, z3)) → c1(MERGE[ITE](<=(z0, z2), Cons(z0, z1), Cons(z2, z3)), <='(z0, z2))
<='(S(z0), S(z1)) → c4(<='(z0, z1))
Defined Rule Symbols:

<=

Defined Pair Symbols:

MERGE, <=', MERGE[ITE]

Compound Symbols:

c1, c4, c7, c8

(17) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)

The set S is empty

(18) BOUNDS(1, 1)