The rewrite relation of the following TRS is considered.
even(0) |
→ |
true |
(1) |
even(s(0)) |
→ |
false |
(2) |
even(s(s(x))) |
→ |
even(x) |
(3) |
half(0) |
→ |
0 |
(4) |
half(s(s(x))) |
→ |
s(half(x)) |
(5) |
plus(s(x),s(y)) |
→ |
s(s(plus(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))))) |
(6) |
plus(s(x),x) |
→ |
plus(if(gt(x,x),id(x),id(x)),s(x)) |
(7) |
plus(zero,y) |
→ |
y |
(8) |
plus(id(x),s(y)) |
→ |
s(plus(x,if(gt(s(y),y),y,s(y)))) |
(9) |
id(x) |
→ |
x |
(10) |
if(true,x,y) |
→ |
x |
(11) |
if(false,x,y) |
→ |
y |
(12) |
not(x) |
→ |
if(x,false,true) |
(13) |
gt(s(x),zero) |
→ |
true |
(14) |
gt(zero,y) |
→ |
false |
(15) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(16) |
times(0,y) |
→ |
0 |
(17) |
times(s(x),y) |
→ |
if_times(even(s(x)),s(x),y) |
(18) |
if_times(true,s(x),y) |
→ |
plus(times(half(s(x)),y),times(half(s(x)),y)) |
(19) |
if_times(false,s(x),y) |
→ |
plus(y,times(x,y)) |
(20) |
The evaluation strategy is innermost.
even#(s(s(x))) |
→ |
even#(x) |
(21) |
half#(s(s(x))) |
→ |
half#(x) |
(22) |
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(23) |
plus#(s(x),s(y)) |
→ |
if#(gt(x,y),x,y) |
(24) |
plus#(s(x),s(y)) |
→ |
gt#(x,y) |
(25) |
plus#(s(x),s(y)) |
→ |
if#(not(gt(x,y)),id(x),id(y)) |
(26) |
plus#(s(x),s(y)) |
→ |
not#(gt(x,y)) |
(27) |
plus#(s(x),s(y)) |
→ |
id#(x) |
(28) |
plus#(s(x),s(y)) |
→ |
id#(y) |
(29) |
plus#(s(x),x) |
→ |
plus#(if(gt(x,x),id(x),id(x)),s(x)) |
(30) |
plus#(s(x),x) |
→ |
if#(gt(x,x),id(x),id(x)) |
(31) |
plus#(s(x),x) |
→ |
gt#(x,x) |
(32) |
plus#(s(x),x) |
→ |
id#(x) |
(33) |
plus#(id(x),s(y)) |
→ |
plus#(x,if(gt(s(y),y),y,s(y))) |
(34) |
plus#(id(x),s(y)) |
→ |
if#(gt(s(y),y),y,s(y)) |
(35) |
plus#(id(x),s(y)) |
→ |
gt#(s(y),y) |
(36) |
not#(x) |
→ |
if#(x,false,true) |
(37) |
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(38) |
times#(s(x),y) |
→ |
if_times#(even(s(x)),s(x),y) |
(39) |
times#(s(x),y) |
→ |
even#(s(x)) |
(40) |
if_times#(true,s(x),y) |
→ |
plus#(times(half(s(x)),y),times(half(s(x)),y)) |
(41) |
if_times#(true,s(x),y) |
→ |
times#(half(s(x)),y) |
(42) |
if_times#(true,s(x),y) |
→ |
half#(s(x)) |
(43) |
if_times#(false,s(x),y) |
→ |
plus#(y,times(x,y)) |
(44) |
if_times#(false,s(x),y) |
→ |
times#(x,y) |
(45) |
The dependency pairs are split into 5
components.
-
The
1st
component contains the
pair
times#(s(x),y) |
→ |
if_times#(even(s(x)),s(x),y) |
(39) |
if_times#(true,s(x),y) |
→ |
times#(half(s(x)),y) |
(42) |
if_times#(false,s(x),y) |
→ |
times#(x,y) |
(45) |
1.1.1 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
half(s(s(x))) |
→ |
s(half(x)) |
(5) |
half(0) |
→ |
0 |
(4) |
even(s(0)) |
→ |
false |
(2) |
even(s(s(x))) |
→ |
even(x) |
(3) |
even(0) |
→ |
true |
(1) |
1.1.1.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
even(0) |
even(s(0)) |
even(s(s(x0))) |
half(0) |
half(s(s(x0))) |
1.1.1.1.1 Reduction Pair Processor
Using the linear polynomial interpretation over the naturals
[if_times#(x1, x2, x3)] |
= |
-2 + x1 + 2 · x2 + x3
|
[even(x1)] |
= |
2 |
[s(x1)] |
= |
2 + 2 · x1
|
[0] |
= |
0 |
[false] |
= |
0 |
[times#(x1, x2)] |
= |
2 · x1 + x2
|
[half(x1)] |
= |
x1 |
[true] |
= |
2 |
the
pair
if_times#(false,s(x),y) |
→ |
times#(x,y) |
(45) |
could be deleted.
1.1.1.1.1.1 Reduction Pair Processor
Using the linear polynomial interpretation over the naturals
[if_times#(x1, x2, x3)] |
= |
-1 + x1 + 2 · x2 + 2 · x3
|
[even(x1)] |
= |
1 |
[s(x1)] |
= |
2 + 2 · x1
|
[0] |
= |
0 |
[false] |
= |
1 |
[times#(x1, x2)] |
= |
2 + 2 · x1 + 2 · x2
|
[half(x1)] |
= |
-2 + x1
|
[true] |
= |
0 |
the
pairs
times#(s(x),y) |
→ |
if_times#(even(s(x)),s(x),y) |
(39) |
if_times#(true,s(x),y) |
→ |
times#(half(s(x)),y) |
(42) |
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)) |
(30) |
plus#(s(x),s(y)) |
→ |
plus#(if(gt(x,y),x,y),if(not(gt(x,y)),id(x),id(y))) |
(23) |
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 |
(14) |
gt(zero,y) |
→ |
false |
(15) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(16) |
if(true,x,y) |
→ |
x |
(11) |
if(false,x,y) |
→ |
y |
(12) |
not(x) |
→ |
if(x,false,true) |
(13) |
id(x) |
→ |
x |
(10) |
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 |
(14) |
gt(zero,y) |
→ |
false |
(15) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(16) |
if(true,x,y) |
→ |
x |
(11) |
if(false,x,y) |
→ |
y |
(12) |
id(x) |
→ |
x |
(10) |
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 |
(14) |
gt(zero,y) |
→ |
false |
(15) |
gt(s(x),s(y)) |
→ |
gt(x,y) |
(16) |
if(true,x,y) |
→ |
x |
(11) |
if(false,x,y) |
→ |
y |
(12) |
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 |
(11) |
if(false,x,y) |
→ |
y |
(12) |
(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)) |
(48) |
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 |
(11) |
if(false,x,y) |
→ |
y |
(12) |
(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)) |
(50) |
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
even#(s(s(x))) |
→ |
even#(x) |
(21) |
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.
even#(s(s(x))) |
→ |
even#(x) |
(21) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
4th
component contains the
pair
half#(s(s(x))) |
→ |
half#(x) |
(22) |
1.1.4 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.4.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.4.1.1 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
half#(s(s(x))) |
→ |
half#(x) |
(22) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.
-
The
5th
component contains the
pair
gt#(s(x),s(y)) |
→ |
gt#(x,y) |
(38) |
1.1.5 Usable Rules Processor
We restrict the rewrite rules to the following usable rules of the DP problem.
There are no rules.
1.1.5.1 Innermost Lhss Removal Processor
We restrict the innermost strategy to the following left hand sides.
There are no lhss.
1.1.5.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) |
(38) |
|
1 |
> |
1 |
2 |
> |
2 |
As there is no critical graph in the transitive closure, there are no infinite chains.