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) |
| plus(s(x),s(y)) | → | s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) | (7) |
| plus(s(x),x) | → | plus(if(gt(x,x),id(x),id(x)),s(x)) | (8) |
| plus(zero,y) | → | y | (9) |
| plus(id(x),s(y)) | → | s(plus(x,if(gt(s(y),y),y,s(y)))) | (10) |
| id(x) | → | x | (11) |
| if(true,x,y) | → | x | (12) |
| if(false,x,y) | → | y | (13) |
| not(x) | → | if(x,false,true) | (14) |
| gt(s(x),zero) | → | true | (15) |
| gt(zero,y) | → | false | (16) |
| gt(s(x),s(y)) | → | gt(x,y) | (17) |
| app#(cons(x,l),k) | → | app#(l,k) | (18) |
| sum#(cons(x,cons(y,l))) | → | plus#(x,y) | (19) |
| sum#(cons(x,cons(y,l))) | → | sum#(cons(plus(x,y),l)) | (20) |
| sum#(app(l,cons(x,cons(y,k)))) | → | sum#(cons(x,cons(y,k))) | (21) |
| sum#(app(l,cons(x,cons(y,k)))) | → | app#(l,sum(cons(x,cons(y,k)))) | (22) |
| sum#(app(l,cons(x,cons(y,k)))) | → | sum#(app(l,sum(cons(x,cons(y,k))))) | (23) |
| plus#(s(x),s(y)) | → | id#(y) | (24) |
| plus#(s(x),s(y)) | → | id#(x) | (25) |
| plus#(s(x),s(y)) | → | not#(gt(x,y)) | (26) |
| plus#(s(x),s(y)) | → | if#(not(gt(x,y)),id(x),id(y)) | (27) |
| plus#(s(x),s(y)) | → | gt#(x,y) | (28) |
| plus#(s(x),s(y)) | → | if#(gt(x,y),x,y) | (29) |
| plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (30) |
| plus#(s(x),x) | → | id#(x) | (31) |
| plus#(s(x),x) | → | gt#(x,x) | (32) |
| plus#(s(x),x) | → | if#(gt(x,x),id(x),id(x)) | (33) |
| plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (34) |
| plus#(id(x),s(y)) | → | gt#(s(y),y) | (35) |
| plus#(id(x),s(y)) | → | if#(gt(s(y),y),y,s(y)) | (36) |
| plus#(id(x),s(y)) | → | plus#(x,if(gt(s(y),y),y,s(y))) | (37) |
| not#(x) | → | if#(x,false,true) | (38) |
| gt#(s(x),s(y)) | → | gt#(x,y) | (39) |
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) |
| [plus(x1, x2)] | = | 0 · x1 + 0 · x2 + 3 |
| [not(x1)] | = | 2 · x1 + 7 |
| [app(x1, x2)] | = | 1 · x1 + 1 · x2 + 1 |
| [sum(x1)] | = | 0 · x1 + 1 |
| [s(x1)] | = | 2 · x1 + 6 |
| [zero] | = | 0 |
| [nil] | = | 0 |
| [if(x1, x2, x3)] | = | 1 · x1 + 4 · x2 + 0 · x3 + 7 |
| [sum#(x1)] | = | 5 · x1 + 2 |
| [false] | = | 1 |
| [true] | = | 2 |
| [id(x1)] | = | 0 · x1 + 2 |
| [gt(x1, x2)] | = | 2 · x1 + 0 · x2 + 1 |
| [cons(x1, x2)] | = | 0 · x1 + 1 · x2 + 1 |
| sum(cons(x,cons(y,l))) | → | sum(cons(plus(x,y),l)) | (5) |
| sum(cons(x,nil)) | → | cons(x,nil) | (4) |
| app(nil,k) | → | k | (1) |
| app(l,nil) | → | l | (2) |
| app(cons(x,l),k) | → | cons(x,app(l,k)) | (3) |
| sum#(app(l,cons(x,cons(y,k)))) | → | sum#(app(l,sum(cons(x,cons(y,k))))) | (23) |
There are no pairs anymore.
| app#(cons(x,l),k) | → | app#(l,k) | (18) |
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) | (18) |
| 2 | ≥ | 2 | |
| 1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
| sum#(cons(x,cons(y,l))) | → | sum#(cons(plus(x,y),l)) | (20) |
| prec(sum#) | = | 0 | stat(sum#) | = | 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(not) | = | 0 | stat(not) | = | lex | |
| prec(if) | = | 0 | stat(if) | = | lex | |
| prec(gt) | = | 0 | stat(gt) | = | lex | |
| prec(s) | = | 0 | stat(s) | = | lex | |
| prec(plus) | = | 0 | stat(plus) | = | lex | |
| prec(cons) | = | 0 | stat(cons) | = | lex |
| π(sum#) | = | [1] |
| π(false) | = | [] |
| π(true) | = | [] |
| π(zero) | = | [] |
| π(id) | = | [] |
| π(not) | = | 1 |
| π(if) | = | [] |
| π(gt) | = | [] |
| π(s) | = | [] |
| π(plus) | = | 2 |
| π(cons) | = | [2] |
| sum#(cons(x,cons(y,l))) | → | sum#(cons(plus(x,y),l)) | (20) |
There are no pairs anymore.
| plus#(id(x),s(y)) | → | plus#(x,if(gt(s(y),y),y,s(y))) | (37) |
| plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (34) |
| plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (30) |
| [plus#(x1, x2)] | = | 1 · x1 + 0 · x2 + 0 |
| [not(x1)] | = | 4 · x1 + 0 |
| [s(x1)] | = | 4 · x1 + 0 |
| [zero] | = | 0 |
| [if(x1, x2, x3)] | = | 0 · x1 + 0 · x2 + 0 · x3 + -16 |
| [false] | = | 0 |
| [true] | = | 0 |
| [id(x1)] | = | 0 · x1 + -1 |
| [gt(x1, x2)] | = | 0 · x1 + 0 · x2 + -4 |
| gt(s(x),zero) | → | true | (15) |
| gt(s(x),s(y)) | → | gt(x,y) | (17) |
| gt(zero,y) | → | false | (16) |
| if(true,x,y) | → | x | (12) |
| if(false,x,y) | → | y | (13) |
| id(x) | → | x | (11) |
| not(x) | → | if(x,false,true) | (14) |
| plus#(s(x),x) | → | plus#(if(gt(x,x),id(x),id(x)),s(x)) | (34) |
| [plus#(x1, x2)] | = | 0 · x1 + 0 · x2 + -∞ |
| [not(x1)] | = | -∞ · x1 + 2 |
| [s(x1)] | = | 1 · x1 + -∞ |
| [zero] | = | 1 |
| [if(x1, x2, x3)] | = | -∞ · x1 + 0 · x2 + 0 · x3 + -∞ |
| [false] | = | 1 |
| [true] | = | 5 |
| [id(x1)] | = | 0 · x1 + -∞ |
| [gt(x1, x2)] | = | 0 · x1 + 4 · x2 + 3 |
| if(true,x,y) | → | x | (12) |
| if(false,x,y) | → | y | (13) |
| id(x) | → | x | (11) |
| plus#(s(x),s(y)) | → | plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) | (30) |
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))) | (37) |
| 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) | (39) |
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) | (39) |
| 2 | > | 2 | |
| 1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.