The rewrite relation of the following TRS is considered.
quot(0,s(y),s(z)) |
→ |
0 |
(1) |
quot(s(x),s(y),z) |
→ |
quot(x,y,z) |
(2) |
plus(s(x),s(y)) |
→ |
s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) |
(3) |
plus(s(x),x) |
→ |
plus(if(gt(x,x),id(x),id(x)),s(x)) |
(4) |
plus(zero,y) |
→ |
y |
(5) |
plus(id(x),s(y)) |
→ |
s(plus(x,if(gt(s(y),y),y,s(y)))) |
(6) |
id(x) |
→ |
x |
(7) |
if(true,x,y) |
→ |
x |
(8) |
if(false,x,y) |
→ |
y |
(9) |
not(x) |
→ |
if(x,false,true) |
(10) |
gt(s(x),zero) |
→ |
true |
(11) |
gt(zero,y) |
→ |
false |
(12) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(13) |
quot(x,0,s(z)) |
→ |
s(quot(x,plus(z,s(0)),s(z))) |
(14) |
The evaluation strategy is innermost.
quot#(s(x),s(y),z) |
→ |
quot#(x,y,z) |
(15) |
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(16) |
plus#(s(x),s(y)) |
→ |
if#(gt(x,y),x,y) |
(17) |
plus#(s(x),s(y)) |
→ |
gt#(x,y) |
(18) |
plus#(s(x),s(y)) |
→ |
if#(not(gt(x,y)),id(x),id(y)) |
(19) |
plus#(s(x),s(y)) |
→ |
not#(gt(x,y)) |
(20) |
plus#(s(x),s(y)) |
→ |
id#(x) |
(21) |
plus#(s(x),s(y)) |
→ |
id#(y) |
(22) |
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(23) |
plus#(s(x),x) |
→ |
if#(gt(x,x),id(x),id(x)) |
(24) |
plus#(s(x),x) |
→ |
gt#(x,x) |
(25) |
plus#(s(x),x) |
→ |
id#(x) |
(26) |
plus#(id(x),s(y)) |
→ |
plus#(x,if(gt(s(y),y),y,s(y))) |
(27) |
plus#(id(x),s(y)) |
→ |
if#(gt(s(y),y),y,s(y)) |
(28) |
plus#(id(x),s(y)) |
→ |
gt#(s(y),y) |
(29) |
not#(x) |
→ |
if#(x,false,true) |
(30) |
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(31) |
quot#(x,0,s(z)) |
→ |
quot#(x,plus(z,s(0)),s(z)) |
(32) |
quot#(x,0,s(z)) |
→ |
plus#(z,s(0)) |
(33) |
The dependency pairs are split into 3
components.
-
The
1st
component contains the
pair
quot#(x,0,s(z)) |
→ |
quot#(x,plus(z,s(0)),s(z)) |
(32) |
quot#(s(x),s(y),z) |
→ |
quot#(x,y,z) |
(15) |
1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
plus(s(x),s(y)) |
→ |
s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) |
(3) |
plus(s(x),x) |
→ |
plus(if(gt(x,x),id(x),id(x)),s(x)) |
(4) |
plus(zero,y) |
→ |
y |
(5) |
gt(zero,y) |
→ |
false |
(12) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(13) |
id(x) |
→ |
x |
(7) |
if(true,x,y) |
→ |
x |
(8) |
if(false,x,y) |
→ |
y |
(9) |
gt(s(x),zero) |
→ |
true |
(11) |
not(x) |
→ |
if(x,false,true) |
(10) |
1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
plus(s(x0),s(x1)) |
plus(s(x0),x0) |
plus(zero,x0) |
id(x0) |
if(true,x0,x1) |
if(false,x0,x1) |
not(x0) |
gt(s(x0),zero) |
gt(zero,x0) |
gt(s(x0),s(x1)) |
1.1.1.1.1 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 |
|
|
|
in combination with the following argument filter
having no usable rules (w.r.t. the implicit argument filter of the
reduction pair),
the
pair
quot#(s(x),s(y),z) |
→ |
quot#(x,y,z) |
(15) |
could be deleted.
1.1.1.1.1.1 Reduction Pair Processor with Usable Rules
Using the Knuth Bendix order with w0 = 1 and the following precedence and weight functions
prec(0) |
= |
1 |
|
weight(0) |
= |
2 |
|
|
|
prec(s) |
= |
0 |
|
weight(s) |
= |
1 |
|
|
|
in combination with the following argument filter
π(quot#) |
= |
2 |
π(0) |
= |
[] |
π(plus) |
= |
2 |
π(s) |
= |
[] |
together with the usable
rules
plus(s(x),s(y)) |
→ |
s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) |
(3) |
plus(s(x),x) |
→ |
plus(if(gt(x,x),id(x),id(x)),s(x)) |
(4) |
plus(zero,y) |
→ |
y |
(5) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
quot#(x,0,s(z)) |
→ |
quot#(x,plus(z,s(0)),s(z)) |
(32) |
could be deleted.
1.1.1.1.1.1.1 P is empty
There are no pairs anymore.
-
The
2nd
component contains the
pair
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(23) |
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(16) |
1.1.2 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
gt(s(x),zero) |
→ |
true |
(11) |
gt(zero,y) |
→ |
false |
(12) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(13) |
if(true,x,y) |
→ |
x |
(8) |
if(false,x,y) |
→ |
y |
(9) |
not(x) |
→ |
if(x,false,true) |
(10) |
id(x) |
→ |
x |
(7) |
1.1.2.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
id(x0) |
if(true,x0,x1) |
if(false,x0,x1) |
not(x0) |
gt(s(x0),zero) |
gt(zero,x0) |
gt(s(x0),s(x1)) |
1.1.2.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.2.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.2.1.1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
gt(s(x),zero) |
→ |
true |
(11) |
gt(zero,y) |
→ |
false |
(12) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(13) |
if(true,x,y) |
→ |
x |
(8) |
if(false,x,y) |
→ |
y |
(9) |
id(x) |
→ |
x |
(7) |
1.1.2.1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
id(x0) |
if(true,x0,x1) |
if(false,x0,x1) |
gt(s(x0),zero) |
gt(zero,x0) |
gt(s(x0),s(x1)) |
1.1.2.1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.2.1.1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.2.1.1.1.1.1.1.1.1 Rewriting Processor
We rewrite the right hand side of the pair
resulting in
1.1.2.1.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.
gt(s(x),zero) |
→ |
true |
(11) |
gt(zero,y) |
→ |
false |
(12) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(13) |
if(true,x,y) |
→ |
x |
(8) |
if(false,x,y) |
→ |
y |
(9) |
1.1.2.1.1.1.1.1.1.1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
if(true,x0,x1) |
if(false,x0,x1) |
gt(s(x0),zero) |
gt(zero,x0) |
gt(s(x0),s(x1)) |
1.1.2.1.1.1.1.1.1.1.1.1.1.1 Reduction Pair Processor with Usable Rules
Using the matrix interpretations of dimension 1 with strict dimension 1 over the arctic semiring over the naturals
[plus#(x1, x2)] |
= |
+ · x1 + · x2
|
[s(x1)] |
= |
+ · x1
|
[if(x1, x2, x3)] |
= |
+ · x1 + · x2 + · x3
|
[gt(x1, x2)] |
= |
+ · x1 + · x2
|
[false] |
= |
|
[true] |
= |
|
[zero] |
= |
|
together with the usable
rules
if(true,x,y) |
→ |
x |
(8) |
if(false,x,y) |
→ |
y |
(9) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),x,x),s(x)) |
(36) |
could be deleted.
1.1.2.1.1.1.1.1.1.1.1.1.1.1.1 Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the naturals
[plus#(x1, x2)] |
= |
-2 + 2 · x1 + 2 · x2
|
[if(x1, x2, x3)] |
= |
x2 + x3
|
[gt(x1, x2)] |
= |
0 |
[s(x1)] |
= |
1 + 2 · x1
|
[zero] |
= |
0 |
[true] |
= |
0 |
[false] |
= |
0 |
together with the usable
rules
if(true,x,y) |
→ |
x |
(8) |
if(false,x,y) |
→ |
y |
(9) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(if(gt(x,y),false,true),x,y)) |
(38) |
could be deleted.
1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1 P is empty
There are no pairs anymore.
-
The
3rd
component contains the
pair
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(31) |
1.1.3 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.3.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.3.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(31) |
|
1 |
> |
1 |
2 |
> |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.