The rewrite relation of the following TRS is considered.
app(nil,k) | → | k | (1) |
app(l,nil) | → | l | (2) |
app(cons(x,l),k) | → | cons(x,app(l,k)) | (3) |
sum(cons(x,nil)) | → | cons(x,nil) | (4) |
sum(cons(x,cons(y,l))) | → | sum(cons(plus(x,y),l)) | (5) |
sum(app(l,cons(x,cons(y,k)))) | → | sum(app(l,sum(cons(x,cons(y,k))))) | (6) |
sum(plus(cons(0,x),cons(y,l))) | → | pred(sum(cons(s(x),cons(y,l)))) | (7) |
pred(cons(s(x),nil)) | → | cons(x,nil) | (8) |
plus(s(x),s(y)) | → | s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) | (9) |
plus(s(x),x) | → | plus(if(gt(x,x),id(x),id(x)),s(x)) | (10) |
plus(zero,y) | → | y | (11) |
plus(id(x),s(y)) | → | s(plus(x,if(gt(s(y),y),y,s(y)))) | (12) |
id(x) | → | x | (13) |
if(true,x,y) | → | x | (14) |
if(false,x,y) | → | y | (15) |
not(x) | → | if(x,false,true) | (16) |
gt(s(x),zero) | → | true | (17) |
gt(zero,y) | → | false | (18) |
gt(s(x),s(y)) | → | gt(x,y) | (19) |
app#(cons(x,l),k) | → | app#(l,k) | (20) |
sum#(cons(x,cons(y,l))) | → | sum#(cons(plus(x,y),l)) | (21) |
sum#(cons(x,cons(y,l))) | → | plus#(x,y) | (22) |
sum#(app(l,cons(x,cons(y,k)))) | → | sum#(app(l,sum(cons(x,cons(y,k))))) | (23) |
sum#(app(l,cons(x,cons(y,k)))) | → | app#(l,sum(cons(x,cons(y,k)))) | (24) |
sum#(app(l,cons(x,cons(y,k)))) | → | sum#(cons(x,cons(y,k))) | (25) |
sum#(plus(cons(0,x),cons(y,l))) | → | pred#(sum(cons(s(x),cons(y,l)))) | (26) |
sum#(plus(cons(0,x),cons(y,l))) | → | sum#(cons(s(x),cons(y,l))) | (27) |
plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (28) |
plus#(s(x),s(y)) | → | if#(gt(x,y),x,y) | (29) |
plus#(s(x),s(y)) | → | gt#(x,y) | (30) |
plus#(s(x),s(y)) | → | if#(not(gt(x,y)),id(x),id(y)) | (31) |
plus#(s(x),s(y)) | → | not#(gt(x,y)) | (32) |
plus#(s(x),s(y)) | → | id#(x) | (33) |
plus#(s(x),s(y)) | → | id#(y) | (34) |
plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (35) |
plus#(s(x),x) | → | if#(gt(x,x),id(x),id(x)) | (36) |
plus#(s(x),x) | → | gt#(x,x) | (37) |
plus#(s(x),x) | → | id#(x) | (38) |
plus#(id(x),s(y)) | → | plus#(x,if(gt(s(y),y),y,s(y))) | (39) |
plus#(id(x),s(y)) | → | if#(gt(s(y),y),y,s(y)) | (40) |
plus#(id(x),s(y)) | → | gt#(s(y),y) | (41) |
not#(x) | → | if#(x,false,true) | (42) |
gt#(s(x),s(y)) | → | gt#(x,y) | (43) |
The dependency pairs are split into 5 components.
sum#(app(l,cons(x,cons(y,k)))) | → | sum#(app(l,sum(cons(x,cons(y,k))))) | (23) |
prec(app) | = | 2 | weight(app) | = | 1 | ||||
prec(cons) | = | 1 | weight(cons) | = | 3 | ||||
prec(sum) | = | 0 | weight(sum) | = | 5 | ||||
prec(nil) | = | 3 | weight(nil) | = | 1 |
π(sum#) | = | 1 |
π(app) | = | [1,2] |
π(cons) | = | [2] |
π(sum) | = | [] |
π(nil) | = | [] |
sum(cons(x,cons(y,l))) | → | sum(cons(plus(x,y),l)) | (5) |
app(nil,k) | → | k | (1) |
app(l,nil) | → | l | (2) |
app(cons(x,l),k) | → | cons(x,app(l,k)) | (3) |
sum(cons(x,nil)) | → | cons(x,nil) | (4) |
sum#(app(l,cons(x,cons(y,k)))) | → | sum#(app(l,sum(cons(x,cons(y,k))))) | (23) |
There are no pairs anymore.
sum#(cons(x,cons(y,l))) | → | sum#(cons(plus(x,y),l)) | (21) |
prec(cons) | = | 1 | weight(cons) | = | 1 |
π(sum#) | = | 1 |
π(cons) | = | [2] |
sum#(cons(x,cons(y,l))) | → | sum#(cons(plus(x,y),l)) | (21) |
There are no pairs anymore.
plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (35) |
plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (28) |
plus#(id(x),s(y)) | → | plus#(x,if(gt(s(y),y),y,s(y))) | (39) |
[plus#(x1, x2)] | = |
|
||||||||||||||||
[s(x1)] | = |
|
||||||||||||||||
[if(x1, x2, x3)] | = |
|
||||||||||||||||
[gt(x1, x2)] | = |
|
||||||||||||||||
[id(x1)] | = |
|
||||||||||||||||
[not(x1)] | = |
|
||||||||||||||||
[zero] | = |
|
||||||||||||||||
[true] | = |
|
||||||||||||||||
[false] | = |
|
gt(s(x),zero) | → | true | (17) |
gt(zero,y) | → | false | (18) |
gt(s(x),s(y)) | → | gt(x,y) | (19) |
id(x) | → | x | (13) |
if(true,x,y) | → | x | (14) |
if(false,x,y) | → | y | (15) |
not(x) | → | if(x,false,true) | (16) |
plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (35) |
[plus#(x1, x2)] | = |
|
||||||||||||||||
[s(x1)] | = |
|
||||||||||||||||
[if(x1, x2, x3)] | = |
|
||||||||||||||||
[gt(x1, x2)] | = |
|
||||||||||||||||
[not(x1)] | = |
|
||||||||||||||||
[id(x1)] | = |
|
||||||||||||||||
[zero] | = |
|
||||||||||||||||
[true] | = |
|
||||||||||||||||
[false] | = |
|
if(true,x,y) | → | x | (14) |
if(false,x,y) | → | y | (15) |
id(x) | → | x | (13) |
plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (28) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
plus#(id(x),s(y)) | → | plus#(x,if(gt(s(y),y),y,s(y))) | (39) |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
app#(cons(x,l),k) | → | app#(l,k) | (20) |
[cons(x1, x2)] | = | 1 · x1 + 1 · x2 |
[app#(x1, x2)] | = | 1 · x1 + 1 · x2 |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
app#(cons(x,l),k) | → | app#(l,k) | (20) |
1 | > | 1 | |
2 | ≥ | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
gt#(s(x),s(y)) | → | gt#(x,y) | (43) |
[s(x1)] | = | 1 · x1 |
[gt#(x1, x2)] | = | 1 · x1 + 1 · x2 |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
gt#(s(x),s(y)) | → | gt#(x,y) | (43) |
1 | > | 1 | |
2 | > | 2 |
As there is no critical graph in the transitive closure, there are no infinite chains.