The rewrite relation of the following TRS is considered.
+(0,y) | → | y | (1) |
+(s(x),y) | → | s(+(x,y)) | (2) |
++(nil,ys) | → | ys | (3) |
++(:(x,xs),ys) | → | :(x,++(xs,ys)) | (4) |
sum(:(x,nil)) | → | :(x,nil) | (5) |
sum(:(x,:(y,xs))) | → | sum(:(+(x,y),xs)) | (6) |
sum(++(xs,:(x,:(y,ys)))) | → | sum(++(xs,sum(:(x,:(y,ys))))) | (7) |
-(x,0) | → | x | (8) |
-(0,s(y)) | → | 0 | (9) |
-(s(x),s(y)) | → | -(x,y) | (10) |
quot(0,s(y)) | → | 0 | (11) |
quot(s(x),s(y)) | → | s(quot(-(x,y),s(y))) | (12) |
length(nil) | → | 0 | (13) |
length(:(x,xs)) | → | s(length(xs)) | (14) |
hd(:(x,xs)) | → | x | (15) |
avg(xs) | → | quot(hd(sum(xs)),length(xs)) | (16) |
+#(s(x),y) | → | +#(x,y) | (17) |
++#(:(x,xs),ys) | → | ++#(xs,ys) | (18) |
sum#(:(x,:(y,xs))) | → | +#(x,y) | (19) |
sum#(:(x,:(y,xs))) | → | sum#(:(+(x,y),xs)) | (20) |
sum#(++(xs,:(x,:(y,ys)))) | → | sum#(:(x,:(y,ys))) | (21) |
sum#(++(xs,:(x,:(y,ys)))) | → | ++#(xs,sum(:(x,:(y,ys)))) | (22) |
sum#(++(xs,:(x,:(y,ys)))) | → | sum#(++(xs,sum(:(x,:(y,ys))))) | (23) |
-#(s(x),s(y)) | → | -#(x,y) | (24) |
quot#(s(x),s(y)) | → | -#(x,y) | (25) |
quot#(s(x),s(y)) | → | quot#(-(x,y),s(y)) | (26) |
length#(:(x,xs)) | → | length#(xs) | (27) |
avg#(xs) | → | length#(xs) | (28) |
avg#(xs) | → | sum#(xs) | (29) |
avg#(xs) | → | hd#(sum(xs)) | (30) |
avg#(xs) | → | quot#(hd(sum(xs)),length(xs)) | (31) |
The dependency pairs are split into 7 components.
sum#(++(xs,:(x,:(y,ys)))) | → | sum#(++(xs,sum(:(x,:(y,ys))))) | (23) |
[++(x1, x2)] | = | 1 · x1 + 2 · x2 + 6 |
[+(x1, x2)] | = | 0 · x1 + 0 · x2 + 0 |
[nil] | = | 0 |
[:(x1, x2)] | = | 0 · x1 + 1 · x2 + 1 |
[0] | = | 0 |
[sum#(x1)] | = | 1 · x1 + 6 |
[sum(x1)] | = | 0 · x1 + 1 |
[s(x1)] | = | 0 · x1 + 0 |
sum(:(x,:(y,xs))) | → | sum(:(+(x,y),xs)) | (6) |
sum(:(x,nil)) | → | :(x,nil) | (5) |
++(nil,ys) | → | ys | (3) |
++(:(x,xs),ys) | → | :(x,++(xs,ys)) | (4) |
sum#(++(xs,:(x,:(y,ys)))) | → | sum#(++(xs,sum(:(x,:(y,ys))))) | (23) |
There are no pairs anymore.
sum#(:(x,:(y,xs))) | → | sum#(:(+(x,y),xs)) | (20) |
prec(sum#) | = | 0 | stat(sum#) | = | lex | |
prec(:) | = | 0 | stat(:) | = | lex | |
prec(s) | = | 0 | stat(s) | = | lex | |
prec(+) | = | 0 | stat(+) | = | lex | |
prec(0) | = | 0 | stat(0) | = | lex |
π(sum#) | = | 1 |
π(:) | = | [2] |
π(s) | = | 1 |
π(+) | = | 2 |
π(0) | = | [] |
sum#(:(x,:(y,xs))) | → | sum#(:(+(x,y),xs)) | (20) |
There are no pairs anymore.
+#(s(x),y) | → | +#(x,y) | (17) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
+#(s(x),y) | → | +#(x,y) | (17) |
2 | ≥ | 2 | |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
++#(:(x,xs),ys) | → | ++#(xs,ys) | (18) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
++#(:(x,xs),ys) | → | ++#(xs,ys) | (18) |
2 | ≥ | 2 | |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
quot#(s(x),s(y)) | → | quot#(-(x,y),s(y)) | (26) |
π(quot#) | = | { 1 } |
π(-) | = | { 1 } |
quot#(s(x),s(y)) | → | quot#(-(x,y),s(y)) | (26) |
There are no pairs anymore.
-#(s(x),s(y)) | → | -#(x,y) | (24) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
-#(s(x),s(y)) | → | -#(x,y) | (24) |
2 | > | 2 | |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
length#(:(x,xs)) | → | length#(xs) | (27) |
Using size-change termination in combination with the subterm criterion one obtains the following initial size-change graphs.
length#(:(x,xs)) | → | length#(xs) | (27) |
1 | > | 1 |
As there is no critical graph in the transitive closure, there are no infinite chains.