Certification Problem
Input (TPDB TRS_Standard/AProVE_07/thiemann15)
The rewrite relation of the following TRS is considered.
half(0) |
→ |
0 |
(1) |
half(s(0)) |
→ |
0 |
(2) |
half(s(s(x))) |
→ |
s(half(x)) |
(3) |
inc(0) |
→ |
0 |
(4) |
inc(s(x)) |
→ |
s(inc(x)) |
(5) |
zero(0) |
→ |
true |
(6) |
zero(s(x)) |
→ |
false |
(7) |
p(0) |
→ |
0 |
(8) |
p(s(x)) |
→ |
x |
(9) |
bits(x) |
→ |
bitIter(x,0) |
(10) |
bitIter(x,y) |
→ |
if(zero(x),x,inc(y)) |
(11) |
if(true,x,y) |
→ |
p(y) |
(12) |
if(false,x,y) |
→ |
bitIter(half(x),y) |
(13) |
Property / Task
Prove or disprove termination.Answer / Result
Yes.Proof (by ttt2 @ termCOMP 2023)
1 Dependency Pair Transformation
The following set of initial dependency pairs has been identified.
half#(s(s(x))) |
→ |
half#(x) |
(14) |
inc#(s(x)) |
→ |
inc#(x) |
(15) |
bits#(x) |
→ |
bitIter#(x,0) |
(16) |
bitIter#(x,y) |
→ |
inc#(y) |
(17) |
bitIter#(x,y) |
→ |
zero#(x) |
(18) |
bitIter#(x,y) |
→ |
if#(zero(x),x,inc(y)) |
(19) |
if#(true,x,y) |
→ |
p#(y) |
(20) |
if#(false,x,y) |
→ |
half#(x) |
(21) |
if#(false,x,y) |
→ |
bitIter#(half(x),y) |
(22) |
1.1 Dependency Graph Processor
The dependency pairs are split into 3
components.
-
The
1st
component contains the
pair
if#(false,x,y) |
→ |
bitIter#(half(x),y) |
(22) |
bitIter#(x,y) |
→ |
if#(zero(x),x,inc(y)) |
(19) |
1.1.1 Reduction Pair Processor with Usable Rules
Using the linear polynomial interpretation over the rationals with delta = 1/64
[zero(x1)] |
= |
1/2 · x1 + 0 |
[half(x1)] |
= |
1/2 · x1 + 0 |
[inc(x1)] |
= |
0 · x1 + 3 |
[bitIter#(x1, x2)] |
= |
1 · x1 + 0 · x2 + 1/2 |
[if#(x1, x2, x3)] |
= |
1 · x1 + 1/2 · x2 + 0 · x3 + 0 |
[true] |
= |
0 |
[0] |
= |
0 |
[false] |
= |
1/2 |
[s(x1)] |
= |
3 · x1 + 1 |
together with the usable
rules
half(0) |
→ |
0 |
(1) |
half(s(0)) |
→ |
0 |
(2) |
half(s(s(x))) |
→ |
s(half(x)) |
(3) |
zero(0) |
→ |
true |
(6) |
zero(s(x)) |
→ |
false |
(7) |
(w.r.t. the implicit argument filter of the reduction pair),
the
pair
bitIter#(x,y) |
→ |
if#(zero(x),x,inc(y)) |
(19) |
could be deleted.
1.1.1.1 Dependency Graph Processor
The dependency pairs are split into 0
components.
-
The
2nd
component contains the
pair
half#(s(s(x))) |
→ |
half#(x) |
(14) |
1.1.2 Subterm Criterion Processor
We use the projection
and remove the pairs:
half#(s(s(x))) |
→ |
half#(x) |
(14) |
1.1.2.1 P is empty
There are no pairs anymore.
-
The
3rd
component contains the
pair
inc#(s(x)) |
→ |
inc#(x) |
(15) |
1.1.3 Size-Change Termination
Using size-change termination in combination with
the subterm criterion
one obtains the following initial size-change graphs.
inc#(s(x)) |
→ |
inc#(x) |
(15) |
|
1 |
> |
1 |
As there is no critical graph in the transitive closure, there are no infinite chains.