The rewrite relation of the following TRS is considered.
app(app(app(f,x),app(c,x)),app(c,y)) | → | app(app(app(f,y),y),app(app(app(f,y),x),y)) | (1) |
app(app(app(f,app(s,x)),y),z) | → | app(app(app(f,x),app(s,app(c,y))),app(c,z)) | (2) |
app(app(app(f,app(c,x)),x),y) | → | app(c,y) | (3) |
app(app(g,x),y) | → | x | (4) |
app(app(g,x),y) | → | y | (5) |
app(app(map,fun),nil) | → | nil | (6) |
app(app(map,fun),app(app(cons,x),xs)) | → | app(app(cons,app(fun,x)),app(app(map,fun),xs)) | (7) |
app(app(filter,fun),nil) | → | nil | (8) |
app(app(filter,fun),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(fun,x)),fun),x),xs) | (9) |
app(app(app(app(filter2,true),fun),x),xs) | → | app(app(cons,x),app(app(filter,fun),xs)) | (10) |
app(app(app(app(filter2,false),fun),x),xs) | → | app(app(filter,fun),xs) | (11) |
app#(app(app(f,x),app(c,x)),app(c,y)) | → | app#(app(app(f,y),y),app(app(app(f,y),x),y)) | (12) |
app#(app(app(f,x),app(c,x)),app(c,y)) | → | app#(app(f,y),y) | (13) |
app#(app(app(f,x),app(c,x)),app(c,y)) | → | app#(f,y) | (14) |
app#(app(app(f,x),app(c,x)),app(c,y)) | → | app#(app(app(f,y),x),y) | (15) |
app#(app(app(f,x),app(c,x)),app(c,y)) | → | app#(app(f,y),x) | (16) |
app#(app(app(f,app(s,x)),y),z) | → | app#(app(app(f,x),app(s,app(c,y))),app(c,z)) | (17) |
app#(app(app(f,app(s,x)),y),z) | → | app#(app(f,x),app(s,app(c,y))) | (18) |
app#(app(app(f,app(s,x)),y),z) | → | app#(f,x) | (19) |
app#(app(app(f,app(s,x)),y),z) | → | app#(s,app(c,y)) | (20) |
app#(app(app(f,app(s,x)),y),z) | → | app#(c,y) | (21) |
app#(app(app(f,app(s,x)),y),z) | → | app#(c,z) | (22) |
app#(app(app(f,app(c,x)),x),y) | → | app#(c,y) | (23) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(cons,app(fun,x)),app(app(map,fun),xs)) | (24) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(cons,app(fun,x)) | (25) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (26) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (27) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (28) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(filter2,app(fun,x)),fun),x) | (29) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(filter2,app(fun,x)),fun) | (30) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(filter2,app(fun,x)) | (31) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (32) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(cons,x),app(app(filter,fun),xs)) | (33) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(cons,x) | (34) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (35) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(filter,fun) | (36) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (37) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(filter,fun) | (38) |
The dependency pairs are split into 3 components.
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (27) |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (26) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (28) |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (35) |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (32) |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (37) |
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) | (32) |
1 | > | 1 | |
2 | > | 2 | |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(fun,x) | (26) |
1 | > | 1 | |
2 | > | 2 | |
app#(app(map,fun),app(app(cons,x),xs)) | → | app#(app(map,fun),xs) | (27) |
1 | ≥ | 1 | |
2 | > | 2 | |
app#(app(filter,fun),app(app(cons,x),xs)) | → | app#(app(app(app(filter2,app(fun,x)),fun),x),xs) | (28) |
2 | > | 2 | |
app#(app(app(app(filter2,true),fun),x),xs) | → | app#(app(filter,fun),xs) | (35) |
2 | ≥ | 2 | |
app#(app(app(app(filter2,false),fun),x),xs) | → | app#(app(filter,fun),xs) | (37) |
2 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
app#(app(app(f,x),app(c,x)),app(c,y)) | → | app#(app(app(f,y),x),y) | (15) |
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
app#(app(app(f,x),app(c,x)),app(c,y)) | → | app#(app(app(f,y),x),y) | (15) |
2 | > | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
app#(app(app(f,app(s,x)),y),z) | → | app#(app(app(f,x),app(s,app(c,y))),app(c,z)) | (17) |
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
[app#(x1, x2)] | = | 2 · x1 + 1 · x2 |
[app(x1, x2)] | = | 2 · x1 + 1 · x2 |
[f] | = | 0 |
[s] | = | 2 |
[c] | = | 0 |
app#(app(app(f,app(s,x)),y),z) | → | app#(app(app(f,x),app(s,app(c,y))),app(c,z)) | (17) |
app(app(app(f,x),app(c,x)),app(c,y)) | → | app(app(app(f,y),y),app(app(app(f,y),x),y)) | (1) |
app(app(app(f,app(s,x)),y),z) | → | app(app(app(f,x),app(s,app(c,y))),app(c,z)) | (2) |
app(app(app(f,app(c,x)),x),y) | → | app(c,y) | (3) |
app(app(g,x),y) | → | x | (4) |
app(app(g,x),y) | → | y | (5) |
app(app(map,fun),nil) | → | nil | (6) |
app(app(map,fun),app(app(cons,x),xs)) | → | app(app(cons,app(fun,x)),app(app(map,fun),xs)) | (7) |
app(app(filter,fun),nil) | → | nil | (8) |
app(app(filter,fun),app(app(cons,x),xs)) | → | app(app(app(app(filter2,app(fun,x)),fun),x),xs) | (9) |
app(app(app(app(filter2,true),fun),x),xs) | → | app(app(cons,x),app(app(filter,fun),xs)) | (10) |
app(app(app(app(filter2,false),fun),x),xs) | → | app(app(filter,fun),xs) | (11) |
There are no pairs anymore.