### (0) Obligation:

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

nonZero(0) → false
nonZero(s(x)) → true
p(0) → 0
p(s(x)) → x
id_inc(x) → x
id_inc(x) → s(x)
random(x) → rand(x, 0)
rand(x, y) → if(nonZero(x), x, y)
if(false, x, y) → y
if(true, x, y) → rand(p(x), id_inc(y))

Rewrite Strategy: INNERMOST

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

Converted Cpx (relative) TRS to CDT

### (2) Obligation:

Complexity Dependency Tuples Problem
Rules:

nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:

NONZERO(0) → c
NONZERO(s(z0)) → c1
P(0) → c2
P(s(z0)) → c3
ID_INC(z0) → c4
ID_INC(z0) → c5
RANDOM(z0) → c6(RAND(z0, 0))
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(false, z0, z1) → c8
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
S tuples:

NONZERO(0) → c
NONZERO(s(z0)) → c1
P(0) → c2
P(s(z0)) → c3
ID_INC(z0) → c4
ID_INC(z0) → c5
RANDOM(z0) → c6(RAND(z0, 0))
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(false, z0, z1) → c8
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
K tuples:none
Defined Rule Symbols:

nonZero, p, id_inc, random, rand, if

Defined Pair Symbols:

NONZERO, P, ID_INC, RANDOM, RAND, IF

Compound Symbols:

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

### (3) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)

Removed 1 leading nodes:

RANDOM(z0) → c6(RAND(z0, 0))
Removed 7 trailing nodes:

NONZERO(0) → c
NONZERO(s(z0)) → c1
ID_INC(z0) → c5
P(0) → c2
P(s(z0)) → c3
ID_INC(z0) → c4
IF(false, z0, z1) → c8

### (4) Obligation:

Complexity Dependency Tuples Problem
Rules:

nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:

RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
S tuples:

RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
K tuples:none
Defined Rule Symbols:

nonZero, p, id_inc, random, rand, if

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

Removed 3 trailing tuple parts

### (6) Obligation:

Complexity Dependency Tuples Problem
Rules:

nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:

RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
S tuples:

RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
K tuples:none
Defined Rule Symbols:

nonZero, p, id_inc, random, rand, if

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

### (7) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))

### (8) Obligation:

Complexity Dependency Tuples Problem
Rules:

nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
S tuples:

RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
K tuples:none
Defined Rule Symbols:

nonZero, p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

Use narrowing to replace RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1)) by

RAND(0, x1) → c7(IF(false, 0, x1))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))

### (10) Obligation:

Complexity Dependency Tuples Problem
Rules:

nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(0, x1) → c7(IF(false, 0, x1))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
S tuples:

IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(0, x1) → c7(IF(false, 0, x1))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
K tuples:none
Defined Rule Symbols:

nonZero, p, id_inc

Defined Pair Symbols:

IF, RAND

Compound Symbols:

c9, c7

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

Removed 1 trailing nodes:

RAND(0, x1) → c7(IF(false, 0, x1))

### (12) Obligation:

Complexity Dependency Tuples Problem
Rules:

nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
S tuples:

IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
K tuples:none
Defined Rule Symbols:

nonZero, p, id_inc

Defined Pair Symbols:

IF, RAND

Compound Symbols:

c9, c7

### (13) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

nonZero(0) → false
nonZero(s(z0)) → true

### (14) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
S tuples:

IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
K tuples:none
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

IF, RAND

Compound Symbols:

c9, c7

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

Use narrowing to replace IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1))) by

IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))

### (16) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
K tuples:none
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

Removed 1 trailing nodes:

IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))

### (18) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
K tuples:none
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
We considered the (Usable) Rules:

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

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0
POL(IF(x1, x2, x3)) = [3]x1 + x2
POL(RAND(x1, x2)) = x1
POL(c7(x1)) = x1
POL(c9(x1)) = x1
POL(id_inc(x1)) = [2] + [2]x1
POL(p(x1)) = x1
POL(s(x1)) = [1] + x1
POL(true) = 0

### (20) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

Use narrowing to replace IF(true, x0, z0) → c9(RAND(p(x0), z0)) by

IF(true, 0, x1) → c9(RAND(0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, x1))

### (22) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, 0, x1) → c9(RAND(0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

Removed 1 trailing nodes:

IF(true, 0, x1) → c9(RAND(0, x1))

### (24) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

IF(true, s(z0), x1) → c9(RAND(z0, x1))
We considered the (Usable) Rules:

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

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = [3]
POL(IF(x1, x2, x3)) = [3]x1 + [2]x2
POL(RAND(x1, x2)) = [2]x1
POL(c7(x1)) = x1
POL(c9(x1)) = x1
POL(id_inc(x1)) = [5] + [2]x1
POL(p(x1)) = x1
POL(s(x1)) = [2] + x1
POL(true) = 0

### (26) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

Use narrowing to replace IF(true, x0, z0) → c9(RAND(p(x0), s(z0))) by

IF(true, 0, x1) → c9(RAND(0, s(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))

### (28) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, 0, x1) → c9(RAND(0, s(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, 0, x1) → c9(RAND(0, s(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

Removed 1 trailing nodes:

IF(true, 0, x1) → c9(RAND(0, s(x1)))

### (30) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
Defined Rule Symbols:

p, id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

### (31) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

p(0) → 0
p(s(z0)) → z0

### (32) Obligation:

Complexity Dependency Tuples Problem
Rules:

id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
Defined Rule Symbols:

id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

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

IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
We considered the (Usable) Rules:none
And the Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(IF(x1, x2, x3)) = [3]x1 + [4]x2
POL(RAND(x1, x2)) = [4]x1
POL(c7(x1)) = x1
POL(c9(x1)) = x1
POL(id_inc(x1)) = [2] + [3]x1
POL(s(x1)) = [2] + x1
POL(true) = 0

### (34) Obligation:

Complexity Dependency Tuples Problem
Rules:

id_inc(z0) → z0
id_inc(z0) → s(z0)
Tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
S tuples:

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
K tuples:

IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
Defined Rule Symbols:

id_inc

Defined Pair Symbols:

RAND, IF

Compound Symbols:

c7, c9

### (35) CdtKnowledgeProof (EQUIVALENT transformation)

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

RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
Now S is empty