The read normal form, and a strict skip #
What a judgment tactic leaves for the logic is a goal about program states σ (one, or two for a
relational judgment). The closers work on goals about plain values. The step between the two,
generalizing every read of a state to a value, only works when the reads are spelled one way.
The read normal form #
A proposition P is in read normal form for the states σ₁ … σₙ when
- (atoms) every occurrence of a state is inside a read
x.get σ(a lens or getterxon the program state: a local variable) orX.get σ.globals(a global variable, a region's getter), wherex,Xmention no state; - (no expressions around reads) no
eval, no(Getter.mk f).get σ, no read of a pair or a component lens:(x.pair y).get σis(x.get σ, y.get σ); - (no reads through writes) no state other than the
σᵢthemselves:x.get (y.set v σ)isx.get σ(orv), a reset or an inliner's renaming under a read is gone; - (tests) the
Decidableinstance of everydecide/ifis the one of the proposition as it stands, so that a read inside an instance is the same atom as the visible one; - (regions) a region that is a set of variables is read as the variables
(
TacticMisc.globTuples).
ReadNorm.normalize brings a goal to this form with the existing steps, all of them, in one
order: relSimpDecls (reads through writes), unfoldReads, normDecideGoal, normInst,
globTuples.
Until now each path applied its own subset (the Hoare and pHL paths no normDecide: the reads
then do not generalize, and the goal silently stays about the states).
ReadNorm.offenders lists the places where a state is used other than by an atom.
ec_skip #
EC's skip on a Hoare triple, a phoare judgment or a relational one whose code is used up:
the implication, normalized, with every read generalized to a value. Unlike hoare_skip,
phoare_skip and equiv_skip, it fails if a state survives, and says where it is still used.
The generalized values are named after their variables (x, or x₁/x₂ by side).
New name, old tactics unchanged: proofs move to it one file at a time
(notes/SHA3/TacticReview.md, step 3).
The target of g, a proposition about the states σs (free variables of its context), in
read normal form (see the module docstring).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The subterms of e that use a state of σs other than by a read in normal form: an
application with a state (or its globals) as an argument that is not a read x.get σ with x
free of states. Empty for a proposition in read normal form. Each comes with its printed form,
made where it stands (under the binders it is under, so that their variables print by name).
A goal ∀ σ₁ … σₙ : ProgramState, P (n is 1 or 2): P normalized and every read
generalized, ∀ x₁ … xₖ, P'. Fails if a state is still used, naming the places.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- GaudisCrypt.ReadNorm.generalizeStrict.count t n = n
Instances For
EC's skip on a judgment whose code is used up (see the module docstring).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's skip, strict: on a Hoare triple, a phoare judgment or a relational judgment
whose code is skip, the implication in read normal form with every read a value
(Logic/ReadNorm.lean). Fails if a state survives.
Equations
- tacticEc_skip = Lean.ParserDescr.node `tacticEc_skip 1024 (Lean.ParserDescr.nonReservedSymbol "ec_skip" false)