Fresh variables #
EasyCrypt gives a local module or a local clone declared in a section new global variables,
disjoint from those of every module the section declares. Here such variables are lens
parameters of the local declarations, with freshness hypotheses (exception E6 of the SHA-3 port),
and a non-local result instantiates them with lenses that are actually fresh.
Fresh lenses need not exist for an arbitrary footprint: a statement's getters are arbitrary
functions of the state, so a module may read, say, every ℤ-typed slot, and then no ℤ-typed
variable is fresh for it. EasyCrypt's modules have finitely many global variables. This file
states that as Footprint.FinitelySupported: the footprint lies within the slots of finitely many
variable names. Under it, Footprint.exists_fresh gives a fresh variable of any nonempty type,
itself finitely supported, so that several fresh variables can be chosen one after the other.
The footprint lies within the slots of the finitely many variables vs.
Equations
- F.FinitelySupported = ∃ (vs : List GaudisCrypt.VariableName), F ≤ ⨆ v ∈ vs, (GaudisCrypt.varLens v).footprint
Instances For
The slot of a single variable is finitely supported.
A name longer than every name in vs, so different from all of them.
Equations
- GaudisCrypt.freshName vs = String.ofList (List.replicate ((List.map (fun (v : GaudisCrypt.VariableName) => v.name.length) vs).sum + 1) 'x')
Instances For
Fresh variables. For a finitely supported footprint F and a nonempty type T, some
variable of type T lies outside F; its slot is itself finitely supported.