The relative rewrite relation R/S is considered where R is the following TRS
app(nil,k) | → | k | (1) |
app(l,nil) | → | l | (2) |
app(cons(x,l),k) | → | cons(x,app(l,k)) | (3) |
sum(cons(x,nil)) | → | cons(x,nil) | (4) |
sum(cons(x,cons(y,l))) | → | sum(cons(plus(x,y),l)) | (5) |
sum(app(l,cons(x,cons(y,k)))) | → | sum(app(l,sum(cons(x,cons(y,k))))) | (6) |
plus(0,y) | → | y | (7) |
plus(s(x),y) | → | s(plus(x,y)) | (8) |
sum(plus(cons(0,x),cons(y,l))) | → | pred(sum(cons(s(x),cons(y,l)))) | (9) |
pred(cons(s(x),nil)) | → | cons(x,nil) | (10) |
and S is the following TRS.
cons(x,cons(y,l)) | → | cons(y,cons(x,l)) | (11) |
[app(x1, x2)] | = | 1 · x1 + 1 · x2 |
[nil] | = | 0 |
[cons(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[sum(x1)] | = | 1 · x1 |
[plus(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[0] | = | 1 |
[s(x1)] | = | 1 + 1 · x1 |
[pred(x1)] | = | 1 + 1 · x1 |
plus(0,y) | → | y | (7) |
pred(cons(s(x),nil)) | → | cons(x,nil) | (10) |
[app(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[nil] | = | 0 |
[cons(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[sum(x1)] | = | 1 · x1 |
[plus(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[s(x1)] | = | 1 + 1 · x1 |
[0] | = | 1 |
[pred(x1)] | = | 1 + 1 · x1 |
app(nil,k) | → | k | (1) |
app(l,nil) | → | l | (2) |
[app(x1, x2)] | = | 1 · x1 + 1 · x2 |
[cons(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[sum(x1)] | = | 1 · x1 |
[nil] | = | 0 |
[plus(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[s(x1)] | = | 1 · x1 |
[0] | = | 1 |
[pred(x1)] | = | 1 · x1 |
sum(plus(cons(0,x),cons(y,l))) | → | pred(sum(cons(s(x),cons(y,l)))) | (9) |
[app(x1, x2)] | = | 1 · x1 + 1 · x2 |
[cons(x1, x2)] | = | 1 + 1 · x1 + 1 · x2 |
[sum(x1)] | = | 1 · x1 |
[nil] | = | 0 |
[plus(x1, x2)] | = | 1 · x1 + 1 · x2 |
[s(x1)] | = | 1 · x1 |
sum(cons(x,cons(y,l))) | → | sum(cons(plus(x,y),l)) | (5) |
[app(x1, x2)] | = |
|
|||||||||||||||||||
[cons(x1, x2)] | = |
|
|||||||||||||||||||
[sum(x1)] | = |
|
|||||||||||||||||||
[nil] | = |
|
|||||||||||||||||||
[plus(x1, x2)] | = |
|
|||||||||||||||||||
[s(x1)] | = |
|
plus(s(x),y) | → | s(plus(x,y)) | (8) |
[app(x1, x2)] | = |
|
|||||||||||||||||||
[cons(x1, x2)] | = |
|
|||||||||||||||||||
[sum(x1)] | = |
|
|||||||||||||||||||
[nil] | = |
|
app(cons(x,l),k) | → | cons(x,app(l,k)) | (3) |
[sum(x1)] | = |
|
|||||||||||||||||||
[cons(x1, x2)] | = |
|
|||||||||||||||||||
[nil] | = |
|
|||||||||||||||||||
[app(x1, x2)] | = |
|
sum(cons(x,nil)) | → | cons(x,nil) | (4) |
[sum(x1)] | = |
|
|||||||||||||||||||
[app(x1, x2)] | = |
|
|||||||||||||||||||
[cons(x1, x2)] | = |
|
sum(app(l,cons(x,cons(y,k)))) | → | sum(app(l,sum(cons(x,cons(y,k))))) | (6) |
There are no rules in the TRS. Hence, it is terminating.