### (0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

a__and(true, X) → mark(X)
a__and(false, Y) → false
a__if(true, X, Y) → mark(X)
a__if(false, X, Y) → mark(Y)
a__first(0, X) → nil
a__first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
a__from(X) → cons(X, from(s(X)))
mark(and(X1, X2)) → a__and(mark(X1), X2)
mark(if(X1, X2, X3)) → a__if(mark(X1), X2, X3)
mark(first(X1, X2)) → a__first(mark(X1), mark(X2))
mark(from(X)) → a__from(X)
mark(true) → true
mark(false) → false
mark(0) → 0
mark(s(X)) → s(X)
mark(nil) → nil
mark(cons(X1, X2)) → cons(X1, X2)
a__and(X1, X2) → and(X1, X2)
a__if(X1, X2, X3) → if(X1, X2, X3)
a__first(X1, X2) → first(X1, X2)
a__from(X) → from(X)

Rewrite Strategy: INNERMOST

### (1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted Cpx (relative) TRS to CDT

### (2) Obligation:

Complexity Dependency Tuples Problem
Rules:

a__and(true, z0) → mark(z0)
a__and(false, z0) → false
a__and(z0, z1) → and(z0, z1)
a__if(true, z0, z1) → mark(z0)
a__if(false, z0, z1) → mark(z1)
a__if(z0, z1, z2) → if(z0, z1, z2)
a__first(0, z0) → nil
a__first(s(z0), cons(z1, z2)) → cons(z1, first(z0, z2))
a__first(z0, z1) → first(z0, z1)
a__from(z0) → cons(z0, from(s(z0)))
a__from(z0) → from(z0)
mark(and(z0, z1)) → a__and(mark(z0), z1)
mark(if(z0, z1, z2)) → a__if(mark(z0), z1, z2)
mark(first(z0, z1)) → a__first(mark(z0), mark(z1))
mark(from(z0)) → a__from(z0)
mark(true) → true
mark(false) → false
mark(0) → 0
mark(s(z0)) → s(z0)
mark(nil) → nil
mark(cons(z0, z1)) → cons(z0, z1)
Tuples:

A__AND(true, z0) → c(MARK(z0))
A__AND(false, z0) → c1
A__AND(z0, z1) → c2
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
A__IF(z0, z1, z2) → c5
A__FIRST(0, z0) → c9
A__FIRST(s(z0), cons(z1, z2)) → c10
A__FIRST(z0, z1) → c11
A__FROM(z0) → c12
A__FROM(z0) → c13
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(A__FIRST(mark(z0), mark(z1)), MARK(z0), MARK(z1))
MARK(from(z0)) → c18(A__FROM(z0))
MARK(true) → c19
MARK(false) → c20
MARK(0) → c21
MARK(s(z0)) → c22
MARK(nil) → c23
MARK(cons(z0, z1)) → c24
S tuples:

A__AND(true, z0) → c(MARK(z0))
A__AND(false, z0) → c1
A__AND(z0, z1) → c2
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
A__IF(z0, z1, z2) → c5
A__FIRST(0, z0) → c9
A__FIRST(s(z0), cons(z1, z2)) → c10
A__FIRST(z0, z1) → c11
A__FROM(z0) → c12
A__FROM(z0) → c13
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(A__FIRST(mark(z0), mark(z1)), MARK(z0), MARK(z1))
MARK(from(z0)) → c18(A__FROM(z0))
MARK(true) → c19
MARK(false) → c20
MARK(0) → c21
MARK(s(z0)) → c22
MARK(nil) → c23
MARK(cons(z0, z1)) → c24
K tuples:none
Defined Rule Symbols:

a__and, a__if, a__add, a__first, a__from, mark

Defined Pair Symbols:

A__AND, A__IF, A__ADD, A__FIRST, A__FROM, MARK

Compound Symbols:

c, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24

### (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 17 trailing nodes:

