Documentation

GaudisCrypt.Logic.RenameReads

Reads through the inliner's renamings of the locals #

Inlining runs the inlined code on the locals renamed (Flatten.trafo: the caller's names, @… escaped; Flatten.rename ren: the cleanup permutation), and a condition about the state before it comes back as a condition about the renamed state, L.get σ. A read of a local n the renaming keeps (ι n = n, computed: no @ at the start, not among ren's names) is the read of n itself (localVarLens_get_mapLocal_embed_of_fix); a global's read is unchanged (globals_trafo_get, globals_rename_get).

rename_reads        -- these reads simplified in the goal and every hypothesis
theorem GaudisCrypt.localVarLens_get_mapLocal_embed (ι : String → String) (hι : Function.Injective ι) (n : String) (T : Type) [i : Nonempty T] {k : ℕ} (hk : k = VariableName.encode n) (σ : ProgramState) :
(localVarLens n T).get ((ProgramState.mapLocal (VariableAssignment.embed ι hι)).get σ) = (localVarLens (ι n) T).get σ

A local read through a renaming of the locals is the renamed local's read.

theorem GaudisCrypt.localVarLens_get_mapLocal_embed_of_fix (ι : String → String) (hι : Function.Injective ι) (n : String) (T : Type) [i : Nonempty T] {k : ℕ} (hk : k = VariableName.encode n) (hfix : ι n = n) (σ : ProgramState) :
(localVarLens n T).get ((ProgramState.mapLocal (VariableAssignment.embed ι hι)).get σ) = (localVarLens n T).get σ

… the same local's read, for a name the renaming keeps.

theorem GaudisCrypt.Lens.chain_get_apply {a : Type u_1} {b : Type u_2} {c : Type u_3} (x : Lens b c) (y : Lens a b) (s : c) :
(x.chain y).get s = y.get (x.get s)

A read through a chain of lenses, one at a time.

escape keeps a name that does not start with @.

rename_reads: the reads through the inliner's renamings of the locals simplified, in the goal and every hypothesis (see the module docstring).

Equations
Instances For