The rewrite relation of the following TRS is considered.
times(x,plus(y,1)) | → | plus(times(x,plus(y,times(1,0))),x) | (1) |
times(x,1) | → | x | (2) |
times(x,0) | → | 0 | (3) |
plus(s(x),s(y)) | → | s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) | (4) |
plus(s(x),x) | → | plus(if(gt(x,x),id(x),id(x)),s(x)) | (5) |
plus(zero,y) | → | y | (6) |
plus(id(x),s(y)) | → | s(plus(x,if(gt(s(y),y),y,s(y)))) | (7) |
id(x) | → | x | (8) |
if(true,x,y) | → | x | (9) |
if(false,x,y) | → | y | (10) |
not(x) | → | if(x,false,true) | (11) |
gt(s(x),zero) | → | true | (12) |
gt(zero,y) | → | false | (13) |
gt(s(x),s(y)) | → | gt(x,y) | (14) |
times#(x,plus(y,1)) | → | times#(1,0) | (15) |
times#(x,plus(y,1)) | → | plus#(y,times(1,0)) | (16) |
times#(x,plus(y,1)) | → | times#(x,plus(y,times(1,0))) | (17) |
times#(x,plus(y,1)) | → | plus#(times(x,plus(y,times(1,0))),x) | (18) |
plus#(s(x),s(y)) | → | id#(y) | (19) |
plus#(s(x),s(y)) | → | id#(x) | (20) |
plus#(s(x),s(y)) | → | not#(gt(x,y)) | (21) |
plus#(s(x),s(y)) | → | if#(not(gt(x,y)),id(x),id(y)) | (22) |
plus#(s(x),s(y)) | → | gt#(x,y) | (23) |
plus#(s(x),s(y)) | → | if#(gt(x,y),x,y) | (24) |
plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (25) |
plus#(s(x),x) | → | id#(x) | (26) |
plus#(s(x),x) | → | gt#(x,x) | (27) |
plus#(s(x),x) | → | if#(gt(x,x),id(x),id(x)) | (28) |
plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (29) |
plus#(id(x),s(y)) | → | gt#(s(y),y) | (30) |
plus#(id(x),s(y)) | → | if#(gt(s(y),y),y,s(y)) | (31) |
plus#(id(x),s(y)) | → | plus#(x,if(gt(s(y),y),y,s(y))) | (32) |
not#(x) | → | if#(x,false,true) | (33) |
gt#(s(x),s(y)) | → | gt#(x,y) | (34) |
The dependency pairs are split into 3 components.
times#(x,plus(y,1)) | → | times#(x,plus(y,times(1,0))) | (17) |
[s(x1)] | = | 0 · x1 + 0 |
[id(x1)] | = | 0 · x1 + 1 |
[plus(x1, x2)] | = | 0 · x1 + 2 · x2 + 0 |
[0] | = | 0 |
[gt(x1, x2)] | = | 2 · x1 + 2 · x2 + 6 |
[true] | = | 0 |
[1] | = | 1 |
[not(x1)] | = | 0 · x1 + 1 |
[times#(x1, x2)] | = | 0 · x1 + 4 · x2 + 3 |
[false] | = | 6 |
[zero] | = | 3 |
[if(x1, x2, x3)] | = | 1 · x1 + 0 · x2 + 4 · x3 + 4 |
[times(x1, x2)] | = | 0 · x1 + 0 · x2 + 0 |
times(x,0) | → | 0 | (3) |
plus(s(x),s(y)) | → | s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) | (4) |
plus(s(x),x) | → | plus(if(gt(x,x),id(x),id(x)),s(x)) | (5) |
plus(zero,y) | → | y | (6) |
plus(id(x),s(y)) | → | s(plus(x,if(gt(s(y),y),y,s(y)))) | (7) |
times#(x,plus(y,1)) | → | times#(x,plus(y,times(1,0))) | (17) |
There are no pairs anymore.
plus#(id(x),s(y)) | → | plus#(x,if(gt(s(y),y),y,s(y))) | (32) |
plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (29) |
plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (25) |
[s(x1)] | = | 4 · x1 + 6 |
[id(x1)] | = | 0 · x1 + 4 |
[gt(x1, x2)] | = | -∞ · x1 + -∞ · x2 + 0 |
[true] | = | 0 |
[not(x1)] | = | 0 · x1 + 4 |
[false] | = | 0 |
[zero] | = | 5 |
[plus#(x1, x2)] | = | 0 · x1 + 0 · x2 + 0 |
[if(x1, x2, x3)] | = | 0 · x1 + 0 · x2 + 0 · x3 + 1 |
gt(s(x),zero) | → | true | (12) |
gt(s(x),s(y)) | → | gt(x,y) | (14) |
gt(zero,y) | → | false | (13) |
if(true,x,y) | → | x | (9) |
if(false,x,y) | → | y | (10) |
id(x) | → | x | (8) |
not(x) | → | if(x,false,true) | (11) |
plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (25) |
prec(plus#) | = | 0 | stat(plus#) | = | lex | |
prec(false) | = | 0 | stat(false) | = | lex | |
prec(true) | = | 0 | stat(true) | = | lex | |
prec(zero) | = | 0 | stat(zero) | = | lex | |
prec(id) | = | 0 | stat(id) | = | lex | |
prec(if) | = | 0 | stat(if) | = | lex | |
prec(gt) | = | 0 | stat(gt) | = | lex | |
prec(s) | = | 5 | stat(s) | = | lex |
π(plus#) | = | [1] |
π(false) | = | [] |
π(true) | = | [] |
π(zero) | = | [] |
π(id) | = | 1 |
π(if) | = | [2,3] |
π(gt) | = | 1 |
π(s) | = | [1] |
if(true,x,y) | → | x | (9) |
if(false,x,y) | → | y | (10) |
id(x) | → | x | (8) |
plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (29) |
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))) | (32) |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
gt#(s(x),s(y)) | → | gt#(x,y) | (34) |
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) | (34) |
2 | > | 2 | |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.