Mathematical postconditions retained by compositional refinements #
Refines.with_postcondition attaches a proved property of the ordinary model
result without leaving the refinement interface. The same pure function and
RAM statement remain available to Refines.seq; the strengthened output
representation supplies the mathematical fact to the next implementation.
Refines.stateM_spec_refines does the same for native Std.Do.Triple proofs,
so a postcondition proved using mvcgen can be carried into stateM_bind.
Unlike stateM_spec, this interface does not fix one initial state or hide the
model result behind an existential contract postcondition.
These properties describe the chosen mathematical result, not every value that could represent the same machine state. Representation relations may be noninjective, including word encodings. No runtime assertion is inserted, and the existing safe terminating execution and separately proved costs are not changed. A property depending on the initial mathematical input can capture a fixed ghost in its closure or retain that input in the result's ghost model.
Retain a pure mathematical postcondition in the representation used by subsequent refinements. The input's mathematical precondition is explicit; no injectivity or converse interpretation of the output representation is assumed.
Carry a native stateful Hoare postcondition into later refinement
composition. Both the returned value and final abstract state remain the
ordinary pair produced by StateM.run, ready for Refines.stateM_bind.