Verified structured RAM Hamming weight #
Hamming.program is a structured imperative program over the reserved-register
layout Hamming.inputStore. Its correctness and resource bounds are proved in
the independent source semantics. Hamming.compiled_performance then applies
the generic compiler theorem, carrying the result to the concrete logarithmic-cost
RAM with an exact transition count, explicit length-indexed budgets, and
quasilinear asymptotic corollaries.
Source-level correctness with an exact transition count and explicit logarithmic-cost time and peak-space bounds.
End-to-end compiled performance theorem. The concrete RAM reaches its halt
instruction after exactly stepCount bits transitions, within the explicit
logarithmic-cost time and peak-space budgets, and returns the Hamming weight.
The explicit logarithmic-cost time budget is quasilinear.
The explicit peak-space budget is quasilinear under the reserved-register input representation.