The rewrite relation of the following TRS is considered.
app(intlist,nil) | → | nil | (1) |
app(intlist,app(app(cons,x),y)) | → | app(app(cons,app(s,x)),app(intlist,y)) | (2) |
app(app(int,0),0) | → | app(app(cons,0),nil) | (3) |
app(app(int,0),app(s,y)) | → | app(app(cons,0),app(app(int,app(s,0)),app(s,y))) | (4) |
app(app(int,app(s,x)),0) | → | nil | (5) |
app(app(int,app(s,x)),app(s,y)) | → | app(intlist,app(app(int,x),y)) | (6) |
app(app(map,f),nil) | → | nil | (7) |
app(app(map,f),app(app(cons,x),xs)) | → | app(app(cons,app(f,x)),app(app(map,f),xs)) | (8) |
app(app(filter,f),nil) | → | nil | (9) |
app(app(filter,f),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(f,x)),f),x),xs) | (10) |
app(app(app(app(filter2,true),f),x),xs) | → | app(app(cons,x),app(app(filter,f),xs)) | (11) |
app(app(app(app(filter2,false),f),x),xs) | → | app(app(filter,f),xs) | (12) |
We uncurry the binary symbol app in combination with the following symbol map which also determines the applicative arities of these symbols.
intlist | is mapped to | intlist, | intlist1(x1) | |||
nil | is mapped to | nil | ||||
cons | is mapped to | cons, | cons1(x1), | cons2(x1, x2) | ||
s | is mapped to | s, | s1(x1) | |||
int | is mapped to | int, | int1(x1), | int2(x1, x2) | ||
0 | is mapped to | 0 | ||||
map | is mapped to | map, | map1(x1), | map2(x1, x2) | ||
filter | is mapped to | filter, | filter1(x1), | filter3(x1, x2) | ||
filter2 | is mapped to | filter2, | filter21(x1), | filter22(x1, x2), | filter23(x1, x2, x3), | filter24(x1,...,x4) |
true | is mapped to | true | ||||
false | is mapped to | false |
intlist1(nil) | → | nil | (27) |
intlist1(cons2(x,y)) | → | cons2(s1(x),intlist1(y)) | (28) |
int2(0,0) | → | cons2(0,nil) | (29) |
int2(0,s1(y)) | → | cons2(0,int2(s1(0),s1(y))) | (30) |
int2(s1(x),0) | → | nil | (31) |
int2(s1(x),s1(y)) | → | intlist1(int2(x,y)) | (32) |
map2(f,nil) | → | nil | (33) |
map2(f,cons2(x,xs)) | → | cons2(app(f,x),map2(f,xs)) | (34) |
filter3(f,nil) | → | nil | (35) |
filter3(f,cons2(x,xs)) | → | filter24(app(f,x),f,x,xs) | (36) |
filter24(true,f,x,xs) | → | cons2(x,filter3(f,xs)) | (37) |
filter24(false,f,x,xs) | → | filter3(f,xs) | (38) |
app(intlist,y1) | → | intlist1(y1) | (13) |
app(cons,y1) | → | cons1(y1) | (14) |
app(cons1(x0),y1) | → | cons2(x0,y1) | (15) |
app(s,y1) | → | s1(y1) | (16) |
app(int,y1) | → | int1(y1) | (17) |
app(int1(x0),y1) | → | int2(x0,y1) | (18) |
app(map,y1) | → | map1(y1) | (19) |
app(map1(x0),y1) | → | map2(x0,y1) | (20) |
app(filter,y1) | → | filter1(y1) | (21) |
app(filter1(x0),y1) | → | filter3(x0,y1) | (22) |
app(filter2,y1) | → | filter21(y1) | (23) |
app(filter21(x0),y1) | → | filter22(x0,y1) | (24) |
app(filter22(x0,x1),y1) | → | filter23(x0,x1,y1) | (25) |
app(filter23(x0,x1,x2),y1) | → | filter24(x0,x1,x2,y1) | (26) |
The TRS is overlay and locally confluent:
10Hence, it suffices to show innermost termination in the following.
intlist1#(cons2(x,y)) | → | intlist1#(y) | (39) |
int2#(0,s1(y)) | → | int2#(s1(0),s1(y)) | (40) |
int2#(s1(x),s1(y)) | → | intlist1#(int2(x,y)) | (41) |
int2#(s1(x),s1(y)) | → | int2#(x,y) | (42) |
map2#(f,cons2(x,xs)) | → | app#(f,x) | (43) |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (44) |
filter3#(f,cons2(x,xs)) | → | filter24#(app(f,x),f,x,xs) | (45) |
filter3#(f,cons2(x,xs)) | → | app#(f,x) | (46) |
filter24#(true,f,x,xs) | → | filter3#(f,xs) | (47) |
filter24#(false,f,x,xs) | → | filter3#(f,xs) | (48) |
app#(intlist,y1) | → | intlist1#(y1) | (49) |
app#(int1(x0),y1) | → | int2#(x0,y1) | (50) |
app#(map1(x0),y1) | → | map2#(x0,y1) | (51) |
app#(filter1(x0),y1) | → | filter3#(x0,y1) | (52) |
app#(filter23(x0,x1,x2),y1) | → | filter24#(x0,x1,x2,y1) | (53) |
The dependency pairs are split into 3 components.
app#(map1(x0),y1) | → | map2#(x0,y1) | (51) |
map2#(f,cons2(x,xs)) | → | app#(f,x) | (43) |
app#(filter1(x0),y1) | → | filter3#(x0,y1) | (52) |
filter3#(f,cons2(x,xs)) | → | app#(f,x) | (46) |
app#(filter23(x0,x1,x2),y1) | → | filter24#(x0,x1,x2,y1) | (53) |
filter24#(true,f,x,xs) | → | filter3#(f,xs) | (47) |
filter24#(false,f,x,xs) | → | filter3#(f,xs) | (48) |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (44) |
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
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) | (43) |
1 | ≥ | 1 | |
2 | > | 2 | |
map2#(f,cons2(x,xs)) | → | map2#(f,xs) | (44) |
1 | ≥ | 1 | |
2 | > | 2 | |
filter3#(f,cons2(x,xs)) | → | app#(f,x) | (46) |
1 | ≥ | 1 | |
2 | > | 2 | |
app#(map1(x0),y1) | → | map2#(x0,y1) | (51) |
1 | > | 1 | |
2 | ≥ | 2 | |
app#(filter1(x0),y1) | → | filter3#(x0,y1) | (52) |
1 | > | 1 | |
2 | ≥ | 2 | |
app#(filter23(x0,x1,x2),y1) | → | filter24#(x0,x1,x2,y1) | (53) |
1 | > | 1 | |
1 | > | 2 | |
1 | > | 3 | |
2 | ≥ | 4 | |
filter24#(true,f,x,xs) | → | filter3#(f,xs) | (47) |
2 | ≥ | 1 | |
4 | ≥ | 2 | |
filter24#(false,f,x,xs) | → | filter3#(f,xs) | (48) |
2 | ≥ | 1 | |
4 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
int2#(s1(x),s1(y)) | → | int2#(x,y) | (42) |
int2#(0,s1(y)) | → | int2#(s1(0),s1(y)) | (40) |
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
int2#(s1(x),s1(y)) | → | int2#(x,y) | (42) |
1 | > | 1 | |
2 | > | 2 | |
int2#(0,s1(y)) | → | int2#(s1(0),s1(y)) | (40) |
2 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
intlist1#(cons2(x,y)) | → | intlist1#(y) | (39) |
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
intlist1#(cons2(x,y)) | → | intlist1#(y) | (39) |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.