Fresh cores and their deferred preparation #
NoErr m: m always succeeds. With Pres R m it gives the result and the relation.
A fresh core (initState) satisfies INV-S with the single-element nesting; initCore and
prepareStep only touch the top structure and tags afterwards.
Actions that always succeed #
A core computation succeeds from every initial state.
Equations
- OrderMaintenance.Proof.NoErr m = ∀ (s : OrderMaintenance.Model.Core), ∃ (a : α) (s' : OrderMaintenance.Model.Core), EStateM.run m s = EStateM.Result.ok a s'
Instances For
theorem
OrderMaintenance.Proof.NoErr.run
{α : Type}
{R : Model.Core → Model.Core → Prop}
{m : Model.CM α}
(hn : NoErr m)
(hp : Pres R m)
(s : Model.Core)
:
∃ (a : α) (s' : Model.Core), EStateM.run m s = EStateM.Result.ok a s' ∧ R s s'
Prove total success of a core computation by decomposing monadic primitives and loops.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The fresh core #
theorem
OrderMaintenance.Proof.initCore_run
(lazy : Bool)
(s : Model.Core)
:
∃ (s' : Model.Core),
EStateM.run (Model.initCore lazy) s = EStateM.Result.ok () s' ∧ INV s' initAbs ∧ SameLinks (Model.initState s.P) s'
A fresh core satisfies INV-S with the sentinel alone.