Canonical binary count-up loops — Hoare-style driver, internal proofs #
BinaryForLoopSpec asks a client for a canonical configuration at every loop
index, which presumes a body whose tape effect is available in closed form.
Bodies assembled from Hoare triples do not have that shape: their contracts
only assert that some halting run exists. This module closes the gap by
running the loop composition directly on existential contracts, so a client
needs nothing but a per-index triple for its body.
A canonical binary tape is parked: its head sits off the left marker and
no cell to the right of cell zero holds ▷.
A count-up loop from a contract for its body. A body that carries the
loop frame from value to the pre-successor postcondition at every index runs
the whole loop, from counter zero to the limit, within the advertised time.
The advancing states of a count-up loop are the body's, taken inside the composite iteration. The driver and the counter's successor never consult the guess tape.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Canonical successor never consults the guess tape.
The guess protocol survives a count-up loop. The driver reads and rewrites only the counter, the limit, and whatever the body touches, so a body that consumes its guesses in the advancing states keeps doing so inside the loop.