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))) |
→ |
sum#(:(+(x,y),xs)) |
(19) |
sum#(:(x,:(y,xs))) |
→ |
+#(x,y) |
(20) |
sum#(++(xs,:(x,:(y,ys)))) |
→ |
sum#(++(xs,sum(:(x,:(y,ys))))) |
(21) |
sum#(++(xs,:(x,:(y,ys)))) |
→ |
++#(xs,sum(:(x,:(y,ys)))) |
(22) |
sum#(++(xs,:(x,:(y,ys)))) |
→ |
sum#(:(x,:(y,ys))) |
(23) |
-#(s(x),s(y)) |
→ |
-#(x,y) |
(24) |
quot#(s(x),s(y)) |
→ |
quot#(-(x,y),s(y)) |
(25) |
quot#(s(x),s(y)) |
→ |
-#(x,y) |
(26) |
length#(:(x,xs)) |
→ |
length#(xs) |
(27) |
avg#(xs) |
→ |
quot#(hd(sum(xs)),length(xs)) |
(28) |
avg#(xs) |
→ |
hd#(sum(xs)) |
(29) |
avg#(xs) |
→ |
sum#(xs) |
(30) |
avg#(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))))) |
(21) |
1.1.1 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[sum(x1)] |
= |
1 · x1
|
[:(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[+(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[++(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[nil] |
= |
0 |
[0] |
= |
0 |
[s(x1)] |
= |
1 · x1
|
[sum#(x1)] |
= |
1 · x1
|
together with the usable
rules
sum(:(x,:(y,xs))) |
→ |
sum(:(+(x,y),xs)) |
(6) |
++(nil,ys) |
→ |
ys |
(3) |
++(:(x,xs),ys) |
→ |
:(x,++(xs,ys)) |
(4) |
+(0,y) |
→ |
y |
(1) |
+(s(x),y) |
→ |
s(+(x,y)) |
(2) |
sum(:(x,nil)) |
→ |
:(x,nil) |
(5) |
(w.r.t. the implicit argument filter of the reduction pair),
the
rule
could be deleted.
1.1.1.1 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[sum(x1)] |
= |
1 · x1
|
[:(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[+(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[++(x1, x2)] |
= |
2 · x1 + 1 · x2
|
[nil] |
= |
0 |
[0] |
= |
0 |
[s(x1)] |
= |
1 · x1
|
[sum#(x1)] |
= |
1 · x1
|
together with the usable
rules
sum(:(x,:(y,xs))) |
→ |
sum(:(+(x,y),xs)) |
(6) |
++(nil,ys) |
→ |
ys |
(3) |
++(:(x,xs),ys) |
→ |
:(x,++(xs,ys)) |
(4) |
+(0,y) |
→ |
y |
(1) |
+(s(x),y) |
→ |
s(+(x,y)) |
(2) |
sum(:(x,nil)) |
→ |
:(x,nil) |
(5) |
(w.r.t. the implicit argument filter of the reduction pair),
the
rule
could be deleted.
1.1.1.1.1 Monotonic Reduction Pair Processor
Using the linear polynomial interpretation over the naturals
[sum(x1)] |
= |
1 · x1
|
[:(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[+(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[++(x1, x2)] |
= |
2 · x1 + 1 · x2
|
[nil] |
= |
2 |
[s(x1)] |
= |
1 · x1
|
[sum#(x1)] |
= |
2 · x1
|
the
rule
could be deleted.
1.1.1.1.1.1 Monotonic Reduction Pair Processor
Using the linear polynomial interpretation over the naturals
[sum(x1)] |
= |
1 · x1
|
[:(x1, x2)] |
= |
2 + 1 · x1 + 1 · x2
|
[+(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[++(x1, x2)] |
= |
2 · x1 + 1 · x2
|
[s(x1)] |
= |
1 · x1
|
[nil] |
= |
0 |
[sum#(x1)] |
= |
2 · x1
|
the
rules
sum(:(x,:(y,xs))) |
→ |
sum(:(+(x,y),xs)) |
(6) |
++(:(x,xs),ys) |
→ |
:(x,++(xs,ys)) |
(4) |
could be deleted.
1.1.1.1.1.1.1 Switch to Innermost Termination
The TRS does not have overlaps with the pairs and is locally confluent:
20
Hence, it suffices to show innermost termination in the following.
1.1.1.1.1.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.1.1.1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
1.1.1.1.1.1.1.1.1.1 Reduction Pair Processor
Using the Knuth Bendix order with w0 = 1 and the following precedence and weight functions
prec(:) |
= |
1 |
|
weight(:) |
= |
2 |
|
|
|
prec(sum) |
= |
0 |
|
weight(sum) |
= |
1 |
|
|
|
in combination with the following argument filter
π(sum#) |
= |
1 |
π(++) |
= |
2 |
π(:) |
= |
[] |
π(sum) |
= |
[] |
the
pair
sum#(++(xs,:(x,:(y,ys)))) |
→ |
sum#(++(xs,sum(:(x,:(y,ys))))) |
(21) |
could be deleted.
1.1.1.1.1.1.1.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)) |
(19) |
1.1.2 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[+(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[0] |
= |
0 |
[s(x1)] |
= |
1 · x1
|
[:(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[sum#(x1)] |
= |
1 · x1
|
together with the usable
rules
+(0,y) |
→ |
y |
(1) |
+(s(x),y) |
→ |
s(+(x,y)) |
(2) |
(w.r.t. the implicit argument filter of the reduction pair),
the
rule
could be deleted.
1.1.2.1 Switch to Innermost Termination
The TRS does not have overlaps with the pairs and is locally confluent:
20
Hence, it suffices to show innermost termination in the following.
1.1.2.1.1 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[+(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[0] |
= |
0 |
[s(x1)] |
= |
1 · x1
|
[sum#(x1)] |
= |
2 · x1
|
[:(x1, x2)] |
= |
1 + 1 · x1 + 2 · x2
|
together with the usable
rules
+(0,y) |
→ |
y |
(1) |
+(s(x),y) |
→ |
s(+(x,y)) |
(2) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
sum#(:(x,:(y,xs))) |
→ |
sum#(:(+(x,y),xs)) |
(19) |
and
the
rule
could be deleted.
1.1.2.1.1.1 P is empty
There are no pairs anymore.
-
The
3rd
component contains the
pair
quot#(s(x),s(y)) |
→ |
quot#(-(x,y),s(y)) |
(25) |
1.1.3 Reduction Pair Processor with Usable Rules
Using the Knuth Bendix order with w0 = 1 and the following precedence and weight functions
prec(s) |
= |
0 |
|
weight(s) |
= |
1 |
|
|
|
prec(0) |
= |
1 |
|
weight(0) |
= |
1 |
|
|
|
in combination with the following argument filter
π(quot#) |
= |
1 |
π(s) |
= |
[1] |
π(-) |
= |
1 |
π(0) |
= |
[] |
together with the usable
rules
-(x,0) |
→ |
x |
(8) |
-(0,s(y)) |
→ |
0 |
(9) |
-(s(x),s(y)) |
→ |
-(x,y) |
(10) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
quot#(s(x),s(y)) |
→ |
quot#(-(x,y),s(y)) |
(25) |
could be deleted.
1.1.3.1 P is empty
There are no pairs anymore.
-
The
4th
component contains the
pair
+#(s(x),y) |
→ |
+#(x,y) |
(17) |
1.1.4 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[s(x1)] |
= |
1 · x1
|
[+#(x1, x2)] |
= |
1 · x1 + 1 · x2
|
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
rule
could be deleted.
1.1.4.1 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) |
|
1 |
> |
1 |
2 |
≥ |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
5th
component contains the
pair
++#(:(x,xs),ys) |
→ |
++#(xs,ys) |
(18) |
1.1.5 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[:(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[++#(x1, x2)] |
= |
1 · x1 + 1 · x2
|
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
rule
could be deleted.
1.1.5.1 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) |
|
1 |
> |
1 |
2 |
≥ |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
6th
component contains the
pair
-#(s(x),s(y)) |
→ |
-#(x,y) |
(24) |
1.1.6 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[s(x1)] |
= |
1 · x1
|
[-#(x1, x2)] |
= |
1 · x1 + 1 · x2
|
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
rule
could be deleted.
1.1.6.1 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) |
|
1 |
> |
1 |
2 |
> |
2 |
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 Monotonic Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[:(x1, x2)] |
= |
1 · x1 + 1 · x2
|
[length#(x1)] |
= |
1 · x1
|
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
rule
could be deleted.
1.1.7.1 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.