The rewrite relation of the following TRS is considered.
app(app(app(f,app(app(g,x),y)),x),z) | → | app(app(app(f,z),z),z) | (1) |
app(app(g,x),y) | → | x | (2) |
app(app(g,x),y) | → | y | (3) |
app(app(map,fun),nil) | → | nil | (4) |
app(app(map,fun),app(app(cons,x),xs)) | → | app(app(cons,app(fun,x)),app(app(map,fun),xs)) | (5) |
app(app(filter,fun),nil) | → | nil | (6) |
app(app(filter,fun),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(fun,x)),fun),x),xs) | (7) |
app(app(app(app(filter2,true),fun),x),xs) | → | app(app(cons,x),app(app(filter,fun),xs)) | (8) |
app(app(app(app(filter2,false),fun),x),xs) | → | app(app(filter,fun),xs) | (9) |
app#(app(app(f,app(app(g,x),y)),x),z) | → | app#(app(app(f,z),z),z) | (10) |
app#(app(app(f,app(app(g,x),y)),x),z) | → | app#(app(f,z),z) | (11) |
app#(app(app(f,app(app(g,x),y)),x),z) | → | app#(f,z) | (12) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(cons,app(fun,x)),app(app(map,fun),xs)) | (13) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(cons,app(fun,x)) | (14) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (15) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (16) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (17) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(filter2,app(fun,x)),fun),x) | (18) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(filter2,app(fun,x)),fun) | (19) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(filter2,app(fun,x)) | (20) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (21) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(cons,x),app(app(filter,fun),xs)) | (22) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(cons,x) | (23) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (24) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(filter,fun) | (25) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (26) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(filter,fun) | (27) |
The dependency pairs are split into 1 component.
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (16) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (15) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (17) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (24) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (21) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (26) |
We restrict the rewrite rules to the following usable rules of the DP problem.
app(app(g,x),y) | → | x | (2) |
app(app(g,x),y) | → | y | (3) |
app(app(map,fun),nil) | → | nil | (4) |
app(app(map,fun),app(app(cons,x),xs)) | → | app(app(cons,app(fun,x)),app(app(map,fun),xs)) | (5) |
app(app(filter,fun),nil) | → | nil | (6) |
app(app(filter,fun),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(fun,x)),fun),x),xs) | (7) |
app(app(app(app(filter2,false),fun),x),xs) | → | app(app(filter,fun),xs) | (9) |
app(app(app(app(filter2,true),fun),x),xs) | → | app(app(cons,x),app(app(filter,fun),xs)) | (8) |
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) | (21) |
1 | > | 1 | |
2 | > | 2 | |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (15) |
1 | > | 1 | |
2 | > | 2 | |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (16) |
1 | ≥ | 1 | |
2 | > | 2 | |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (17) |
2 | > | 2 | |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (24) |
2 | ≥ | 2 | |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (26) |
2 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.