Block specifications with footprints and named states
Library · Source module
Block specifications with footprints and named states
NLAlib.Ops.Writes md I τ c ρ F P m: the run of c from m, in the mode md, writes only the cells of F (the store keeps its shape and every cell off F) and ends in a memory satisfying P. It is Wp with a frame; every rule here is a rule of Wp with the frame carried, so nothing is added to the trusted base.
The point is the form in which a proof continues after a step (NLAlib.Ops.Writes.then_): the continuation receives a fresh memory m' with the frame m.store.EqOff F m'.store and the postcondition, and never a chain of updates. That is a named state: what a later step needs of m' is read off the frame (lengths by Store.EqOff.len_eq, kept blocks by Store.EqOff.keep) and the postcondition (the blocks just written). Frames of consecutive steps compose by ⊔ (Store.EqOff.trans'), and the footprint of a block is compared with the declared one once, at the end (fp_sub).
Every rule is mode-generic: what is needed only for success (live handles, readable inputs, room, a nonzero divisor) is under md.Needs, and a successful liberal run gives it back in the postcondition. One proof gives the total statement and the refinement.
Main results
* NLAlib.Ops.Writes, NLAlib.Ops.Writes.then_ (the named step), NLAlib.Ops.Writes.seq, NLAlib.Ops.Writes.mono, NLAlib.Ops.Writes.keep (frame-carry of a bundle of facts). * NLAlib.Ops.writes_call: the call rule with a footprint, in every mode, for any contract in operand form; NLAlib.Ops.writes_call1, NLAlib.Ops.writes_call_cell, NLAlib.Ops.writes_call2, NLAlib.Ops.writes_call_bin: shapes. * NLAlib.Ops.writes_alloc, NLAlib.Ops.writes_allocs: scratch buffers as named states, with their handles and lengths; the frame after the pops is the caller's. * NLAlib.Ops.writes_ite, NLAlib.Ops.writes_bindIdx, NLAlib.Ops.writes_bindIdx_of_isIndex. * NLAlib.Ops.Wp.named: generalise a chain of updates into a fresh memory (checkpoint). * NLAlib.Ops.Impl.satisfies_of_writes: an implementation satisfies a contract, from a block specification; the equation of the contract is built once, here.
Declarations
- NLAlib.Ops.Impl.Satisfies.writes
- NLAlib.Ops.Impl.Satisfies.writes_blocks
- NLAlib.Ops.Impl.satisfies_of_writes
- NLAlib.Ops.Interp.Satisfies.and_rel
- NLAlib.Ops.Stmt.allocs
- NLAlib.Ops.Stmt.allocsAs
- NLAlib.Ops.Wp.named
- NLAlib.Ops.Writes
- NLAlib.Ops.Writes.and
- NLAlib.Ops.Writes.congr_eval
- NLAlib.Ops.Writes.frame_seq_le
- NLAlib.Ops.Writes.in_frame
- NLAlib.Ops.Writes.keep
- NLAlib.Ops.Writes.link
- NLAlib.Ops.Writes.mono
- NLAlib.Ops.Writes.note_iff
- NLAlib.Ops.Writes.of_total
- NLAlib.Ops.Writes.of_wp_eq_updBlock
- NLAlib.Ops.Writes.seq
- NLAlib.Ops.Writes.seq_le
- NLAlib.Ops.Writes.skip
- NLAlib.Ops.Writes.then_
- NLAlib.Ops.Writes.wp
- NLAlib.Ops.eval_seq_seq_seq_assoc
- NLAlib.Ops.writes_alloc
- NLAlib.Ops.writes_allocs
- NLAlib.Ops.writes_allocsAs
- NLAlib.Ops.writes_bindIdx
- NLAlib.Ops.writes_bindIdx_holds
- NLAlib.Ops.writes_bindIdx_of_isIndex
- NLAlib.Ops.writes_call
- NLAlib.Ops.writes_call1
- NLAlib.Ops.writes_call2
- NLAlib.Ops.writes_call_bin
- NLAlib.Ops.writes_call_cell
- NLAlib.Ops.writes_frame
- NLAlib.Ops.writes_ite
- NLAlib.Ops.writes_ite_holds