(0) Obligation:

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

half(0) → 0
half(s(0)) → 0
half(s(s(x))) → s(half(x))
bits(0) → 0
bits(s(x)) → s(bits(half(s(x))))

Rewrite Strategy: INNERMOST

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

Converted Cpx (relative) TRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

half(0) → 0
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
bits(0) → 0
bits(s(z0)) → s(bits(half(s(z0))))
Tuples:

HALF(0) → c
HALF(s(0)) → c1
HALF(s(s(z0))) → c2(HALF(z0))
BITS(0) → c3
BITS(s(z0)) → c4(BITS(half(s(z0))), HALF(s(z0)))
S tuples:

HALF(0) → c
HALF(s(0)) → c1
HALF(s(s(z0))) → c2(HALF(z0))
BITS(0) → c3
BITS(s(z0)) → c4(BITS(half(s(z0))), HALF(s(z0)))
K tuples:none
Defined Rule Symbols:

half, bits

Defined Pair Symbols:

HALF, BITS

Compound Symbols:

c, c1, c2, c3, c4

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

Removed 3 trailing nodes:

BITS(0) → c3
HALF(0) → c
HALF(s(0)) → c1

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

half(0) → 0
half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
bits(0) → 0
bits(s(z0)) → s(bits(half(s(z0))))
Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(z0)) → c4(BITS(half(s(z0))), HALF(s(z0)))
S tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(z0)) → c4(BITS(half(s(z0))), HALF(s(z0)))
K tuples:none
Defined Rule Symbols:

half, bits

Defined Pair Symbols:

HALF, BITS

Compound Symbols:

c2, c4

(5) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

bits(0) → 0
bits(s(z0)) → s(bits(half(s(z0))))

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(z0)) → c4(BITS(half(s(z0))), HALF(s(z0)))
S tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(z0)) → c4(BITS(half(s(z0))), HALF(s(z0)))
K tuples:none
Defined Rule Symbols:

half

Defined Pair Symbols:

HALF, BITS

Compound Symbols:

c2, c4

(7) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace BITS(s(z0)) → c4(BITS(half(s(z0))), HALF(s(z0))) by

BITS(s(0)) → c4(BITS(0), HALF(s(0)))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(0)) → c4(BITS(0), HALF(s(0)))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
S tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(0)) → c4(BITS(0), HALF(s(0)))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
K tuples:none
Defined Rule Symbols:

half

Defined Pair Symbols:

HALF, BITS

Compound Symbols:

c2, c4

(9) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 1 trailing nodes:

BITS(s(0)) → c4(BITS(0), HALF(s(0)))

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
S tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
K tuples:none
Defined Rule Symbols:

half

Defined Pair Symbols:

HALF, BITS

Compound Symbols:

c2, c4

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

BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
We considered the (Usable) Rules:

half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
And the Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(BITS(x1)) = [2]x1   
POL(HALF(x1)) = [1]   
POL(c2(x1)) = x1   
POL(c4(x1, x2)) = x1 + x2   
POL(half(x1)) = x1   
POL(s(x1)) = [2] + x1   

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
S tuples:

HALF(s(s(z0))) → c2(HALF(z0))
K tuples:

BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
Defined Rule Symbols:

half

Defined Pair Symbols:

HALF, BITS

Compound Symbols:

c2, c4

(13) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

HALF(s(s(z0))) → c2(HALF(z0))
We considered the (Usable) Rules:

half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
And the Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = [1]   
POL(BITS(x1)) = [2]x12   
POL(HALF(x1)) = [2] + [3]x1   
POL(c2(x1)) = x1   
POL(c4(x1, x2)) = x1 + x2   
POL(half(x1)) = [1] + x1   
POL(s(x1)) = [2] + x1   

(14) Obligation:

Complexity Dependency Tuples Problem
Rules:

half(s(0)) → 0
half(s(s(z0))) → s(half(z0))
half(0) → 0
Tuples:

HALF(s(s(z0))) → c2(HALF(z0))
BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
S tuples:none
K tuples:

BITS(s(s(z0))) → c4(BITS(s(half(z0))), HALF(s(s(z0))))
HALF(s(s(z0))) → c2(HALF(z0))
Defined Rule Symbols:

half

Defined Pair Symbols:

HALF, BITS

Compound Symbols:

c2, c4

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

The set S is empty

(16) BOUNDS(1, 1)