EasyCrypt's list distributions (theories/distributions/DList.ec) #
dlist d n samples n values from d, independently. The abstract theory Program's type t
and operator d are section variables, so a clone is an application. Only what ported
developments use is here.
dlist d n: a list of n independent samples of d (the empty list for n ≤ 0).
Equations
Instances For
dlist d n for n : ℕ.
Equations
- GaudisCrypt.EC.dlist.go d 0 = pure []
- GaudisCrypt.EC.dlist.go d k.succ = do let a ← d let l ← GaudisCrypt.EC.dlist.go d k pure (a :: l)
Instances For
The image of a distribution by an injective function, at an image point.
@[simp]: LoopSnoc.sample = Module.proc LoopSnoc.sample.procedure — true by definition, proc sample using no module parameter and so having no holes to fill.
The body of proc sample of module LoopSnoc, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see LoopSnoc.sample.procedure.apply_simp) rather than run. Use LoopSnoc.sample for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of LoopSnoc.sample.procedure with a tuple holeArgs of procedures: the body of proc sample as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [LoopSnoc.sample.procedure.apply_simp]).
The module declared by module LoopSnoc: the record of its procedures LoopSnoc.sample.
The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no LoopSnoc.apply_simp to apply it with.
Equations
Instances For
proc sample of module LoopSnoc as a module: Module.proc LoopSnoc.sample.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — LoopSnoc.sample.apply_simp says exactly that.
Equations
Instances For
LoopSnoc.sample n samples dlist d n (EC's Sample_LoopSnoc_eq, with Sample.sample n
being r <$ dlist d n), as expectations.
LoopSnoc.sample n's run: a sample of dlist d n, the globals kept.
EC's pr_Sample for LoopSnoc (Sample_LoopSnoc_eq and pr_Sample):
Pr[LoopSnoc.sample(n) @ &m : res = xs] = mu1 (dlist d n) xs.