The rewrite relation of the following TRS is considered.
sum(0) | → | 0 | (1) |
sum(s(x)) | → | +(sum(x),s(x)) | (2) |
+(x,0) | → | x | (3) |
+(x,s(y)) | → | s(+(x,y)) | (4) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
sum#(0) |
sum#(s(z0)) |
+#(z0,0) |
+#(z0,s(z1)) |
sum#(0) | → | c | (5) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[sum(x1)] | = | 2 + 2 · x1 |
[+(x1, x2)] | = | 3 · x2 + 0 |
[sum#(x1)] | = | 3 |
[+#(x1, x2)] | = | 0 |
[0] | = | 1 |
[s(x1)] | = | 0 |
sum#(0) | → | c | (5) |
sum#(s(z0)) | → | c1(+#(sum(z0),s(z0)),sum#(z0)) | (7) |
+#(z0,0) | → | c2 | (9) |
+#(z0,s(z1)) | → | c3(+#(z0,z1)) | (11) |
+#(z0,0) | → | c2 | (9) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[sum(x1)] | = | 3 |
[+(x1, x2)] | = | 3 + 3 · x2 |
[sum#(x1)] | = | 1 · x1 + 0 |
[+#(x1, x2)] | = | 1 |
[0] | = | 3 |
[s(x1)] | = | 1 + 1 · x1 |
sum#(0) | → | c | (5) |
sum#(s(z0)) | → | c1(+#(sum(z0),s(z0)),sum#(z0)) | (7) |
+#(z0,0) | → | c2 | (9) |
+#(z0,s(z1)) | → | c3(+#(z0,z1)) | (11) |
sum#(s(z0)) | → | c1(+#(sum(z0),s(z0)),sum#(z0)) | (7) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[sum(x1)] | = | 1 + 1 · x1 |
[+(x1, x2)] | = | 1 + 1 · x2 |
[sum#(x1)] | = | 1 · x1 + 0 |
[+#(x1, x2)] | = | 0 |
[0] | = | 1 |
[s(x1)] | = | 1 + 1 · x1 |
sum#(0) | → | c | (5) |
sum#(s(z0)) | → | c1(+#(sum(z0),s(z0)),sum#(z0)) | (7) |
+#(z0,0) | → | c2 | (9) |
+#(z0,s(z1)) | → | c3(+#(z0,z1)) | (11) |
+#(z0,s(z1)) | → | c3(+#(z0,z1)) | (11) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[sum(x1)] | = | 2 + 2 · x1 + 2 · x1 · x1 |
[+(x1, x2)] | = | 1 + 1 · x2 + 2 · x2 · x2 |
[sum#(x1)] | = | 1 · x1 · x1 + 0 |
[+#(x1, x2)] | = | 1 · x2 + 0 |
[0] | = | 0 |
[s(x1)] | = | 1 + 1 · x1 |
sum#(0) | → | c | (5) |
sum#(s(z0)) | → | c1(+#(sum(z0),s(z0)),sum#(z0)) | (7) |
+#(z0,0) | → | c2 | (9) |
+#(z0,s(z1)) | → | c3(+#(z0,z1)) | (11) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).