### (0) Obligation:

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

-(0, y) → 0
-(x, 0) → x
-(x, s(y)) → if(greater(x, s(y)), s(-(x, p(s(y)))), 0)
p(0) → 0
p(s(x)) → x

Rewrite Strategy: INNERMOST

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

Converted Cpx (relative) TRS to CDT

### (2) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(0, z0) → 0
-(z0, 0) → z0
-(z0, s(z1)) → if(greater(z0, s(z1)), s(-(z0, p(s(z1)))), 0)
p(0) → 0
p(s(z0)) → z0
Tuples:

-'(0, z0) → c
-'(z0, 0) → c1
-'(z0, s(z1)) → c2(-'(z0, p(s(z1))), P(s(z1)))
P(0) → c3
P(s(z0)) → c4
S tuples:

-'(0, z0) → c
-'(z0, 0) → c1
-'(z0, s(z1)) → c2(-'(z0, p(s(z1))), P(s(z1)))
P(0) → c3
P(s(z0)) → c4
K tuples:none
Defined Rule Symbols:

-, p

Defined Pair Symbols:

-', P

Compound Symbols:

c, c1, c2, c3, c4

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

Removed 4 trailing nodes:

-'(0, z0) → c
-'(z0, 0) → c1
P(0) → c3
P(s(z0)) → c4

### (4) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(0, z0) → 0
-(z0, 0) → z0
-(z0, s(z1)) → if(greater(z0, s(z1)), s(-(z0, p(s(z1)))), 0)
p(0) → 0
p(s(z0)) → z0
Tuples:

-'(z0, s(z1)) → c2(-'(z0, p(s(z1))), P(s(z1)))
S tuples:

-'(z0, s(z1)) → c2(-'(z0, p(s(z1))), P(s(z1)))
K tuples:none
Defined Rule Symbols:

-, p

Defined Pair Symbols:

-'

Compound Symbols:

c2

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

Removed 1 trailing tuple parts

### (6) Obligation:

Complexity Dependency Tuples Problem
Rules:

-(0, z0) → 0
-(z0, 0) → z0
-(z0, s(z1)) → if(greater(z0, s(z1)), s(-(z0, p(s(z1)))), 0)
p(0) → 0
p(s(z0)) → z0
Tuples:

-'(z0, s(z1)) → c2(-'(z0, p(s(z1))))
S tuples:

-'(z0, s(z1)) → c2(-'(z0, p(s(z1))))
K tuples:none
Defined Rule Symbols:

-, p

Defined Pair Symbols:

-'

Compound Symbols:

c2

### (7) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

-(0, z0) → 0
-(z0, 0) → z0
-(z0, s(z1)) → if(greater(z0, s(z1)), s(-(z0, p(s(z1)))), 0)
p(0) → 0

### (8) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(s(z0)) → z0
Tuples:

-'(z0, s(z1)) → c2(-'(z0, p(s(z1))))
S tuples:

-'(z0, s(z1)) → c2(-'(z0, p(s(z1))))
K tuples:none
Defined Rule Symbols:

p

Defined Pair Symbols:

-'

Compound Symbols:

c2

### (9) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace -'(z0, s(z1)) → c2(-'(z0, p(s(z1)))) by

-'(x0, s(z0)) → c2(-'(x0, z0))

### (10) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(s(z0)) → z0
Tuples:

-'(x0, s(z0)) → c2(-'(x0, z0))
S tuples:

-'(x0, s(z0)) → c2(-'(x0, z0))
K tuples:none
Defined Rule Symbols:

p

Defined Pair Symbols:

-'

Compound Symbols:

c2

### (11) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

p(s(z0)) → z0

### (12) Obligation:

Complexity Dependency Tuples Problem
Rules:none
Tuples:

-'(x0, s(z0)) → c2(-'(x0, z0))
S tuples:

-'(x0, s(z0)) → c2(-'(x0, z0))
K tuples:none
Defined Rule Symbols:none

Defined Pair Symbols:

-'

Compound Symbols:

c2

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

-'(x0, s(z0)) → c2(-'(x0, z0))
We considered the (Usable) Rules:none
And the Tuples:

-'(x0, s(z0)) → c2(-'(x0, z0))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(-'(x1, x2)) = [5]x2
POL(c2(x1)) = x1
POL(s(x1)) = [1] + x1

### (14) Obligation:

Complexity Dependency Tuples Problem
Rules:none
Tuples:

-'(x0, s(z0)) → c2(-'(x0, z0))
S tuples:none
K tuples:

-'(x0, s(z0)) → c2(-'(x0, z0))
Defined Rule Symbols:none

Defined Pair Symbols:

-'

Compound Symbols:

c2

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

The set S is empty