The rewrite relation of the following TRS is considered.
f(0) | → | true | (1) |
f(1) | → | false | (2) |
f(s(x)) | → | f(x) | (3) |
if(true,s(x),s(y)) | → | s(x) | (4) |
if(false,s(x),s(y)) | → | s(y) | (5) |
g(x,c(y)) | → | c(g(x,y)) | (6) |
g(x,c(y)) | → | g(x,if(f(x),c(g(s(x),y)),c(y))) | (7) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
f#(0) |
f#(1) |
f#(s(z0)) |
if#(true,s(z0),s(z1)) |
if#(false,s(z0),s(z1)) |
g#(z0,c(z1)) |
g#(z0,c(z1)) |
if(true,s(z0),s(z1)) | → | s(z0) | (12) |
if(false,s(z0),s(z1)) | → | s(z1) | (14) |
if#(true,s(z0),s(z1)) | → | c4 | (13) |
if#(false,s(z0),s(z1)) | → | c5 | (15) |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1,...,x4)] | = | 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 |
[f(x1)] | = | 0 |
[g(x1, x2)] | = | 0 |
[f#(x1)] | = | 0 |
[if#(x1, x2, x3)] | = | 1 · x3 + 0 |
[g#(x1, x2)] | = | 0 |
[0] | = | 1 |
[true] | = | 1 |
[1] | = | 1 |
[false] | = | 1 |
[s(x1)] | = | 1 + 1 · x1 |
[c(x1)] | = | 0 |
[if(x1, x2, x3)] | = | 1 + 1 · x1 + 1 · x3 |
f#(0) | → | c1 | (8) |
f#(1) | → | c2 | (9) |
f#(s(z0)) | → | c3(f#(z0)) | (11) |
if#(true,s(z0),s(z1)) | → | c4 | (13) |
if#(false,s(z0),s(z1)) | → | c5 | (15) |
g#(z0,c(z1)) | → | c6(g#(z0,z1)) | (17) |
g#(z0,c(z1)) | → | c7(g#(z0,if(f(z0),c(g(s(z0),z1)),c(z1))),if#(f(z0),c(g(s(z0),z1)),c(z1)),f#(z0),g#(s(z0),z1)) | (19) |
g#(z0,c(z1)) | → | c6(g#(z0,z1)) | (17) |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1,...,x4)] | = | 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 |
[f(x1)] | = | 0 |
[g(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[f#(x1)] | = | 0 |
[if#(x1, x2, x3)] | = | 1 · x1 + 0 |
[g#(x1, x2)] | = | 1 · x2 + 0 |
[0] | = | 1 |
[true] | = | 0 |
[1] | = | 1 |
[false] | = | 0 |
[s(x1)] | = | 1 + 1 · x1 |
[c(x1)] | = | 1 + 1 · x1 |
[if(x1, x2, x3)] | = | 1 + 1 · x1 |
f#(0) | → | c1 | (8) |
f#(1) | → | c2 | (9) |
f#(s(z0)) | → | c3(f#(z0)) | (11) |
if#(true,s(z0),s(z1)) | → | c4 | (13) |
if#(false,s(z0),s(z1)) | → | c5 | (15) |
g#(z0,c(z1)) | → | c6(g#(z0,z1)) | (17) |
g#(z0,c(z1)) | → | c7(g#(z0,if(f(z0),c(g(s(z0),z1)),c(z1))),if#(f(z0),c(g(s(z0),z1)),c(z1)),f#(z0),g#(s(z0),z1)) | (19) |
f(1) | → | false | (2) |
f(0) | → | true | (1) |
f(s(z0)) | → | f(z0) | (10) |
g#(z0,c(z1)) | → | c7(g#(z0,if(f(z0),c(g(s(z0),z1)),c(z1))),if#(f(z0),c(g(s(z0),z1)),c(z1)),f#(z0),g#(s(z0),z1)) | (19) |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1,...,x4)] | = | 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 |
[f(x1)] | = | 0 |
[g(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[f#(x1)] | = | 0 |
[if#(x1, x2, x3)] | = | 1 · x1 + 0 |
[g#(x1, x2)] | = | 1 · x2 + 0 |
[0] | = | 1 |
[true] | = | 0 |
[1] | = | 1 |
[false] | = | 0 |
[s(x1)] | = | 1 + 1 · x1 |
[c(x1)] | = | 1 + 1 · x1 |
[if(x1, x2, x3)] | = | 1 · x1 + 0 |
f#(0) | → | c1 | (8) |
f#(1) | → | c2 | (9) |
f#(s(z0)) | → | c3(f#(z0)) | (11) |
if#(true,s(z0),s(z1)) | → | c4 | (13) |
if#(false,s(z0),s(z1)) | → | c5 | (15) |
g#(z0,c(z1)) | → | c6(g#(z0,z1)) | (17) |
g#(z0,c(z1)) | → | c7(g#(z0,if(f(z0),c(g(s(z0),z1)),c(z1))),if#(f(z0),c(g(s(z0),z1)),c(z1)),f#(z0),g#(s(z0),z1)) | (19) |
f(1) | → | false | (2) |
f(0) | → | true | (1) |
f(s(z0)) | → | f(z0) | (10) |
f#(0) | → | c1 | (8) |
f#(1) | → | c2 | (9) |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1,...,x4)] | = | 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 |
[f(x1)] | = | 0 |
[g(x1, x2)] | = | 1 · x1 + 0 |
[f#(x1)] | = | 1 |
[if#(x1, x2, x3)] | = | 1 · x1 + 0 |
[g#(x1, x2)] | = | 1 · x2 + 0 |
[0] | = | 1 |
[true] | = | 0 |
[1] | = | 1 |
[false] | = | 0 |
[s(x1)] | = | 1 + 1 · x1 |
[c(x1)] | = | 1 + 1 · x1 |
[if(x1, x2, x3)] | = | 1 · x1 + 0 |
f#(0) | → | c1 | (8) |
f#(1) | → | c2 | (9) |
f#(s(z0)) | → | c3(f#(z0)) | (11) |
if#(true,s(z0),s(z1)) | → | c4 | (13) |
if#(false,s(z0),s(z1)) | → | c5 | (15) |
g#(z0,c(z1)) | → | c6(g#(z0,z1)) | (17) |
g#(z0,c(z1)) | → | c7(g#(z0,if(f(z0),c(g(s(z0),z1)),c(z1))),if#(f(z0),c(g(s(z0),z1)),c(z1)),f#(z0),g#(s(z0),z1)) | (19) |
f(1) | → | false | (2) |
f(0) | → | true | (1) |
f(s(z0)) | → | f(z0) | (10) |
f#(s(z0)) | → | c3(f#(z0)) | (11) |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5] | = | 0 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1,...,x4)] | = | 1 · x1 + 0 + 1 · x2 + 1 · x3 + 1 · x4 |
[f(x1)] | = | 0 |
[g(x1, x2)] | = | 2 + 1 · x2 + 1 · x2 · x2 + 2 · x1 · x2 |
[f#(x1)] | = | 2 · x1 + 0 |
[if#(x1, x2, x3)] | = | 1 |
[g#(x1, x2)] | = | 1 + 2 · x1 + 1 · x2 · x2 + 2 · x1 · x2 |
[0] | = | 2 |
[true] | = | 1 |
[1] | = | 1 |
[false] | = | 1 |
[s(x1)] | = | 1 + 1 · x1 |
[c(x1)] | = | 2 + 1 · x1 |
[if(x1, x2, x3)] | = | 0 |
f#(0) | → | c1 | (8) |
f#(1) | → | c2 | (9) |
f#(s(z0)) | → | c3(f#(z0)) | (11) |
if#(true,s(z0),s(z1)) | → | c4 | (13) |
if#(false,s(z0),s(z1)) | → | c5 | (15) |
g#(z0,c(z1)) | → | c6(g#(z0,z1)) | (17) |
g#(z0,c(z1)) | → | c7(g#(z0,if(f(z0),c(g(s(z0),z1)),c(z1))),if#(f(z0),c(g(s(z0),z1)),c(z1)),f#(z0),g#(s(z0),z1)) | (19) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).