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