pHL on exact bounds: seq, case, conseq #
The rules EasyCrypt's scripts use on phoare[ c : P ==> Q ] = r when r is not 1
(PIR.ec's Pr_PIR_s, vonNeumann.eca):
seq n : E p₁ p₂ p₃ p₄ I(phoareStmt_seq_eq):c₁reachesEwith probability exactlyp₁and¬Ewithp₃; fromE(and the invariantI)c₂reaches the postcondition with exactlyp₂, from¬Ewithp₄; andp₁ p₂ + p₃ p₄ = r. A bound_leaves its goal out: EC allows it where the other bound of the branch is0. On a lower bound (phoareStmt_seq_ge): the same with≥, andr ≤ p₁ p₂ + p₃ p₄.case E(phoareStmt_case).conseq (: _ ==> _ : = e): another bound, equal under the precondition (phoareStmt_conseq_bound).conseq (: P ==> _): a weaker precondition (phoareStmt_conseq_pre).conseq (: _ ==> Q₁) (: _ ==> Q₂): the eventQ₁in pHL andQ₂in Hoare logic, where underQ₂the two eventsQ₁andQagree (phoareStmt_conseq_hoare).conseq Hfor a judgmentHabout the same statement (phoareStmt_conseq_of).
The tactics are in Logic/PHoareExactTactics.lean.
Under a Hoare triple of s from σ, expectations that agree on its postcondition have the
same expected value.
EC's ge0_mu.
EC's le1_mu.
Every statement satisfies the postcondition true.
The expected value of 0 is 0.
The contribution of one branch of pHL's seq: the runs of s₁ that end in E, then
s₂ to Q, have probability p * q.
Equations
- GaudisCrypt.PHoareSeqBranch A s₁ s₂ E Q p q = ∀ (σ : GaudisCrypt.ProgramState), A σ → s₁.ewp (fun (τ : GaudisCrypt.ProgramState) => GaudisCrypt.indicatorE (E τ) * s₂.ewp Q τ) σ = p * q
Instances For
pHL's seq with five bounds, for an exact bound, from its two branches.
A branch of seq from its two judgments.
A branch of seq whose second bound is 0: the first is not needed (EC's _).
A branch of seq whose first bound is 0, for a postcondition at most 1 (an event): the
second is not needed (EC's _).
pHL's seq with five bounds, for a lower bound.
Every expectation is at least 0 (a bound _ of seq on a lower bound).
pHL's case E.
pHL's conseq (: _ ==> _ : = e): another bound, equal to the judgment's under the
precondition.
pHL's conseq (: P ==> _): a weaker precondition.
pHL's conseq (: _ ==> Q₁) (: _ ==> Q₂) on an exact bound: the event Q₁ with the
bound, and Q₂ in Hoare logic, under which Q₁ and the judgment's event agree.
pHL's conseq H: from a judgment H about the same statement and postcondition, with
a weaker precondition and a bound equal under the goal's precondition.