Proof of `Construction 2` (6th statement)
What this proof establishes
no assumptions
Assuming the claims on the left, the claim on the right holds — checked by the archive's pipeline. Proof code is not displayed here.
Description
The program reads its input into an array, decides well-formedness in one pass over the literal slots, and then either runs the emitter of — whose five passes are reused here through the specification each of them carries — or writes the seven-entry word a malformed input is sent to.
Three of the four conditions are immediate. The fourth, that distinct occurrences of one variable carry distinct appearance indices, is decided by bucketing: an occurrence of variable with appearance index claims the cell , and a cell claimed twice refutes the condition. The cells fit because the pass runs only when the other three checks have passed, so and .
Each phase is costed twice, once on each side of the check that guards it. A word whose header lies about its length is rejected by the first check, and the marking pass and the emitter are then both skipped; that is what keeps the cost linear in the length of the word rather than in the number the word claims is its clause count. The whole is units of IMP+ cost, so machine instructions.
What remains is a change of currency, which does once: the bit size bounds the number of entries, and every value the program forms is bounded by the length of the word plus its largest entry, hence by .