(0) Obligation:

Q restricted rewrite system:
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))

Q is empty.

(1) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(2) Obligation:

Q DP problem:
The TRS P consists of the following rules:

RANDOM(x) → RAND(x, 0)
RAND(x, y) → IF(nonZero(x), x, y)
RAND(x, y) → NONZERO(x)
IF(true, x, y) → RAND(p(x), id_inc(y))
IF(true, x, y) → P(x)
IF(true, x, y) → ID_INC(y)

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))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(3) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 4 less nodes.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

IF(true, x, y) → RAND(p(x), id_inc(y))
RAND(x, y) → IF(nonZero(x), x, y)

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))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(5) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


IF(true, x, y) → RAND(p(x), id_inc(y))
RAND(x, y) → IF(nonZero(x), x, y)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO,RATPOLO]:

POL(IF(x1, x2, x3)) = 5/4 + (4)x1 + x2   
POL(true) = 11/4   
POL(RAND(x1, x2)) = 3 + (4)x1   
POL(p(x1)) = (1/4)x1   
POL(id_inc(x1)) = (1/4)x1   
POL(nonZero(x1)) = 1/4 + (3/4)x1   
POL(0) = 0   
POL(s(x1)) = 15/4 + (4)x1   
POL(false) = 1/4   
The value of delta used in the strict ordering is 3/4.
The following usable rules [FROCOS05] were oriented:

p(0) → 0
p(s(x)) → x
nonZero(0) → false
nonZero(s(x)) → true

(6) Obligation:

Q DP problem:
P is empty.
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))

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(7) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(8) TRUE