EasyCrypt's auto and rnd steps for hoare and phoare #
phoare_auto, hoare_auto -- EC's `auto`: wp over the code back to the last call, then `skip`
Our phoare is computed by wp, samplings included (exact averages), so EC's rnd steps on a
phoare goal become, once phoare_auto has gone through the code, steps on an expectation
d.expected f ≤ r left by a sampling:
rnd_pred1 v -- EC's `rnd (pred1 v)`: `f a ≤ [v = a]`, bounded by `d {v}`
rnd_bound -- EC's `rnd` with a lossless distribution: `f a ≤ r` for every `a`
rnd_null -- EC's `hoare`: `f` is `0` on the support, whatever the bound
Each leaves the pointwise goal (the obligation EC's auto would leave after the step).
EC's rnd (pred1 v) on an upper bound: an expectation below the indicator of v is at most
the mass of v.
EC's rnd on a lossless distribution: a pointwise bound is a bound of the expectation (the
total mass is at most 1).
EC's hoare (probability 0): an expectation null on the support is below anything.
An event's indicator is 1 exactly when the event holds (what a phoare … = 1 leaves).
Equal on a region R (EC's ={glob C}), so equal on each variable inside it
(={C.c, C.queries}, a concrete module's glob being its variables).
EC's ={glob C} as the equalities of C's variables: for each hypothesis
R.touched_getter.get a = R.touched_getter.get b, the hypotheses x.get a = x.get b for the
variables x read at a or b (in the goal or a hypothesis) that lie inside R: R a region of
variables among which x is (fp_le), or a concrete module's footprint and the module writes x
(fp_writes).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's auto on the statement judgment g (a registered one): wp over the statements from the
end (Judgment.wpOne: deterministic code, samplings, conditionals) until a call or skip.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The precondition (argument 0) with its reads of pairs of globals taken apart
((§(Lens.pair X Y)).1 is §X), so that skip generalizes the reads to plain variables (as
fel's view of several variables reads them).
Equations
- One or more equations did not get rendered due to their size.
Instances For
hoare_skip with the goal beta-reduced first (as phoare_skip does), so that the reads are
generalized to plain variables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's ={glob C} as ={C.c, C.queries} in a closer: see ECAuto.globReads.
Equations
- GaudisCrypt.tacticGlob_reads = Lean.ParserDescr.node `GaudisCrypt.tacticGlob_reads 1024 (Lean.ParserDescr.nonReservedSymbol "glob_reads" false)
Instances For
The samplings' mass where the distribution is lossless (@[ec_lossless], EC's auto), in the
goal, and nothing else: the other reductions of simp (projections, β, ζ, …) are off
(Simp.neutralConfig), so that the goal keeps the form the hand proofs after auto read.
Equations
- GaudisCrypt.tacticLossless_simp = Lean.ParserDescr.node `GaudisCrypt.tacticLossless_simp 1024 (Lean.ParserDescr.nonReservedSymbol "lossless_simp" false)
Instances For
EC's auto on a phoare statement judgment: wp back to the last call, then skip if
the code is used up, the trivial goals (1 = 1) closed.
Equations
- GaudisCrypt.tacticPhoare_auto = Lean.ParserDescr.node `GaudisCrypt.tacticPhoare_auto 1024 (Lean.ParserDescr.nonReservedSymbol "phoare_auto" false)
Instances For
EC's auto on a relational judgment about statements: wp, the samplings on both
sides by rnd (with wp after each), skip when the code is used up, and the trivial goals
closed (simp_all only when it closes the goal).
Equations
- GaudisCrypt.tacticEquiv_auto = Lean.ParserDescr.node `GaudisCrypt.tacticEquiv_auto 1024 (Lean.ParserDescr.nonReservedSymbol "equiv_auto" false)
Instances For
EC's auto on a Hoare triple about a statement (the memories of a side goal
∀ σ₁, hoare[ … ] introduced first; the trivial goals closed).
Equations
- GaudisCrypt.tacticHoare_auto = Lean.ParserDescr.node `GaudisCrypt.tacticHoare_auto 1024 (Lean.ParserDescr.nonReservedSymbol "hoare_auto" false)
Instances For
EC's rnd (pred1 v) on a goal d.expected f ≤ r: the goal f a ≤ [v = a] for every
a (a introduced), then d {v} ≤ r unless le_rfl closes it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's rnd with a lossless distribution, on a goal d.expected f ≤ r: the goal
f a ≤ r for every a (a introduced).
Equations
- GaudisCrypt.tacticRnd_bound = Lean.ParserDescr.node `GaudisCrypt.tacticRnd_bound 1024 (Lean.ParserDescr.nonReservedSymbol "rnd_bound" false)
Instances For
EC's hoare (probability 0) on a goal d.expected f ≤ r: the goal f a = 0 for every
a in the support (a, ha introduced).
Equations
- GaudisCrypt.tacticRnd_null = Lean.ParserDescr.node `GaudisCrypt.tacticRnd_null 1024 (Lean.ParserDescr.nonReservedSymbol "rnd_null" false)