A compiled sorted-array lower-bound search #
The ordinary named program below lowers to the reusable search contract. Execution starts at the main block with the array preloaded in the heap and base, key and length already in registers. The theorem counts every executed search instruction and the final halt, not an unimplemented input loader.
The returned index is observed in the actual machine register, the original
array is observed in machine memory, and every source-heap address is unchanged.
The compiler's private stack frame is tracked separately by FramePreserved.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Run the checked block from a matching preloaded state at PC 1, then execute its halt. The budget includes no skipped initialization prologue.
The actual halted machine contains the correct insertion index and the unchanged sorted array. Heap and I/O preservation are stated against the actual entry machine, not just an intermediate source-level result.