The rewrite relation of the following TRS is considered.
nonZero(0) | → | false | (1) |
nonZero(s(x)) | → | true | (2) |
p(0) | → | 0 | (3) |
p(s(x)) | → | x | (4) |
id_inc(x) | → | x | (5) |
id_inc(x) | → | s(x) | (6) |
random(x) | → | rand(x,0) | (7) |
rand(x,y) | → | if(nonZero(x),x,y) | (8) |
if(false,x,y) | → | y | (9) |
if(true,x,y) | → | rand(p(x),id_inc(y)) | (10) |
random#(x) | → | rand#(x,0) | (11) |
rand#(x,y) | → | if#(nonZero(x),x,y) | (12) |
rand#(x,y) | → | nonZero#(x) | (13) |
if#(true,x,y) | → | rand#(p(x),id_inc(y)) | (14) |
if#(true,x,y) | → | p#(x) | (15) |
if#(true,x,y) | → | id_inc#(y) | (16) |
The dependency pairs are split into 1 component.
if#(true,x,y) | → | rand#(p(x),id_inc(y)) | (14) |
rand#(x,y) | → | if#(nonZero(x),x,y) | (12) |
[if#(x1, x2, x3)] | = | 0 + 1/4 · x1 + 2 · x2 + 0 · x3 |
[true] | = | 1 |
[rand#(x1, x2)] | = | 1/4 + 4 · x1 + 0 · x2 |
[p(x1)] | = | 0 + 1/4 · x1 |
[id_inc(x1)] | = | 0 + 0 · x1 |
[nonZero(x1)] | = | 0 + 4 · x1 |
[0] | = | 0 |
[s(x1)] | = | 1/2 + 4 · x1 |
[false] | = | 0 |
p(0) | → | 0 | (3) |
p(s(x)) | → | x | (4) |
nonZero(0) | → | false | (1) |
nonZero(s(x)) | → | true | (2) |
rand#(x,y) | → | if#(nonZero(x),x,y) | (12) |
[p(x1)] | = | 1 · x1 |
[0] | = | 0 |
[s(x1)] | = | 1 · x1 |
[id_inc(x1)] | = | 1 · x1 |
[true] | = | 0 |
[rand#(x1, x2)] | = | 1 · x1 + 1 · x2 |
[if#(x1, x2, x3)] | = | 1 · x1 + 1 · x2 + 1 · x3 |
p(0) | → | 0 | (3) |
p(s(x)) | → | x | (4) |
id_inc(x) | → | x | (5) |
id_inc(x) | → | s(x) | (6) |
[p(x1)] | = | 2 + 2 · x1 |
[0] | = | 2 |
[s(x1)] | = | 2 + 1 · x1 |
[id_inc(x1)] | = | 2 + 1 · x1 |
[if#(x1, x2, x3)] | = | 2 + 2 · x1 + 2 · x2 + 1 · x3 |
[true] | = | 2 |
[rand#(x1, x2)] | = | 2 + 1 · x1 + 1 · x2 |
p(0) | → | 0 | (3) |
p(s(x)) | → | x | (4) |
id_inc(x) | → | x | (5) |
id_inc(x) | → | s(x) | (6) |
if#(true,x,y) | → | rand#(p(x),id_inc(y)) | (14) |
p(0) | → | 0 | (3) |
p(s(x)) | → | x | (4) |
id_inc(x) | → | x | (5) |
There are no pairs anymore.