The rewrite relation of the following TRS is considered.
app(app(append,nil),l) | → | l | (1) |
app(app(append,app(app(cons,h),t)),l) | → | app(app(cons,h),app(app(append,t),l)) | (2) |
app(app(map,f),nil) | → | nil | (3) |
app(app(map,f),app(app(cons,h),t)) | → | app(app(cons,app(f,h)),app(app(map,f),t)) | (4) |
app(app(append,app(app(append,l1),l2)),l3) | → | app(app(append,l1),app(app(append,l2),l3)) | (5) |
app(app(map,f),app(app(append,l1),l2)) | → | app(app(append,app(app(map,f),l1)),app(app(map,f),l2)) | (6) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
append | is mapped to | append, | append1(x1), | append2(x1, x2) |
nil | is mapped to | nil | ||
cons | is mapped to | cons, | cons1(x1), | cons2(x1, x2) |
map | is mapped to | map, | map1(x1), | map2(x1, x2) |
append2(nil,l) | → | l | (13) |
append2(cons2(h,t),l) | → | cons2(h,append2(t,l)) | (14) |
map2(f,nil) | → | nil | (15) |
map2(f,cons2(h,t)) | → | cons2(app(f,h),map2(f,t)) | (16) |
append2(append2(l1,l2),l3) | → | append2(l1,append2(l2,l3)) | (17) |
map2(f,append2(l1,l2)) | → | append2(map2(f,l1),map2(f,l2)) | (18) |
app(append,y1) | → | append1(y1) | (7) |
app(append1(x0),y1) | → | append2(x0,y1) | (8) |
app(cons,y1) | → | cons1(y1) | (9) |
app(cons1(x0),y1) | → | cons2(x0,y1) | (10) |
app(map,y1) | → | map1(y1) | (11) |
app(map1(x0),y1) | → | map2(x0,y1) | (12) |
prec(append2) | = | 1 | stat(append2) | = | lex | |
prec(nil) | = | 2 | stat(nil) | = | mul | |
prec(cons2) | = | 0 | stat(cons2) | = | mul | |
prec(map2) | = | 4 | stat(map2) | = | mul | |
prec(app) | = | 4 | stat(app) | = | mul | |
prec(append) | = | 5 | stat(append) | = | mul | |
prec(cons) | = | 3 | stat(cons) | = | mul | |
prec(cons1) | = | 3 | stat(cons1) | = | lex | |
prec(map) | = | 6 | stat(map) | = | mul | |
prec(map1) | = | 4 | stat(map1) | = | mul |
π(append2) | = | [1,2] |
π(nil) | = | [] |
π(cons2) | = | [1,2] |
π(map2) | = | [1,2] |
π(app) | = | [1,2] |
π(append) | = | [] |
π(append1) | = | 1 |
π(cons) | = | [] |
π(cons1) | = | [1] |
π(map) | = | [] |
π(map1) | = | [1] |
append2(nil,l) | → | l | (13) |
append2(cons2(h,t),l) | → | cons2(h,append2(t,l)) | (14) |
map2(f,nil) | → | nil | (15) |
map2(f,cons2(h,t)) | → | cons2(app(f,h),map2(f,t)) | (16) |
append2(append2(l1,l2),l3) | → | append2(l1,append2(l2,l3)) | (17) |
map2(f,append2(l1,l2)) | → | append2(map2(f,l1),map2(f,l2)) | (18) |
app(append,y1) | → | append1(y1) | (7) |
app(append1(x0),y1) | → | append2(x0,y1) | (8) |
app(cons,y1) | → | cons1(y1) | (9) |
app(cons1(x0),y1) | → | cons2(x0,y1) | (10) |
app(map,y1) | → | map1(y1) | (11) |
app(map1(x0),y1) | → | map2(x0,y1) | (12) |
There are no rules in the TRS. Hence, it is terminating.