The rewrite relation of the following TRS is considered.
app(app(app(compose,f),g),x) | → | app(g,app(f,x)) | (1) |
app(reverse,l) | → | app(app(reverse2,l),nil) | (2) |
app(app(reverse2,nil),l) | → | l | (3) |
app(app(reverse2,app(app(cons,x),xs)),l) | → | app(app(reverse2,xs),app(app(cons,x),l)) | (4) |
app(hd,app(app(cons,x),xs)) | → | x | (5) |
app(tl,app(app(cons,x),xs)) | → | xs | (6) |
last | → | app(app(compose,hd),reverse) | (7) |
init | → | app(app(compose,reverse),app(app(compose,tl),reverse)) | (8) |
[nil] | = |
|
||||||||||||||||||||||||||||||||||||
[last] | = |
|
||||||||||||||||||||||||||||||||||||
[app(x1, x2)] | = |
|
||||||||||||||||||||||||||||||||||||
[reverse2] | = |
|
||||||||||||||||||||||||||||||||||||
[cons] | = |
|
||||||||||||||||||||||||||||||||||||
[compose] | = |
|
||||||||||||||||||||||||||||||||||||
[tl] | = |
|
||||||||||||||||||||||||||||||||||||
[init] | = |
|
||||||||||||||||||||||||||||||||||||
[hd] | = |
|
||||||||||||||||||||||||||||||||||||
[reverse] | = |
|
app(hd,app(app(cons,x),xs)) | → | x | (5) |
init | → | app(app(compose,reverse),app(app(compose,tl),reverse)) | (8) |
prec(last) | = | 5 | weight(last) | = | 7 | ||||
prec(tl) | = | 6 | weight(tl) | = | 1 | ||||
prec(hd) | = | 9 | weight(hd) | = | 1 | ||||
prec(cons) | = | 0 | weight(cons) | = | 2 | ||||
prec(nil) | = | 1 | weight(nil) | = | 1 | ||||
prec(reverse2) | = | 11 | weight(reverse2) | = | 1 | ||||
prec(reverse) | = | 8 | weight(reverse) | = | 4 | ||||
prec(app) | = | 4 | weight(app) | = | 0 | ||||
prec(compose) | = | 10 | weight(compose) | = | 2 |
app(app(app(compose,f),g),x) | → | app(g,app(f,x)) | (1) |
app(reverse,l) | → | app(app(reverse2,l),nil) | (2) |
app(app(reverse2,nil),l) | → | l | (3) |
app(app(reverse2,app(app(cons,x),xs)),l) | → | app(app(reverse2,xs),app(app(cons,x),l)) | (4) |
app(tl,app(app(cons,x),xs)) | → | xs | (6) |
last | → | app(app(compose,hd),reverse) | (7) |
There are no rules in the TRS. Hence, it is terminating.