The rewrite relation of the following TRS is considered.
| sum(cons(s(n),x),cons(m,y)) | → | sum(cons(n,x),cons(s(m),y)) | (1) |
| sum(cons(0,x),y) | → | sum(x,y) | (2) |
| sum(nil,y) | → | y | (3) |
| weight(cons(n,cons(m,x))) | → | weight(sum(cons(n,cons(m,x)),cons(0,x))) | (4) |
| weight(cons(n,nil)) | → | n | (5) |
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [0] | = |
|
||||||||||||||||||||||||||||||||||||
| [weight(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1, x2)] | = |
|
| weight(cons(n,nil)) | → | n | (5) |
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [0] | = |
|
||||||||||||||||||||||||||||||||||||
| [weight(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1, x2)] | = |
|
| sum(nil,y) | → | y | (3) |
| [cons(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [0] | = |
|
||||||||||||||||||||||||||||||||||||
| [weight(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1, x2)] | = |
|
| sum(cons(0,x),y) | → | sum(x,y) | (2) |
| [cons(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [0] | = |
|
||||||||||||||||||||||||||||||||||||
| [weight(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1, x2)] | = |
|
| weight(cons(n,cons(m,x))) | → | weight(sum(cons(n,cons(m,x)),cons(0,x))) | (4) |
| prec(sum) | = | 0 | weight(sum) | = | 0 | ||||
| prec(cons) | = | 2 | weight(cons) | = | 0 | ||||
| prec(s) | = | 3 | weight(s) | = | 2 |
| sum(cons(s(n),x),cons(m,y)) | → | sum(cons(n,x),cons(s(m),y)) | (1) |
There are no rules in the TRS. Hence, it is terminating.