Golden tests of pHL on exact bounds (Logic/PHoareExactTactics.lean) #
EC's seq n : E p₁ p₂ p₃ p₄ I with its _, case, and the forms of conseq on
phoare[ c : P ==> Q ] = r (see Logic/ECAutoTest.lean for the format;
scripts/update_golden.py refreshes the expected text).
proc run of module Two as a module: Module.proc Two.run.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Two.run.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of Two.run.procedure with a tuple holeArgs of procedures: the body of proc run 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 [Two.run.procedure.apply_simp]).
The body of proc run of module Two, 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 Two.run.procedure.apply_simp) rather than run. Use Two.run for this procedure as a module.
Equations
- GaudisCrypt.PHoareExactTest.Two.run.procedure = proc () : Bool { var a : Bool, b : Bool; a <$ GaudisCrypt.EC.dbool; b <$ GaudisCrypt.EC.dbool; return §a && §b }
Instances For
The module declared by module Two: the record of its procedures Two.run.
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 Two.apply_simp to apply it with.
Instances For
@[simp]: Two.run = Module.proc Two.run.procedure — true by definition, proc run using no module parameter and so having no holes to fill.