The rewrite relation of the following TRS is considered.
empty(nil) | → | true | (1) |
empty(cons(x,y)) | → | false | (2) |
tail(nil) | → | nil | (3) |
tail(cons(x,y)) | → | y | (4) |
head(cons(x,y)) | → | x | (5) |
zero(0) | → | true | (6) |
zero(s(x)) | → | false | (7) |
p(0) | → | 0 | (8) |
p(s(0)) | → | 0 | (9) |
p(s(s(x))) | → | s(p(s(x))) | (10) |
intlist(x) | → | if_intlist(empty(x),x) | (11) |
if_intlist(true,x) | → | nil | (12) |
if_intlist(false,x) | → | cons(s(head(x)),intlist(tail(x))) | (13) |
int(x,y) | → | if_int(zero(x),zero(y),x,y) | (14) |
if_int(true,b,x,y) | → | if1(b,x,y) | (15) |
if_int(false,b,x,y) | → | if2(b,x,y) | (16) |
if1(true,x,y) | → | cons(0,nil) | (17) |
if1(false,x,y) | → | cons(0,int(s(0),y)) | (18) |
if2(true,x,y) | → | nil | (19) |
if2(false,x,y) | → | intlist(int(p(x),p(y))) | (20) |
p#(s(s(x))) | → | p#(s(x)) | (21) |
intlist#(x) | → | empty#(x) | (22) |
intlist#(x) | → | if_intlist#(empty(x),x) | (23) |
if_intlist#(false,x) | → | tail#(x) | (24) |
if_intlist#(false,x) | → | intlist#(tail(x)) | (25) |
if_intlist#(false,x) | → | head#(x) | (26) |
int#(x,y) | → | zero#(y) | (27) |
int#(x,y) | → | zero#(x) | (28) |
int#(x,y) | → | if_int#(zero(x),zero(y),x,y) | (29) |
if_int#(true,b,x,y) | → | if1#(b,x,y) | (30) |
if_int#(false,b,x,y) | → | if2#(b,x,y) | (31) |
if1#(false,x,y) | → | int#(s(0),y) | (32) |
if2#(false,x,y) | → | p#(y) | (33) |
if2#(false,x,y) | → | p#(x) | (34) |
if2#(false,x,y) | → | int#(p(x),p(y)) | (35) |
if2#(false,x,y) | → | intlist#(int(p(x),p(y))) | (36) |
The dependency pairs are split into 3 components.
if2#(false,x,y) | → | int#(p(x),p(y)) | (35) |
int#(x,y) | → | if_int#(zero(x),zero(y),x,y) | (29) |
if_int#(true,b,x,y) | → | if1#(b,x,y) | (30) |
if1#(false,x,y) | → | int#(s(0),y) | (32) |
if_int#(false,b,x,y) | → | if2#(b,x,y) | (31) |
[false] | = | 5 |
[zero(x1)] | = | 4 · x1 + 0 |
[if1#(x1, x2, x3)] | = | -7 · x1 + -∞ · x2 + 1 · x3 + -∞ |
[if2#(x1, x2, x3)] | = | -4 · x1 + -5 · x2 + 0 · x3 + -∞ |
[p(x1)] | = | -1 · x1 + 0 |
[0] | = | 0 |
[if_int#(x1,...,x4)] | = | -∞ · x1 + -3 · x2 + -4 · x3 + 1 · x4 + -∞ |
[int#(x1, x2)] | = | -4 · x1 + 1 · x2 + -3 |
[s(x1)] | = | 1 · x1 + 1 |
[true] | = | 4 |
p(0) | → | 0 | (8) |
p(s(0)) | → | 0 | (9) |
p(s(s(x))) | → | s(p(s(x))) | (10) |
zero(0) | → | true | (6) |
zero(s(x)) | → | false | (7) |
if_int#(false,b,x,y) | → | if2#(b,x,y) | (31) |
The dependency pairs are split into 1 component.
int#(x,y) | → | if_int#(zero(x),zero(y),x,y) | (29) |
if_int#(true,b,x,y) | → | if1#(b,x,y) | (30) |
if1#(false,x,y) | → | int#(s(0),y) | (32) |
[false] | = | 1 |
[zero(x1)] | = | 0 · x1 + 1 |
[if1#(x1, x2, x3)] | = | -∞ · x1 + 0 · x2 + -∞ · x3 + 4 |
[0] | = | 3 |
[if_int#(x1,...,x4)] | = | 3 · x1 + -∞ · x2 + 3 · x3 + -∞ · x4 + 0 |
[int#(x1, x2)] | = | 3 · x1 + -∞ · x2 + 4 |
[s(x1)] | = | -3 · x1 + 0 |
[true] | = | 3 |
zero(0) | → | true | (6) |
zero(s(x)) | → | false | (7) |
if_int#(true,b,x,y) | → | if1#(b,x,y) | (30) |
The dependency pairs are split into 0 components.
intlist#(x) | → | if_intlist#(empty(x),x) | (23) |
if_intlist#(false,x) | → | intlist#(tail(x)) | (25) |
[false] | = | 2 |
[empty(x1)] | = | -6 · x1 + 0 |
[cons(x1, x2)] | = | 0 · x1 + 8 · x2 + 8 |
[intlist#(x1)] | = | 0 · x1 + 0 |
[tail(x1)] | = | -8 · x1 + 0 |
[nil] | = | 0 |
[if_intlist#(x1, x2)] | = | 0 · x1 + 0 · x2 + 0 |
[true] | = | 0 |
empty(nil) | → | true | (1) |
empty(cons(x,y)) | → | false | (2) |
tail(nil) | → | nil | (3) |
tail(cons(x,y)) | → | y | (4) |
if_intlist#(false,x) | → | intlist#(tail(x)) | (25) |
The dependency pairs are split into 0 components.
p#(s(s(x))) | → | p#(s(x)) | (21) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
p#(s(s(x))) | → | p#(s(x)) | (21) |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.