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