- wp {a : Type u} : m a → (a → ProofTrace → Prop) → ProofTrace → Prop
Instances
Equations
- DY.instWPId = { wp := fun {a : Type ?u.1} (f : Id a) (post : a → DY.ProofTrace → Prop) (tr_proof : DY.ProofTrace) => post f.run tr_proof }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- DY.hoareTriple f pre post = ∀ (tr : DY.ProofTrace), pre tr → DY.Trace.Invariant tr → DY.wp f post tr
Instances For
Some ghost parameters can be found automatically by looking into the context. This structure holds a metaprogram which is called with a metavariable for the ghost parameter, and the expression corresponding to the hoare triple that requires the ghost parameter. It is expected to assign the ghost parameter metavariable.
- findGhost : Lean.MVarId → Lean.Expr → Lean.MetaM Unit
Instances For
This typeclass notifies the step tactic that
metaprog can automatically find the ghost parameter
of the the hoare triple associated with x.
For technical reasons, metaprog must be a top-level declaration,
it cannot be written inline in the declaration.
This is to prevent it to depend on local variables specific to this instance.
- dummy : Unit
Instances
Some hoare triples are derived from others,
for example we can create a hoare triple for lift x given a hoare triple for x.
In this case, both hoare triple use the same ghost parameter,
but the metaprogram that finds the ghost parameter for x
won't work if we feed it lift x instead of x.
To solve this issue,
HasIndirectGhostMetaprogram x metaprog y
notifies the step tactic
that metaprog is expected to be called with the expression of y
instead of the expression of x.
- dummy : Unit
Instances
- pf : hoareTriple f pre post
Instances
- pf : hoareTriple f pre post
Instances
- pf {a : Type u} (x : m a) (post : a → ProofTrace → Prop) (tr : ProofTrace) : Trace.Invariant tr → wp x post tr → wp (liftM x) post tr
Instances
- pf (tr : ProofTrace) : pre tr → post x tr
Instances
- pf (tr : ProofTrace) : pre tr → post x tr
Instances
Equations
- DY.appendEntry entry = DY.Traceful.mk fun (tr : DY.ExecTrace) => (some (DY.Trace.length tr), ⟨DY.Trace.append tr entry, ⋯⟩)
Instances For
Equations
- DY.getEntry timestamp = DY.Traceful.mk fun (tr : DY.ExecTrace) => have result := DY.Trace.at? tr timestamp; (result, ⟨tr, ⋯⟩)
Instances For
Equations
- DY.getTimestamp = DY.Traceful.mk fun (tr : DY.ExecTrace) => (some (DY.Trace.length tr), ⟨tr, ⋯⟩)
Instances For
- inv : xs.Cursor × β → ProofTrace → Prop
- step (pref : List α) (cur : α) (suff : List α) (h : xs = pref ++ cur :: suff) (b : β) : HoareTriple (f cur ⋯ b) (self.inv ({ «prefix» := pref, suffix := cur :: suff, property := ⋯ }, b)) fun (r : ForInStep β) => match (motive := ForInStep β → ProofTrace → Prop) r with | ForInStep.yield b' => self.inv ({ «prefix» := pref ++ [cur], suffix := suff, property := ⋯ }, b') | ForInStep.done b' => self.inv ({ «prefix» := xs, suffix := [], property := ⋯ }, b')
Instances For
- inv : xs.Cursor × β → ProofTrace → Prop
- step (pref : List α) (cur : α) (suff : List α) (h : xs = pref ++ cur :: suff) (b : β) : HoareTriple (f cur b) (self.inv ({ «prefix» := pref, suffix := cur :: suff, property := ⋯ }, b)) fun (r : ForInStep β) => match (motive := ForInStep β → ProofTrace → Prop) r with | ForInStep.yield b' => self.inv ({ «prefix» := pref ++ [cur], suffix := suff, property := ⋯ }, b') | ForInStep.done b' => self.inv ({ «prefix» := xs, suffix := [], property := ⋯ }, b')