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