The rewrite relation of the following TRS is considered.
and(true,y) | → | y | (1) |
and(false,y) | → | false | (2) |
eq(nil,nil) | → | true | (3) |
eq(cons(t,l),nil) | → | false | (4) |
eq(nil,cons(t,l)) | → | false | (5) |
eq(cons(t,l),cons(t',l')) | → | and(eq(t,t'),eq(l,l')) | (6) |
eq(var(l),var(l')) | → | eq(l,l') | (7) |
eq(var(l),apply(t,s)) | → | false | (8) |
eq(var(l),lambda(x,t)) | → | false | (9) |
eq(apply(t,s),var(l)) | → | false | (10) |
eq(apply(t,s),apply(t',s')) | → | and(eq(t,t'),eq(s,s')) | (11) |
eq(apply(t,s),lambda(x,t)) | → | false | (12) |
eq(lambda(x,t),var(l)) | → | false | (13) |
eq(lambda(x,t),apply(t,s)) | → | false | (14) |
eq(lambda(x,t),lambda(x',t')) | → | and(eq(x,x'),eq(t,t')) | (15) |
if(true,var(k),var(l')) | → | var(k) | (16) |
if(false,var(k),var(l')) | → | var(l') | (17) |
ren(var(l),var(k),var(l')) | → | if(eq(l,l'),var(k),var(l')) | (18) |
ren(x,y,apply(t,s)) | → | apply(ren(x,y,t),ren(x,y,s)) | (19) |
ren(x,y,lambda(z,t)) | → | lambda(var(cons(x,cons(y,cons(lambda(z,t),nil)))),ren(x,y,ren(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t))) | (20) |
eq#(cons(t,l),cons(t',l')) | → | eq#(l,l') | (21) |
eq#(cons(t,l),cons(t',l')) | → | eq#(t,t') | (22) |
eq#(cons(t,l),cons(t',l')) | → | and#(eq(t,t'),eq(l,l')) | (23) |
eq#(var(l),var(l')) | → | eq#(l,l') | (24) |
eq#(apply(t,s),apply(t',s')) | → | eq#(s,s') | (25) |
eq#(apply(t,s),apply(t',s')) | → | eq#(t,t') | (26) |
eq#(apply(t,s),apply(t',s')) | → | and#(eq(t,t'),eq(s,s')) | (27) |
eq#(lambda(x,t),lambda(x',t')) | → | eq#(t,t') | (28) |
eq#(lambda(x,t),lambda(x',t')) | → | eq#(x,x') | (29) |
eq#(lambda(x,t),lambda(x',t')) | → | and#(eq(x,x'),eq(t,t')) | (30) |
ren#(var(l),var(k),var(l')) | → | eq#(l,l') | (31) |
ren#(var(l),var(k),var(l')) | → | if#(eq(l,l'),var(k),var(l')) | (32) |
ren#(x,y,apply(t,s)) | → | ren#(x,y,s) | (33) |
ren#(x,y,apply(t,s)) | → | ren#(x,y,t) | (34) |
ren#(x,y,lambda(z,t)) | → | ren#(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t) | (35) |
ren#(x,y,lambda(z,t)) | → | ren#(x,y,ren(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t)) | (36) |
The dependency pairs are split into 2 components.
ren#(x,y,lambda(z,t)) | → | ren#(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t) | (35) |
ren#(x,y,apply(t,s)) | → | ren#(x,y,s) | (33) |
ren#(x,y,apply(t,s)) | → | ren#(x,y,t) | (34) |
ren#(x,y,lambda(z,t)) | → | ren#(x,y,ren(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t)) | (36) |
prec(ren#) | = | 0 | stat(ren#) | = | lex | |
prec(ren) | = | 0 | stat(ren) | = | lex | |
prec(if) | = | 0 | stat(if) | = | lex | |
prec(lambda) | = | 0 | stat(lambda) | = | lex | |
prec(apply) | = | 0 | stat(apply) | = | lex | |
prec(var) | = | 0 | stat(var) | = | lex | |
prec(cons) | = | 0 | stat(cons) | = | lex | |
prec(eq) | = | 0 | stat(eq) | = | lex | |
prec(nil) | = | 0 | stat(nil) | = | lex | |
prec(false) | = | 0 | stat(false) | = | lex | |
prec(and) | = | 0 | stat(and) | = | lex | |
prec(true) | = | 0 | stat(true) | = | lex |
π(ren#) | = | 3 |
π(ren) | = | 3 |
π(if) | = | 2 |
π(lambda) | = | 2 |
π(apply) | = | [1,2] |
π(var) | = | [] |
π(cons) | = | [] |
π(eq) | = | [] |
π(nil) | = | [] |
π(false) | = | [] |
π(and) | = | 2 |
π(true) | = | [] |
if(true,var(k),var(l')) | → | var(k) | (16) |
if(false,var(k),var(l')) | → | var(l') | (17) |
ren(var(l),var(k),var(l')) | → | if(eq(l,l'),var(k),var(l')) | (18) |
ren(x,y,apply(t,s)) | → | apply(ren(x,y,t),ren(x,y,s)) | (19) |
ren(x,y,lambda(z,t)) | → | lambda(var(cons(x,cons(y,cons(lambda(z,t),nil)))),ren(x,y,ren(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t))) | (20) |
ren#(x,y,apply(t,s)) | → | ren#(x,y,s) | (33) |
ren#(x,y,apply(t,s)) | → | ren#(x,y,t) | (34) |
prec(ren#) | = | 0 | stat(ren#) | = | lex | |
prec(ren) | = | 0 | stat(ren) | = | lex | |
prec(if) | = | 0 | stat(if) | = | lex | |
prec(lambda) | = | 0 | stat(lambda) | = | lex | |
prec(apply) | = | 0 | stat(apply) | = | lex | |
prec(var) | = | 0 | stat(var) | = | lex | |
prec(cons) | = | 0 | stat(cons) | = | lex | |
prec(eq) | = | 0 | stat(eq) | = | lex | |
prec(nil) | = | 0 | stat(nil) | = | lex | |
prec(false) | = | 0 | stat(false) | = | lex | |
prec(and) | = | 0 | stat(and) | = | lex | |
prec(true) | = | 0 | stat(true) | = | lex |
π(ren#) | = | 3 |
π(ren) | = | 3 |
π(if) | = | 2 |
π(lambda) | = | [2] |
π(apply) | = | 1 |
π(var) | = | [] |
π(cons) | = | 2 |
π(eq) | = | 1 |
π(nil) | = | [] |
π(false) | = | [] |
π(and) | = | [] |
π(true) | = | [] |
if(true,var(k),var(l')) | → | var(k) | (16) |
if(false,var(k),var(l')) | → | var(l') | (17) |
ren(var(l),var(k),var(l')) | → | if(eq(l,l'),var(k),var(l')) | (18) |
ren(x,y,apply(t,s)) | → | apply(ren(x,y,t),ren(x,y,s)) | (19) |
ren(x,y,lambda(z,t)) | → | lambda(var(cons(x,cons(y,cons(lambda(z,t),nil)))),ren(x,y,ren(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t))) | (20) |
ren#(x,y,lambda(z,t)) | → | ren#(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t) | (35) |
ren#(x,y,lambda(z,t)) | → | ren#(x,y,ren(z,var(cons(x,cons(y,cons(lambda(z,t),nil)))),t)) | (36) |
There are no pairs anymore.
eq#(cons(t,l),cons(t',l')) | → | eq#(l,l') | (21) |
eq#(cons(t,l),cons(t',l')) | → | eq#(t,t') | (22) |
eq#(var(l),var(l')) | → | eq#(l,l') | (24) |
eq#(apply(t,s),apply(t',s')) | → | eq#(s,s') | (25) |
eq#(apply(t,s),apply(t',s')) | → | eq#(t,t') | (26) |
eq#(lambda(x,t),lambda(x',t')) | → | eq#(t,t') | (28) |
eq#(lambda(x,t),lambda(x',t')) | → | eq#(x,x') | (29) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
eq#(cons(t,l),cons(t',l')) | → | eq#(l,l') | (21) |
2 | > | 2 | |
1 | > | 1 | |
eq#(cons(t,l),cons(t',l')) | → | eq#(t,t') | (22) |
2 | > | 2 | |
1 | > | 1 | |
eq#(var(l),var(l')) | → | eq#(l,l') | (24) |
2 | > | 2 | |
1 | > | 1 | |
eq#(apply(t,s),apply(t',s')) | → | eq#(s,s') | (25) |
2 | > | 2 | |
1 | > | 1 | |
eq#(apply(t,s),apply(t',s')) | → | eq#(t,t') | (26) |
2 | > | 2 | |
1 | > | 1 | |
eq#(lambda(x,t),lambda(x',t')) | → | eq#(t,t') | (28) |
2 | > | 2 | |
1 | > | 1 | |
eq#(lambda(x,t),lambda(x',t')) | → | eq#(x,x') | (29) |
2 | > | 2 | |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.