EasyCrypt's fel, as a tactic #
fel cntr step q bad [pre] inv
on a goal phoare[ P ==> bad ] ≤ r { s₀; x <- call D(O) (…); } — D a declared module, the call
last (a wp first for what follows it) — applies phoareStmt_fel, EC's fel. The arguments are
EC's: the counter cntr (an ℤ read off the state, §Bounder.bounder), the bound step i for a
call at counter i, the number of calls q, the event bad, the oracle's precondition pre
(the calls that may set bad), the invariant inv — the state-dependent ones written as the
judgment's conditions (§x). What EC needs no words for is done here: the state view the
conditions read (the global_vars they mention, paired into one lens L), the representation of
D and its oracles' signatures (from declare module and the oracles' module type T.ext), the
disjointness of D and L (fp_disjoint), the result variable x outside L.
Goals left, in EC's order: sum (∑_{i ∈ [0, q)} step i ≤ r), init (s₀ establishes inv,
¬ bad, cntr = 0), and per oracle the premises of FelOracle: lt, step, incr, same,
keep. One oracle for now (EC's [O₁: pre₁, …] with several is not needed by the SHA-3 port).
t is the read X.get g of the lens X (Getter.get (Lens.toGetter X) g) at g: X.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The fields of the structure n, if it is one.
Equations
- GaudisCrypt.FelTactic.getStructureFields? env n = if Lean.isStructure env n = true then some (Lean.getStructureFields env n) else none
Instances For
The globals X read as X.get τ.globals in e, in order of first occurrence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The state function f : ProgramState → α, its reads simplified (X.get τ.globals), as a
body in the fresh variable τ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The i-th of k components of s : X₁ × (X₂ × … Xₖ).
Equations
- GaudisCrypt.FelTactic.proj s x✝ 1 = pure s
- GaudisCrypt.FelTactic.proj s 0 x✝ = Lean.Meta.mkAppM `Prod.fst #[s]
- GaudisCrypt.FelTactic.proj s i.succ k.succ = do let __do_lift ← Lean.Meta.mkAppM `Prod.snd #[s] GaudisCrypt.FelTactic.proj __do_lift i k
- GaudisCrypt.FelTactic.proj s x✝¹ x✝ = pure s
Instances For
body with each read Xᵢ.get τ.globals replaced by the i-th component of s; fails if τ
is still used (a read of a local, or of something not a global).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The view of the state functions fs (each ProgramState → _): the globals they read, paired
into one lens L (Lens.pair, disjointness by instance search), and each function as a function
of L's value (f τ is f' (L.get τ.globals) by definition).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Discharge the side conditions of an abstract call common to fel and hoare_call (: inv):
the footprints, the countability of the oracles' arguments, the result outside the view.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The goal tags without macro scopes (the holes of a quotation are hygienic), as case names.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The last call of an applied module in the goal's statement: D and the oracles O, the
oracles' module type's T.ext.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's fel cntr step q bad [pre] inv (see the module docstring).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's call (: inv) on an abstract module, in a Hoare triple about a statement ending in
x <- call D(O) (…) (D a declared module): the oracles keep inv (goal oracle, a triple
about the oracle's procedure), and before the call inv holds and every result and globals
keeping it give the postcondition (goal pre), in EC's order: oracle, then pre. inv is written like the triple's conditions;
the state view, the representation, the footprints and the countability are as for fel.
Equations
- One or more equations did not get rendered due to their size.