The rewrite relation of the following TRS is considered.
admit(x,nil) | → | nil | (1) |
admit(x,.(u,.(v,.(w,z)))) | → | cond(=(sum(x,u,v),w),.(u,.(v,.(w,admit(carry(x,u,v),z))))) | (2) |
cond(true,y) | → | y | (3) |
|
originates from |
|
||||||||
|
originates from |
|
||||||||
|
originates from |
|
admit#(z0,nil) |
admit#(z0,.(z1,.(z2,.(w,z3)))) |
cond#(true,z0) |
cond(true,z0) | → | z0 | (8) |
cond#(true,z0) | → | c2 | (9) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[admit(x1, x2)] | = | 1 + 1 · x1 |
[admit#(x1, x2)] | = | 1 · x1 + 0 |
[cond#(x1, x2)] | = | 1 · x1 + 0 |
[nil] | = | 1 |
[.(x1, x2)] | = | 1 · x1 + 0 |
[w] | = | 1 |
[cond(x1, x2)] | = | 1 + 1 · x1 |
[=(x1, x2)] | = | 1 · x1 + 0 |
[sum(x1, x2, x3)] | = | 0 |
[carry(x1, x2, x3)] | = | 1 · x1 + 0 |
[true] | = | 1 |
admit#(z0,nil) | → | c | (5) |
admit#(z0,.(z1,.(z2,.(w,z3)))) | → | c1(cond#(=(sum(z0,z1,z2),w),.(z1,.(z2,.(w,admit(carry(z0,z1,z2),z3))))),admit#(carry(z0,z1,z2),z3)) | (7) |
cond#(true,z0) | → | c2 | (9) |
admit#(z0,nil) | → | c | (5) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[admit(x1, x2)] | = | 1 + 1 · x1 |
[admit#(x1, x2)] | = | 1 + 1 · x1 |
[cond#(x1, x2)] | = | 1 · x1 + 0 |
[nil] | = | 1 |
[.(x1, x2)] | = | 1 · x1 + 0 |
[w] | = | 1 |
[cond(x1, x2)] | = | 1 + 1 · x1 |
[=(x1, x2)] | = | 1 · x1 + 0 |
[sum(x1, x2, x3)] | = | 1 · x1 + 0 |
[carry(x1, x2, x3)] | = | 0 |
[true] | = | 0 |
admit#(z0,nil) | → | c | (5) |
admit#(z0,.(z1,.(z2,.(w,z3)))) | → | c1(cond#(=(sum(z0,z1,z2),w),.(z1,.(z2,.(w,admit(carry(z0,z1,z2),z3))))),admit#(carry(z0,z1,z2),z3)) | (7) |
cond#(true,z0) | → | c2 | (9) |
admit#(z0,.(z1,.(z2,.(w,z3)))) | → | c1(cond#(=(sum(z0,z1,z2),w),.(z1,.(z2,.(w,admit(carry(z0,z1,z2),z3))))),admit#(carry(z0,z1,z2),z3)) | (7) |
[c] | = | 0 |
[c1(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[c2] | = | 0 |
[admit(x1, x2)] | = | 1 + 1 · x1 |
[admit#(x1, x2)] | = | 1 · x1 + 0 + 1 · x2 |
[cond#(x1, x2)] | = | 1 · x1 + 0 |
[nil] | = | 1 |
[.(x1, x2)] | = | 1 + 1 · x2 |
[w] | = | 1 |
[cond(x1, x2)] | = | 1 + 1 · x1 |
[=(x1, x2)] | = | 1 · x1 + 0 |
[sum(x1, x2, x3)] | = | 0 |
[carry(x1, x2, x3)] | = | 1 · x1 + 0 |
[true] | = | 0 |
admit#(z0,nil) | → | c | (5) |
admit#(z0,.(z1,.(z2,.(w,z3)))) | → | c1(cond#(=(sum(z0,z1,z2),w),.(z1,.(z2,.(w,admit(carry(z0,z1,z2),z3))))),admit#(carry(z0,z1,z2),z3)) | (7) |
cond#(true,z0) | → | c2 | (9) |
There are no rules in the TRS R. Hence, R/S has complexity O(1).