The rewrite relation of the following TRS is considered.
| 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) |
| [plus(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [app(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [0] | = |
|
||||||||||||||||||||||||||||||||||||
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [pred(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
| plus(0,y) | → | y | (7) |
| sum(plus(cons(0,x),cons(y,l))) | → | pred(sum(cons(s(x),cons(y,l)))) | (9) |
| [plus(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [app(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [pred(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
| app(nil,k) | → | k | (1) |
| app(l,nil) | → | l | (2) |
| [plus(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [app(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [pred(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
| sum(cons(x,cons(y,l))) | → | sum(cons(plus(x,y),l)) | (5) |
| [plus(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [app(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [pred(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
| pred(cons(s(x),nil)) | → | cons(x,nil) | (10) |
| [plus(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [app(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [s(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
| plus(s(x),y) | → | s(plus(x,y)) | (8) |
| [app(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
| [sum(x1)] | = |
|
||||||||||||||||||||||||||||||||||||
| [nil] | = |
|
||||||||||||||||||||||||||||||||||||
| [cons(x1, x2)] | = |
|
| sum(app(l,cons(x,cons(y,k)))) | → | sum(app(l,sum(cons(x,cons(y,k))))) | (6) |
| prec(sum) | = | 3 | weight(sum) | = | 2 | ||||
| prec(cons) | = | 0 | weight(cons) | = | 0 | ||||
| prec(app) | = | 1 | weight(app) | = | 0 | ||||
| prec(nil) | = | 2 | weight(nil) | = | 1 |
| app(cons(x,l),k) | → | cons(x,app(l,k)) | (3) |
| sum(cons(x,nil)) | → | cons(x,nil) | (4) |
There are no rules in the TRS. Hence, it is terminating.