pHL on exact bounds: the tactics #
The rules of Logic/PHoareExact.lean as EasyCrypt writes them, on a goal
phoare[ c : P ==> Q ] = r:
phoare_seq n : E p₁ p₂ p₃ p₄ I— EC'sseq n : E p₁ p₂ p₃ p₄ I(Imay be left out: EC's defaulttrue, its goal closed). The bounds are reals;_leaves a bound open where the other bound of its branch is0(its goal is not asked). On a lower bound≥ r: the same goals with≥,_a bound0, andr ≤ p₁ p₂ + p₃ p₄. Goals in EC's order:invariant,first_E,second_E,first_notE,second_notE,bound(the reals' equation when the judgment's bound isENNReal.ofReal e), andnonnegif0 ≤ pᵢis not found.phoare_case (E)— EC'scase (E): goalspos,neg.phoare_conseq (: _ ==> _ : = e)— another bounde(a real): goalsbound, then the judgment.phoare_conseq (: P ==> _)— a weaker precondition: goalspre, then the judgment.phoare_conseq (: _ ==> Q₁) (: _ ==> Q₂)— goalspost(underQ₂,Q₁iff the judgment's event),hoare(the triple forQ₂), then the judgment forQ₁: EC's order.phoare_conseq H— from a judgmentHabout the same statement: goalspre,bound(closed when trivial).
Tests: Logic/PHoareExactTest.lean.
The main goal is an exact phoare judgment about a statement.
Equations
- One or more equations did not get rendered due to their size.
Instances For
β-reduce the goals' types (the conditions a rule builds: fun σ => A σ ∧ E σ).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Clean the goals with the given tags as side conditions (cleanSideGoal); those of
closeTrivial are dropped when intros; trivial or intros; rfl closes them.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A goal ∀ σ, A σ → ENNReal.ofReal x = ENNReal.ofReal y: the equation x = y of reals
(EC's bounds are reals); any other goal unchanged.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's case (E) on a phoare judgment: goals pos (E added to the precondition),
neg (¬E).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's conseq (: _ ==> _ : = e): the bound e (a real, read like the judgment's
conditions) for the judgment's. Goals bound (the two bounds are equal under the
precondition; an equation of reals when the judgment's bound is ENNReal.ofReal _), then the
judgment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's conseq (: _ ==> Q₁) (: _ ==> Q₂) on an exact bound: the judgment for the event
Q₁, and Q₂ in Hoare logic. Goals in EC's order: post (under Q₂, Q₁ iff the judgment's
event), hoare, then the judgment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's conseq H on a phoare judgment, H a judgment about the same statement and
postcondition: goals pre (the goal's precondition implies H's) and bound (the bounds are
equal under the goal's precondition), each closed when trivial.
Equations
- One or more equations did not get rendered due to their size.