The rewrite relation of the following TRS is considered.
+#(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.
-
The
1st
component contains the
pair
sum#(++(xs,:(x,:(y,ys)))) |
→ |
sum#(++(xs,sum(:(x,:(y,ys))))) |
(23) |
1.1.1 Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[++(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 |
together with the usable
rules
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) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
sum#(++(xs,:(x,:(y,ys)))) |
→ |
sum#(++(xs,sum(:(x,:(y,ys))))) |
(23) |
could be deleted.
1.1.1.1 P is empty
There are no pairs anymore.
-
The
2nd
component contains the
pair
sum#(:(x,:(y,xs))) |
→ |
sum#(:(+(x,y),xs)) |
(20) |
1.1.2 Reduction Pair Processor with Usable Rules
Using the
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) |
= |
[] |
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
pair
sum#(:(x,:(y,xs))) |
→ |
sum#(:(+(x,y),xs)) |
(20) |
could be deleted.
1.1.2.1 P is empty
There are no pairs anymore.
-
The
3rd
component contains the
pair
+#(s(x),y) |
→ |
+#(x,y) |
(17) |
1.1.3 Size-Change Termination
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.
-
The
4th
component contains the
pair
++#(:(x,xs),ys) |
→ |
++#(xs,ys) |
(18) |
1.1.4 Size-Change Termination
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.
-
The
5th
component contains the
pair
quot#(s(x),s(y)) |
→ |
quot#(-(x,y),s(y)) |
(26) |
1.1.5 Subterm Criterion Processor
We use the projection to multisets
π(quot#)
|
= |
{
1
}
|
π(-)
|
= |
{
1
}
|
to remove the pairs:
quot#(s(x),s(y)) |
→ |
quot#(-(x,y),s(y)) |
(26) |
1.1.5.1 P is empty
There are no pairs anymore.
-
The
6th
component contains the
pair
-#(s(x),s(y)) |
→ |
-#(x,y) |
(24) |
1.1.6 Size-Change Termination
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.
-
The
7th
component contains the
pair
length#(:(x,xs)) |
→ |
length#(xs) |
(27) |
1.1.7 Size-Change Termination
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.