The rewrite relation of the following TRS is considered.
app(app(map,f),nil) | → | nil | (1) |
app(app(map,f),app(app(cons,x),xs)) | → | app(app(cons,app(f,x)),app(app(map,f),xs)) | (2) |
app(app(app(comp,f),g),x) | → | app(f,app(g,x)) | (3) |
app(twice,f) | → | app(app(comp,f),f) | (4) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
map | is mapped to | map, | map1(x1), | map2(x1, x2) | |
nil | is mapped to | nil | |||
cons | is mapped to | cons, | cons1(x1), | cons2(x1, x2) | |
comp | is mapped to | comp, | comp1(x1), | comp2(x1, x2), | comp3(x1, x2, x3) |
twice | is mapped to | twice, | twice1(x1) |
map2(f,nil) | → | nil | (13) |
map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (14) |
comp3(f,g,x) | → | app(f,app(g,x)) | (15) |
twice1(f) | → | comp2(f,f) | (16) |
app(map,y1) | → | map1(y1) | (5) |
app(map1(x0),y1) | → | map2(x0,y1) | (6) |
app(cons,y1) | → | cons1(y1) | (7) |
app(cons1(x0),y1) | → | cons2(x0,y1) | (8) |
app(comp,y1) | → | comp1(y1) | (9) |
app(comp1(x0),y1) | → | comp2(x0,y1) | (10) |
app(comp2(x0,x1),y1) | → | comp3(x0,x1,y1) | (11) |
app(twice,y1) | → | twice1(y1) | (12) |
The TRS is overlay and locally confluent:
10Hence, it suffices to show innermost termination in the following.
map2#(f,cons2(x,xs)) | → | app#(f,x) | (17) |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (18) |
comp3#(f,g,x) | → | app#(f,app(g,x)) | (19) |
comp3#(f,g,x) | → | app#(g,x) | (20) |
app#(map1(x0),y1) | → | map2#(x0,y1) | (21) |
app#(comp2(x0,x1),y1) | → | comp3#(x0,x1,y1) | (22) |
app#(twice,y1) | → | twice1#(y1) | (23) |
The dependency pairs are split into 1 component.
app#(map1(x0),y1) | → | map2#(x0,y1) | (21) |
map2#(f,cons2(x,xs)) | → | app#(f,x) | (17) |
app#(comp2(x0,x1),y1) | → | comp3#(x0,x1,y1) | (22) |
comp3#(f,g,x) | → | app#(f,app(g,x)) | (19) |
comp3#(f,g,x) | → | app#(g,x) | (20) |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (18) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
map2#(f,cons2(x,xs)) | → | app#(f,x) | (17) |
1 | ≥ | 1 | |
2 | > | 2 | |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (18) |
1 | ≥ | 1 | |
2 | > | 2 | |
app#(map1(x0),y1) | → | map2#(x0,y1) | (21) |
1 | > | 1 | |
2 | ≥ | 2 | |
app#(comp2(x0,x1),y1) | → | comp3#(x0,x1,y1) | (22) |
1 | > | 1 | |
1 | > | 2 | |
2 | ≥ | 3 | |
comp3#(f,g,x) | → | app#(f,app(g,x)) | (19) |
1 | ≥ | 1 | |
comp3#(f,g,x) | → | app#(g,x) | (20) |
2 | ≥ | 1 | |
3 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.