x frames the resource F with respect to the operator op : R → Pred → Pred: op F · commutes
into the postcondition of wp x for every postcondition.
For the meet op = (· ⊓ ·) with R = Pred and stateful Pred, this means running x preserves the
state identified by F. Other operators take a simpler resource, e.g. a cost counter R = Nat.
- conj_wp_le_wp_conj (Q : Value → Pred) (E : EPred) : Lean.Order.PartialOrder.rel (op F (wp x Q E)) (wp x (fun (a : Value) => op F (Q a)) E)
When
xframes(op F ·),(op F ·)commutes into the postcondition ofwp x.
Instances For
The framed spec vcgen applies for x, when each op r preserves Sup: framing x by F
makes op F (wp x (fun a => PreservesSup.upperAdjoint (op F) (Q a))) a precondition for wp x Q.
PreservesSup.le_frameClosure at the wp layer: when x frames every resource r, landing
below wp x Q E suffices to land below the frame closure of wp x · E.
If wp is built as PreservesSup.frameClosure op over a base post-transformer f x E (the frame
rule internalized into wp), then every program frames every resource F with respect to op.
If wp x is conjunctive, then x frames (F ⊓ ·) when F holds before and after running x.
Reinterpret a WPMonad m so its weakest precondition is the PreservesSup.frameClosure of the
base wp over a family of Sup-preserving resource operators op r that act by comp with unit e.
The resource frame rule then holds by construction (WP.Frames.of_frameClosure).
Equations
- One or more equations did not get rendered due to their size.