The rewrite relation of the following TRS is considered.
minus(x,0) |
→ |
x |
(1) |
minus(s(x),s(y)) |
→ |
minus(x,y) |
(2) |
quot(0,s(y)) |
→ |
0 |
(3) |
quot(s(x),s(y)) |
→ |
s(quot(minus(x,y),s(y))) |
(4) |
le(0,y) |
→ |
true |
(5) |
le(s(x),0) |
→ |
false |
(6) |
le(s(x),s(y)) |
→ |
le(x,y) |
(7) |
app(nil,y) |
→ |
y |
(8) |
app(add(n,x),y) |
→ |
add(n,app(x,y)) |
(9) |
low(n,nil) |
→ |
nil |
(10) |
low(n,add(m,x)) |
→ |
if_low(le(m,n),n,add(m,x)) |
(11) |
if_low(true,n,add(m,x)) |
→ |
add(m,low(n,x)) |
(12) |
if_low(false,n,add(m,x)) |
→ |
low(n,x) |
(13) |
high(n,nil) |
→ |
nil |
(14) |
high(n,add(m,x)) |
→ |
if_high(le(m,n),n,add(m,x)) |
(15) |
if_high(true,n,add(m,x)) |
→ |
high(n,x) |
(16) |
if_high(false,n,add(m,x)) |
→ |
add(m,high(n,x)) |
(17) |
quicksort(nil) |
→ |
nil |
(18) |
quicksort(add(n,x)) |
→ |
app(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) |
(19) |
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(20) |
quot#(s(x),s(y)) |
→ |
minus#(x,y) |
(21) |
quot#(s(x),s(y)) |
→ |
quot#(minus(x,y),s(y)) |
(22) |
le#(s(x),s(y)) |
→ |
le#(x,y) |
(23) |
app#(add(n,x),y) |
→ |
app#(x,y) |
(24) |
low#(n,add(m,x)) |
→ |
le#(m,n) |
(25) |
low#(n,add(m,x)) |
→ |
if_low#(le(m,n),n,add(m,x)) |
(26) |
if_low#(true,n,add(m,x)) |
→ |
low#(n,x) |
(27) |
if_low#(false,n,add(m,x)) |
→ |
low#(n,x) |
(28) |
high#(n,add(m,x)) |
→ |
le#(m,n) |
(29) |
high#(n,add(m,x)) |
→ |
if_high#(le(m,n),n,add(m,x)) |
(30) |
if_high#(true,n,add(m,x)) |
→ |
high#(n,x) |
(31) |
if_high#(false,n,add(m,x)) |
→ |
high#(n,x) |
(32) |
quicksort#(add(n,x)) |
→ |
high#(n,x) |
(33) |
quicksort#(add(n,x)) |
→ |
quicksort#(high(n,x)) |
(34) |
quicksort#(add(n,x)) |
→ |
low#(n,x) |
(35) |
quicksort#(add(n,x)) |
→ |
quicksort#(low(n,x)) |
(36) |
quicksort#(add(n,x)) |
→ |
app#(quicksort(low(n,x)),add(n,quicksort(high(n,x)))) |
(37) |
The dependency pairs are split into 7
components.
-
The
1st
component contains the
pair
quot#(s(x),s(y)) |
→ |
quot#(minus(x,y),s(y)) |
(22) |
1.1.1 Subterm Criterion Processor
We use the projection to multisets
π(quot#)
|
= |
{
1
}
|
π(minus)
|
= |
{
1
}
|
to remove the pairs:
quot#(s(x),s(y)) |
→ |
quot#(minus(x,y),s(y)) |
(22) |
1.1.1.1 P is empty
There are no pairs anymore.
-
The
2nd
component contains the
pair
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(20) |
1.1.2 Subterm Criterion Processor
We use the projection
and remove the pairs:
minus#(s(x),s(y)) |
→ |
minus#(x,y) |
(20) |
1.1.2.1 P is empty
There are no pairs anymore.
-
The
3rd
component contains the
pair
quicksort#(add(n,x)) |
→ |
quicksort#(high(n,x)) |
(34) |
quicksort#(add(n,x)) |
→ |
quicksort#(low(n,x)) |
(36) |
1.1.3 Reduction Pair Processor with Usable Rules
Using the
prec(quicksort#) |
= |
0 |
|
stat(quicksort#) |
= |
lex
|
prec(if_high) |
= |
0 |
|
stat(if_high) |
= |
lex
|
prec(high) |
= |
0 |
|
stat(high) |
= |
lex
|
prec(if_low) |
= |
0 |
|
stat(if_low) |
= |
lex
|
prec(low) |
= |
0 |
|
stat(low) |
= |
lex
|
prec(add) |
= |
0 |
|
stat(add) |
= |
lex
|
prec(nil) |
= |
0 |
|
stat(nil) |
= |
lex
|
prec(false) |
= |
0 |
|
stat(false) |
= |
lex
|
prec(true) |
= |
0 |
|
stat(true) |
= |
lex
|
prec(le) |
= |
0 |
|
stat(le) |
= |
lex
|
prec(s) |
= |
0 |
|
stat(s) |
= |
lex
|
prec(0) |
= |
0 |
|
stat(0) |
= |
lex
|
π(quicksort#) |
= |
1 |
π(if_high) |
= |
3 |
π(high) |
= |
2 |
π(if_low) |
= |
3 |
π(low) |
= |
2 |
π(add) |
= |
[2] |
π(nil) |
= |
[] |
π(false) |
= |
[] |
π(true) |
= |
[] |
π(le) |
= |
[] |
π(s) |
= |
1 |
π(0) |
= |
[] |
together with the usable
rules
high(n,nil) |
→ |
nil |
(14) |
high(n,add(m,x)) |
→ |
if_high(le(m,n),n,add(m,x)) |
(15) |
if_high(true,n,add(m,x)) |
→ |
high(n,x) |
(16) |
if_high(false,n,add(m,x)) |
→ |
add(m,high(n,x)) |
(17) |
low(n,nil) |
→ |
nil |
(10) |
low(n,add(m,x)) |
→ |
if_low(le(m,n),n,add(m,x)) |
(11) |
if_low(true,n,add(m,x)) |
→ |
add(m,low(n,x)) |
(12) |
if_low(false,n,add(m,x)) |
→ |
low(n,x) |
(13) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pairs
quicksort#(add(n,x)) |
→ |
quicksort#(high(n,x)) |
(34) |
quicksort#(add(n,x)) |
→ |
quicksort#(low(n,x)) |
(36) |
could be deleted.
1.1.3.1 P is empty
There are no pairs anymore.
-
The
4th
component contains the
pair
app#(add(n,x),y) |
→ |
app#(x,y) |
(24) |
1.1.4 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
app#(add(n,x),y) |
→ |
app#(x,y) |
(24) |
|
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
low#(n,add(m,x)) |
→ |
if_low#(le(m,n),n,add(m,x)) |
(26) |
if_low#(true,n,add(m,x)) |
→ |
low#(n,x) |
(27) |
if_low#(false,n,add(m,x)) |
→ |
low#(n,x) |
(28) |
1.1.5 Subterm Criterion Processor
We use the projection
π(if_low#) |
= |
3 |
π(low#) |
= |
2 |
and remove the pairs:
if_low#(true,n,add(m,x)) |
→ |
low#(n,x) |
(27) |
if_low#(false,n,add(m,x)) |
→ |
low#(n,x) |
(28) |
1.1.5.1 Dependency Graph Processor
The dependency pairs are split into 0
components.
-
The
6th
component contains the
pair
high#(n,add(m,x)) |
→ |
if_high#(le(m,n),n,add(m,x)) |
(30) |
if_high#(true,n,add(m,x)) |
→ |
high#(n,x) |
(31) |
if_high#(false,n,add(m,x)) |
→ |
high#(n,x) |
(32) |
1.1.6 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
high#(n,add(m,x)) |
→ |
if_high#(le(m,n),n,add(m,x)) |
(30) |
|
2 |
≥ |
3 |
1 |
≥ |
2 |
if_high#(true,n,add(m,x)) |
→ |
high#(n,x) |
(31) |
|
3 |
> |
2 |
2 |
≥ |
1 |
if_high#(false,n,add(m,x)) |
→ |
high#(n,x) |
(32) |
|
3 |
> |
2 |
2 |
≥ |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
7th
component contains the
pair
le#(s(x),s(y)) |
→ |
le#(x,y) |
(23) |
1.1.7 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
le#(s(x),s(y)) |
→ |
le#(x,y) |
(23) |
|
2 |
> |
2 |
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.