A__FIRST(z0, z1) → c11
A__IF(z0, z1, z2) → c5
A__FROM(z0) → c12
A__FIRST(0, z0) → c9
MARK(true) → c19
A__FROM(z0) → c13
A__FIRST(s(z0), cons(z1, z2)) → c10
A__AND(false, z0) → c1
MARK(cons(z0, z1)) → c24
MARK(0) → c21
MARK(from(z0)) → c18(A__FROM(z0))
MARK(nil) → c23
MARK(s(z0)) → c22
A__AND(z0, z1) → c2
MARK(false) → c20

### (4) Obligation:

Complexity Dependency Tuples Problem
Rules:

a__and(true, z0) → mark(z0)
a__and(false, z0) → false
a__and(z0, z1) → and(z0, z1)
a__if(true, z0, z1) → mark(z0)
a__if(false, z0, z1) → mark(z1)
a__if(z0, z1, z2) → if(z0, z1, z2)
a__first(0, z0) → nil
a__first(s(z0), cons(z1, z2)) → cons(z1, first(z0, z2))
a__first(z0, z1) → first(z0, z1)
a__from(z0) → cons(z0, from(s(z0)))
a__from(z0) → from(z0)
mark(and(z0, z1)) → a__and(mark(z0), z1)
mark(if(z0, z1, z2)) → a__if(mark(z0), z1, z2)
mark(first(z0, z1)) → a__first(mark(z0), mark(z1))
mark(from(z0)) → a__from(z0)
mark(true) → true
mark(false) → false
mark(0) → 0
mark(s(z0)) → s(z0)
mark(nil) → nil
mark(cons(z0, z1)) → cons(z0, z1)
Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(A__FIRST(mark(z0), mark(z1)), MARK(z0), MARK(z1))
S tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(A__FIRST(mark(z0), mark(z1)), MARK(z0), MARK(z1))
K tuples:none
Defined Rule Symbols:

a__and, a__if, a__add, a__first, a__from, mark

Defined Pair Symbols:

Compound Symbols:

c, c3, c4, c6, c14, c15, c16, c17

### (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID) transformation)

Removed 1 trailing tuple parts

### (6) Obligation:

Complexity Dependency Tuples Problem
Rules:

a__and(true, z0) → mark(z0)
a__and(false, z0) → false
a__and(z0, z1) → and(z0, z1)
a__if(true, z0, z1) → mark(z0)
a__if(false, z0, z1) → mark(z1)
a__if(z0, z1, z2) → if(z0, z1, z2)
a__first(0, z0) → nil
a__first(s(z0), cons(z1, z2)) → cons(z1, first(z0, z2))
a__first(z0, z1) → first(z0, z1)
a__from(z0) → cons(z0, from(s(z0)))
a__from(z0) → from(z0)
mark(and(z0, z1)) → a__and(mark(z0), z1)
mark(if(z0, z1, z2)) → a__if(mark(z0), z1, z2)
mark(first(z0, z1)) → a__first(mark(z0), mark(z1))
mark(from(z0)) → a__from(z0)
mark(true) → true
mark(false) → false
mark(0) → 0
mark(s(z0)) → s(z0)
mark(nil) → nil
mark(cons(z0, z1)) → cons(z0, z1)
Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
S tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
K tuples:none
Defined Rule Symbols:

a__and, a__if, a__add, a__first, a__from, mark

Defined Pair Symbols:

Compound Symbols:

c, c3, c4, c6, c14, c15, c16, c17

### (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.

