Documentation

CslibFrontier.Computability.WordRAM.SymbolicExec.StructFrame

Mixed-record frame transport tactic #

Word-RAM proofs routinely package persistent state predicates as a Prop-valued structure (such as ImpFrame, KargerFrame, or Schoening.Frame) or a Prop-valued conjunction definition (such as HeaderConstsRep, TableSlotsRep, KeysValsRep, or Instances.Output) mixing register equations, memory equations, Block.Realizes / Block.HoldsList views, quantified cell invariants, and state-independent bounds (≤, Nodup, Fits).

When a state y steps to a later state z (through Data.set / Data.write / Data.havoc updates, equalities z.regs = y.regs / z.mem = y.mem, execution frames, Modifies, Set.EqOn, or quantified memory frames ∀ a, P a → z.mem a = y.mem a), transporting h : S … y to S … z otherwise requires a hand-written .congr / .reframe theorem and per-file macro for every record type.

struct_frame pairs each leaf field of the goal S … z 1-to-1 with the matching field of h : S … y and closes:

Any field whose nonlinear arithmetic side condition cannot be discharged automatically is left as a focused subgoal with h's corresponding field already introduced so the proof only has to supply the missing bound.

Main definitions #

struct_frame transports a Prop-valued structure or conjunction predicate from a prior state hypothesis h : S … y to the goal S … z by pairing fields 1-to-1:

  • unchanged (isDefEq) and rfl fields (Nodup, Fits, bounds, self-frames) close immediately;
  • register equations transfer through regs_frame, wram_simp, or z.regs = y.regs;
  • Block.Realizes, Block.HoldsList, and HeapAssertion.holds transfer through ram_keep against Data.write updates, Modifies, Set.EqOn, or quantified memory frames;
  • memory equations and quantified invariants (including transparent wrappers such as PartialAt and nested reads s k = some (z.mem a)) transfer through mem_frame and local memory-frame rewriting, checking arithmetic side conditions with omega, decide, and silent @[wram_arith] unfolding.

With no argument, struct_frame uses the most recent hypothesis with the same head constant as the goal. Any field that cannot be discharged automatically is left as a focused subgoal with a local hprev hypothesis holding the corresponding field of h.