The rewrite relation of the following TRS is considered.
eq(0,0) | → | true | (1) |
eq(0,s(X)) | → | false | (2) |
eq(s(X),0) | → | false | (3) |
eq(s(X),s(Y)) | → | eq(X,Y) | (4) |
rm(N,nil) | → | nil | (5) |
rm(N,add(M,X)) | → | ifrm(eq(N,M),N,add(M,X)) | (6) |
ifrm(true,N,add(M,X)) | → | rm(N,X) | (7) |
ifrm(false,N,add(M,X)) | → | add(M,rm(N,X)) | (8) |
purge(nil) | → | nil | (9) |
purge(add(N,X)) | → | add(N,purge(rm(N,X))) | (10) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
eq#(0,0) |
eq#(0,s(z0)) |
eq#(s(z0),0) |
eq#(s(z0),s(z1)) |
rm#(z0,nil) |
rm#(z0,add(z1,z2)) |
ifrm#(true,z0,add(z1,z2)) |
ifrm#(false,z0,add(z1,z2)) |
purge#(nil) |
purge#(add(z0,z1)) |
purge(nil) | → | nil | (9) |
purge(add(z0,z1)) | → | add(z0,purge(rm(z0,z1))) | (27) |
purge#(nil) | → | c8 | (26) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[c8] | = | 0 |
[c9(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[eq(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[rm(x1, x2)] | = | 1 + 1 · x1 |
[ifrm(x1, x2, x3)] | = | 1 + 1 · x2 + 1 · x3 |
[eq#(x1, x2)] | = | 0 |
[rm#(x1, x2)] | = | 0 |
[ifrm#(x1, x2, x3)] | = | 0 |
[purge#(x1)] | = | 1 |
[nil] | = | 1 |
[add(x1, x2)] | = | 1 · x1 + 0 |
[true] | = | 1 |
[false] | = | 1 |
[0] | = | 1 |
[s(x1)] | = | 1 + 1 · x1 |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
rm#(z0,nil) | → | c4 | (19) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
purge#(nil) | → | c8 | (26) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[c8] | = | 0 |
[c9(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[eq(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[rm(x1, x2)] | = | 1 · x2 + 0 |
[ifrm(x1, x2, x3)] | = | 1 · x3 + 0 |
[eq#(x1, x2)] | = | 0 |
[rm#(x1, x2)] | = | 1 · x1 + 0 |
[ifrm#(x1, x2, x3)] | = | 1 · x2 + 0 |
[purge#(x1)] | = | 1 · x1 + 0 |
[nil] | = | 1 |
[add(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[true] | = | 1 |
[false] | = | 0 |
[0] | = | 1 |
[s(x1)] | = | 1 + 1 · x1 |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
rm#(z0,nil) | → | c4 | (19) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
purge#(nil) | → | c8 | (26) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
rm(z0,add(z1,z2)) | → | ifrm(eq(z0,z1),z0,add(z1,z2)) | (20) |
ifrm(false,z0,add(z1,z2)) | → | add(z1,rm(z0,z2)) | (24) |
rm(z0,nil) | → | nil | (18) |
ifrm(true,z0,add(z1,z2)) | → | rm(z0,z2) | (22) |
rm#(z0,nil) | → | c4 | (19) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[c8] | = | 0 |
[c9(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[eq(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[rm(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[ifrm(x1, x2, x3)] | = | 1 · x2 + 0 + 1 · x3 |
[eq#(x1, x2)] | = | 0 |
[rm#(x1, x2)] | = | 1 |
[ifrm#(x1, x2, x3)] | = | 1 |
[purge#(x1)] | = | 1 · x1 + 0 |
[nil] | = | 1 |
[add(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[true] | = | 1 |
[false] | = | 0 |
[0] | = | 1 |
[s(x1)] | = | 1 + 1 · x1 |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
rm#(z0,nil) | → | c4 | (19) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
purge#(nil) | → | c8 | (26) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
rm(z0,add(z1,z2)) | → | ifrm(eq(z0,z1),z0,add(z1,z2)) | (20) |
ifrm(false,z0,add(z1,z2)) | → | add(z1,rm(z0,z2)) | (24) |
rm(z0,nil) | → | nil | (18) |
ifrm(true,z0,add(z1,z2)) | → | rm(z0,z2) | (22) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[c8] | = | 0 |
[c9(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[eq(x1, x2)] | = | 0 |
[rm(x1, x2)] | = | 1 · x2 + 0 |
[ifrm(x1, x2, x3)] | = | 1 · x3 + 0 |
[eq#(x1, x2)] | = | 1 · x1 + 0 |
[rm#(x1, x2)] | = | 2 · x1 + 0 + 1 · x1 · x2 |
[ifrm#(x1, x2, x3)] | = | 1 · x2 + 0 + 1 · x2 · x3 |
[purge#(x1)] | = | 1 · x1 · x1 + 0 |
[nil] | = | 0 |
[add(x1, x2)] | = | 2 + 1 · x1 + 1 · x2 |
[true] | = | 0 |
[false] | = | 0 |
[0] | = | 0 |
[s(x1)] | = | 2 + 1 · x1 |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
rm#(z0,nil) | → | c4 | (19) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
purge#(nil) | → | c8 | (26) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
rm(z0,add(z1,z2)) | → | ifrm(eq(z0,z1),z0,add(z1,z2)) | (20) |
ifrm(false,z0,add(z1,z2)) | → | add(z1,rm(z0,z2)) | (24) |
rm(z0,nil) | → | nil | (18) |
ifrm(true,z0,add(z1,z2)) | → | rm(z0,z2) | (22) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[c8] | = | 0 |
[c9(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[eq(x1, x2)] | = | 0 |
[rm(x1, x2)] | = | 1 · x2 + 0 |
[ifrm(x1, x2, x3)] | = | 1 · x3 + 0 |
[eq#(x1, x2)] | = | 0 |
[rm#(x1, x2)] | = | 1 · x2 + 0 |
[ifrm#(x1, x2, x3)] | = | 1 · x3 + 0 |
[purge#(x1)] | = | 1 · x1 · x1 + 0 |
[nil] | = | 0 |
[add(x1, x2)] | = | 1 + 1 · x2 |
[true] | = | 0 |
[false] | = | 0 |
[0] | = | 0 |
[s(x1)] | = | 0 |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
rm#(z0,nil) | → | c4 | (19) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
purge#(nil) | → | c8 | (26) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
rm(z0,add(z1,z2)) | → | ifrm(eq(z0,z1),z0,add(z1,z2)) | (20) |
ifrm(false,z0,add(z1,z2)) | → | add(z1,rm(z0,z2)) | (24) |
rm(z0,nil) | → | nil | (18) |
ifrm(true,z0,add(z1,z2)) | → | rm(z0,z2) | (22) |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[c8] | = | 0 |
[c9(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[eq(x1, x2)] | = | 0 |
[rm(x1, x2)] | = | 1 · x2 + 0 |
[ifrm(x1, x2, x3)] | = | 1 · x3 + 0 |
[eq#(x1, x2)] | = | 2 |
[rm#(x1, x2)] | = | 2 + 1 · x2 |
[ifrm#(x1, x2, x3)] | = | 1 · x3 + 0 |
[purge#(x1)] | = | 2 · x1 · x1 + 0 |
[nil] | = | 0 |
[add(x1, x2)] | = | 2 + 1 · x2 |
[true] | = | 0 |
[false] | = | 0 |
[0] | = | 0 |
[s(x1)] | = | 0 |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
rm#(z0,nil) | → | c4 | (19) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
purge#(nil) | → | c8 | (26) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
rm(z0,add(z1,z2)) | → | ifrm(eq(z0,z1),z0,add(z1,z2)) | (20) |
ifrm(false,z0,add(z1,z2)) | → | add(z1,rm(z0,z2)) | (24) |
rm(z0,nil) | → | nil | (18) |
ifrm(true,z0,add(z1,z2)) | → | rm(z0,z2) | (22) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
[c] | = | 0 |
[c1] | = | 0 |
[c2] | = | 0 |
[c3(x1)] | = | 1 · x1 + 0 |
[c4] | = | 0 |
[c5(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c6(x1)] | = | 1 · x1 + 0 |
[c7(x1)] | = | 1 · x1 + 0 |
[c8] | = | 0 |
[c9(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[eq(x1, x2)] | = | 0 |
[rm(x1, x2)] | = | 1 · x2 + 0 |
[ifrm(x1, x2, x3)] | = | 1 · x3 + 0 |
[eq#(x1, x2)] | = | 0 |
[rm#(x1, x2)] | = | 2 + 2 · x2 |
[ifrm#(x1, x2, x3)] | = | 2 · x3 + 0 |
[purge#(x1)] | = | 1 · x1 · x1 + 0 |
[nil] | = | 0 |
[add(x1, x2)] | = | 2 + 1 · x2 |
[true] | = | 0 |
[false] | = | 0 |
[0] | = | 0 |
[s(x1)] | = | 0 |
eq#(0,0) | → | c | (11) |
eq#(0,s(z0)) | → | c1 | (13) |
eq#(s(z0),0) | → | c2 | (15) |
eq#(s(z0),s(z1)) | → | c3(eq#(z0,z1)) | (17) |
rm#(z0,nil) | → | c4 | (19) |
rm#(z0,add(z1,z2)) | → | c5(ifrm#(eq(z0,z1),z0,add(z1,z2)),eq#(z0,z1)) | (21) |
ifrm#(true,z0,add(z1,z2)) | → | c6(rm#(z0,z2)) | (23) |
ifrm#(false,z0,add(z1,z2)) | → | c7(rm#(z0,z2)) | (25) |
purge#(nil) | → | c8 | (26) |
purge#(add(z0,z1)) | → | c9(purge#(rm(z0,z1)),rm#(z0,z1)) | (28) |
rm(z0,add(z1,z2)) | → | ifrm(eq(z0,z1),z0,add(z1,z2)) | (20) |
ifrm(false,z0,add(z1,z2)) | → | add(z1,rm(z0,z2)) | (24) |
rm(z0,nil) | → | nil | (18) |
ifrm(true,z0,add(z1,z2)) | → | rm(z0,z2) | (22) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).