Lower bounds of footprints: a module's writes #
fp_le bounds FVP.fvP M from above. EC's ={glob M} of a concrete module M is the equality
of M's variables; ours is the equality on FVP.fvP M's touched getter (glob M is the region
M may touch), and to get a variable's equality back, the variable must lie inside that
region: a lower bound.
A region containing every constant write of a lens x (Footprint.HasWrites) contains x's
tests (Footprint.HasWrites.testKer_mem, the argument of Lens.testKer_mem_footprint), and the
tests read x: equal on the region, so equal on x
(Lens.get_eq_of_touched_getter_eq_of_hasWrites). A procedure whose code assigns the global x
somewhere (its callees included) has all of x's constant writes in its footprint: an
assignment's footprint is that of the writes of every value (FVP.fvpInductiveFunctionGS.setter).
fp_writes -- `(FVP.fvP M).HasWrites x`, `M` a concrete module assigning `x` somewhere
fp_writes goes down M's module type to its procedures (Module.fst'/Module.snd', each a
lower bound of M's footprint), unfolds each as the inliner does (Flatten.unfoldProcedure) and
looks for an assignment of x in its code (callees' bodies included). EC reads a concrete
module's globals off its code; this is that reading, for the variables the module writes.
A region with X's constant writes contains X's tests (as Lens.testKer_mem_footprint:
a kernel commuting with the writes keeps X's content, so the test passes it or kills it).
EC's ={glob M} gives ={x} for a variable x whose writes lie in the region.
The writes of code #
An assignment's footprint has the writes of its variable.
The globals' share of a statement has the writes of a global it assigns.
A callee's globals' share, back in the caller's state, has the writes of a global the callee assigns.
A procedure's footprint has the writes of a global its body assigns.
A procedure module's footprint is its procedure's.
Apply lem to g, the new goals (the hypotheses left open).
Equations
- GaudisCrypt.GlobWrites.applyConst g lem = do let __do_lift ← Lean.Meta.mkConstWithFreshMVarLevels lem g.apply __do_lift
Instances For
Run k, restoring the state if it fails.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Rewrite the procedure p (a Module.Proc.procedure M in g's goal) to its code, as the
inliner does.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Close (st s).HasWrites Y (Y a global's lens in the program state) by an assignment of Y
in s, callees' bodies included.
Close (FVP.fvP M).HasWrites X by an assignment of X in one of M's procedures.
The procedures of a module (Module.Proc leaves of its module type, by Module.fst' and
Module.snd').
The globals the module M's code assigns.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The regions already read (globRegion's results).
EC's glob M of a concrete module, off its code: for R = FVP.fvP M, the variables X
M writes, if M touches nothing else (fp_le): the proof of
∀ a b, (R.touched_getter.get a = R.touched_getter.get b) = (X.get a = X.get b).
Equations
- One or more equations did not get rendered due to their size.
Instances For
fp_writes: close (FVP.fvP M).HasWrites x for a concrete module M whose code assigns the
global x somewhere (one of its procedures, a callee's body included).
Equations
- GaudisCrypt.tacticFp_writes = Lean.ParserDescr.node `GaudisCrypt.tacticFp_writes 1024 (Lean.ParserDescr.nonReservedSymbol "fp_writes" false)