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