A__AND(true, z0) → c(MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
We considered the (Usable) Rules:none
And the Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0
POL(A__AND(x1, x2)) = [4] + [4]x2
POL(A__IF(x1, x2, x3)) = [4]x2 + [4]x3
POL(MARK(x1)) = [4]x1
POL(a__add(x1, x2)) = [3] + [3]x2
POL(a__and(x1, x2)) = [5] + [5]x1 + [3]x2
POL(a__first(x1, x2)) = [3] + [3]x1
POL(a__from(x1)) = [2] + [5]x1
POL(a__if(x1, x2, x3)) = [3] + [3]x1 + [2]x2 + [5]x3
POL(add(x1, x2)) = x1 + x2
POL(and(x1, x2)) = [1] + x1 + x2
POL(c(x1)) = x1
POL(c14(x1, x2)) = x1 + x2
POL(c15(x1, x2)) = x1 + x2
POL(c16(x1, x2)) = x1 + x2
POL(c17(x1, x2)) = x1 + x2
POL(c3(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1)) = x1
POL(cons(x1, x2)) = [3]
POL(false) = 0
POL(first(x1, x2)) = [5] + x1 + x2
POL(from(x1)) = [3]
POL(if(x1, x2, x3)) = x1 + x2 + x3
POL(mark(x1)) = x1
POL(nil) = [5]
POL(s(x1)) = [3]
POL(true) = 0

### (8) Obligation:

Complexity Dependency Tuples Problem
Rules:

a__and(true, z0) → mark(z0)
a__and(false, z0) → false
a__and(z0, z1) → and(z0, z1)
a__if(true, z0, z1) → mark(z0)
a__if(false, z0, z1) → mark(z1)
a__if(z0, z1, z2) → if(z0, z1, z2)
a__first(0, z0) → nil
a__first(s(z0), cons(z1, z2)) → cons(z1, first(z0, z2))
a__first(z0, z1) → first(z0, z1)
a__from(z0) → cons(z0, from(s(z0)))
a__from(z0) → from(z0)
mark(and(z0, z1)) → a__and(mark(z0), z1)
mark(if(z0, z1, z2)) → a__if(mark(z0), z1, z2)
mark(first(z0, z1)) → a__first(mark(z0), mark(z1))
mark(from(z0)) → a__from(z0)
mark(true) → true
mark(false) → false
mark(0) → 0
mark(s(z0)) → s(z0)
mark(nil) → nil
mark(cons(z0, z1)) → cons(z0, z1)
Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
S tuples:

A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
K tuples:

A__AND(true, z0) → c(MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
Defined Rule Symbols:

a__and, a__if, a__add, a__first, a__from, mark

Defined Pair Symbols:

Compound Symbols:

c, c3, c4, c6, c14, c15, c16, c17

### (9) 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.

A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
We considered the (Usable) Rules:none
And the Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0
POL(A__AND(x1, x2)) = [4]x2
POL(A__IF(x1, x2, x3)) = [2] + [4]x2 + [4]x3
POL(MARK(x1)) = [4]x1
POL(a__add(x1, x2)) = [5] + [5]x2
POL(a__and(x1, x2)) = [3] + [5]x1 + [2]x2
POL(a__first(x1, x2)) = [3] + [3]x1 + x2
POL(a__from(x1)) = [3] + [3]x1
POL(a__if(x1, x2, x3)) = [3] + [3]x1 + [4]x2 + [3]x3
POL(add(x1, x2)) = x1 + x2
POL(and(x1, x2)) = [4] + x1 + x2
POL(c(x1)) = x1
POL(c14(x1, x2)) = x1 + x2
POL(c15(x1, x2)) = x1 + x2
POL(c16(x1, x2)) = x1 + x2
POL(c17(x1, x2)) = x1 + x2
POL(c3(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1)) = x1
POL(cons(x1, x2)) = [3]
POL(false) = 0
POL(first(x1, x2)) = [1] + x1 + x2
POL(from(x1)) = [3]
POL(if(x1, x2, x3)) = [4] + x1 + x2 + x3
POL(mark(x1)) = [3]x1
POL(nil) = [3]
POL(s(x1)) = [3]
POL(true) = 0

### (10) Obligation:

Complexity Dependency Tuples Problem
Rules:

a__and(true, z0) → mark(z0)
a__and(false, z0) → false
a__and(z0, z1) → and(z0, z1)
a__if(true, z0, z1) → mark(z0)
a__if(false, z0, z1) → mark(z1)
a__if(z0, z1, z2) → if(z0, z1, z2)
a__first(0, z0) → nil
a__first(s(z0), cons(z1, z2)) → cons(z1, first(z0, z2))
a__first(z0, z1) → first(z0, z1)
a__from(z0) → cons(z0, from(s(z0)))
a__from(z0) → from(z0)
mark(and(z0, z1)) → a__and(mark(z0), z1)
mark(if(z0, z1, z2)) → a__if(mark(z0), z1, z2)
mark(first(z0, z1)) → a__first(mark(z0), mark(z1))
mark(from(z0)) → a__from(z0)
mark(true) → true
mark(false) → false
mark(0) → 0
mark(s(z0)) → s(z0)
mark(nil) → nil
mark(cons(z0, z1)) → cons(z0, z1)
Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
S tuples:

K tuples:

A__AND(true, z0) → c(MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
Defined Rule Symbols:

a__and, a__if, a__add, a__first, a__from, mark

Defined Pair Symbols:

Compound Symbols:

c, c3, c4, c6, c14, c15, c16, c17

### (11) 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.

We considered the (Usable) Rules:none
And the Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0
POL(A__AND(x1, x2)) = [3] + [4]x2
POL(A__IF(x1, x2, x3)) = [4] + [4]x2 + [4]x3
POL(MARK(x1)) = [4]x1
POL(a__add(x1, x2)) = [4] + [2]x1 + [3]x2
POL(a__and(x1, x2)) = [5] + [3]x1 + [3]x2
POL(a__first(x1, x2)) = [2] + [2]x1 + [2]x2
POL(a__from(x1)) = [3] + [3]x1
POL(a__if(x1, x2, x3)) = [4] + [3]x1 + [2]x2 + [4]x3
POL(add(x1, x2)) = [4] + x1 + x2
POL(and(x1, x2)) = [1] + x1 + x2
POL(c(x1)) = x1
POL(c14(x1, x2)) = x1 + x2
POL(c15(x1, x2)) = x1 + x2
POL(c16(x1, x2)) = x1 + x2
POL(c17(x1, x2)) = x1 + x2
POL(c3(x1)) = x1
POL(c4(x1)) = x1
POL(c6(x1)) = x1
POL(cons(x1, x2)) = [2]
POL(false) = [2]
POL(first(x1, x2)) = x1 + x2
POL(from(x1)) = [3]
POL(if(x1, x2, x3)) = [1] + x1 + x2 + x3
POL(mark(x1)) = 0
POL(nil) = [5]
POL(s(x1)) = [3]
POL(true) = [4]

### (12) Obligation:

Complexity Dependency Tuples Problem
Rules:

a__and(true, z0) → mark(z0)
a__and(false, z0) → false
a__and(z0, z1) → and(z0, z1)
a__if(true, z0, z1) → mark(z0)
a__if(false, z0, z1) → mark(z1)
a__if(z0, z1, z2) → if(z0, z1, z2)
a__first(0, z0) → nil
a__first(s(z0), cons(z1, z2)) → cons(z1, first(z0, z2))
a__first(z0, z1) → first(z0, z1)
a__from(z0) → cons(z0, from(s(z0)))
a__from(z0) → from(z0)
mark(and(z0, z1)) → a__and(mark(z0), z1)
mark(if(z0, z1, z2)) → a__if(mark(z0), z1, z2)
mark(first(z0, z1)) → a__first(mark(z0), mark(z1))
mark(from(z0)) → a__from(z0)
mark(true) → true
mark(false) → false
mark(0) → 0
mark(s(z0)) → s(z0)
mark(nil) → nil
mark(cons(z0, z1)) → cons(z0, z1)
Tuples:

A__AND(true, z0) → c(MARK(z0))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
S tuples:

K tuples:

A__AND(true, z0) → c(MARK(z0))
MARK(first(z0, z1)) → c17(MARK(z0), MARK(z1))
A__IF(true, z0, z1) → c3(MARK(z0))
A__IF(false, z0, z1) → c4(MARK(z1))
MARK(and(z0, z1)) → c14(A__AND(mark(z0), z1), MARK(z0))
MARK(if(z0, z1, z2)) → c15(A__IF(mark(z0), z1, z2), MARK(z0))
Defined Rule Symbols:

a__and, a__if, a__add, a__first, a__from, mark

Defined Pair Symbols:

Compound Symbols:

c, c3, c4, c6, c14, c15, c16, c17

### (13) CdtKnowledgeProof (EQUIVALENT transformation)

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