The rewrite relation of the following TRS is considered.
app(app(app(f,0),1),x) | → | app(app(app(f,x),x),x) | (1) |
app(app(app(f,x),y),z) | → | 2 | (2) |
0 | → | 2 | (3) |
1 | → | 2 | (4) |
app(app(app(g,x),x),y) | → | y | (5) |
app(app(app(g,x),y),y) | → | x | (6) |
app(app(map,fun),nil) | → | nil | (7) |
app(app(map,fun),app(app(cons,x),xs)) | → | app(app(cons,app(fun,x)),app(app(map,fun),xs)) | (8) |
app(app(filter,fun),nil) | → | nil | (9) |
app(app(filter,fun),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(fun,x)),fun),x),xs) | (10) |
app(app(app(app(filter2,true),fun),x),xs) | → | app(app(cons,x),app(app(filter,fun),xs)) | (11) |
app(app(app(app(filter2,false),fun),x),xs) | → | app(app(filter,fun),xs) | (12) |
app#(app(app(f,0),1),x) | → | app#(app(app(f,x),x),x) | (13) |
app#(app(app(f,0),1),x) | → | app#(app(f,x),x) | (14) |
app#(app(app(f,0),1),x) | → | app#(f,x) | (15) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(cons,app(fun,x)),app(app(map,fun),xs)) | (16) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(cons,app(fun,x)) | (17) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (18) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (19) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (20) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(filter2,app(fun,x)),fun),x) | (21) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(filter2,app(fun,x)),fun) | (22) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(filter2,app(fun,x)) | (23) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (24) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(cons,x),app(app(filter,fun),xs)) | (25) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(cons,x) | (26) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (27) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(filter,fun) | (28) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (29) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(filter,fun) | (30) |
The dependency pairs are split into 1 component.
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (19) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (18) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (20) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (27) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (24) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (29) |
We restrict the rewrite rules to the following usable rules of the DP problem.
app(app(app(f,x),y),z) | → | 2 | (2) |
app(app(app(g,x),x),y) | → | y | (5) |
app(app(app(g,x),y),y) | → | x | (6) |
app(app(map,fun),nil) | → | nil | (7) |
app(app(map,fun),app(app(cons,x),xs)) | → | app(app(cons,app(fun,x)),app(app(map,fun),xs)) | (8) |
app(app(filter,fun),nil) | → | nil | (9) |
app(app(filter,fun),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(fun,x)),fun),x),xs) | (10) |
app(app(app(app(filter2,false),fun),x),xs) | → | app(app(filter,fun),xs) | (12) |
app(app(app(app(filter2,true),fun),x),xs) | → | app(app(cons,x),app(app(filter,fun),xs)) | (11) |
We restrict the innermost strategy to the following left hand sides.
app(app(app(f,x0),x1),x2) |
app(app(app(g,x0),x0),x1) |
app(app(app(g,x0),x1),x1) |
app(app(map,x0),nil) |
app(app(map,x0),app(app(cons,x1),x2)) |
app(app(filter,x0),nil) |
app(app(filter,x0),app(app(cons,x1),x2)) |
app(app(app(app(filter2,true),x0),x1),x2) |
app(app(app(app(filter2,false),x0),x1),x2) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (24) |
1 | > | 1 | |
2 | > | 2 | |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (18) |
1 | > | 1 | |
2 | > | 2 | |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (19) |
1 | ≥ | 1 | |
2 | > | 2 | |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (20) |
2 | > | 2 | |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (27) |
2 | ≥ | 2 | |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (29) |
2 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.