- nothing : t
- join : t → t → t
Instances For
class
GaudisCrypt.Reducible
{t : Type u_1}
(ind : InductiveFunction t)
extends Preorder t, Std.Commutative ind.join, Std.Associative ind.join :
Type u_1
- delta_bound {holes : HoleSigs} {sig : ProcedureSignature} (proc : ProcedureWithHoles holes sig) (args : holes.Instantiation) : ind.proc (proc.instantiate args) ≤ List.foldr (fun (p : (sig : ProcedureSignature) × Procedure sig) (acc : t) => ind.join (ind.proc p.snd) acc) (ind.proc proc) args.toList
Instances
def
GaudisCrypt.InductiveFunction.evalInstantiationFold
{t : Type u_1}
(ind : InductiveFunction t)
{holes : HoleSigs}
(inst : holes.Instantiation)
:
t
Evaluate an instantiation (a dependent tuple of procedures) by folding over the list
inst.toList.
This matches the evaluation of inst.toModuleTuple under evalMexpr (see
evalMexpr_toModuleTuple).
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
GaudisCrypt.InductiveFunction.evalMexpr
{t : Sort u_1}
(ind : InductiveFunction t)
(m : ModuleExpression)
:
t
Equations
- ind.evalMexpr (GaudisCrypt.ModuleExpression.proc p) = ind.proc p
- ind.evalMexpr (GaudisCrypt.ModuleExpression.procHoles a p) = ind.proc p
- ind.evalMexpr (GaudisCrypt.ModuleExpression.var a) = ind.nothing
- ind.evalMexpr (m_2.app n) = ind.join (ind.evalMexpr m_2) (ind.evalMexpr n)
- ind.evalMexpr m_2.fst = ind.evalMexpr m_2
- ind.evalMexpr m_2.snd = ind.evalMexpr m_2
- ind.evalMexpr m_2.abs = ind.evalMexpr m_2
- ind.evalMexpr (m_2.pair n) = ind.join (ind.evalMexpr m_2) (ind.evalMexpr n)
- ind.evalMexpr GaudisCrypt.ModuleExpression.unit = ind.nothing
Instances For
theorem
GaudisCrypt.InductiveFunction.evalMexpr_rename
{t : Type u_1}
(ind : InductiveFunction t)
(m : ModuleExpression)
(ρ : ℕ → ℕ)
:
theorem
GaudisCrypt.InductiveFunction.evalMexpr_substituteSimultaneously_le
{t : Type u_1}
(ind : InductiveFunction t)
[Reducible ind]
(m : ModuleExpression)
(σ : ℕ → ModuleExpression)
(extra : t)
:
theorem
GaudisCrypt.InductiveFunction.evalMexpr_substitute_le
{t : Type u_1}
(ind : InductiveFunction t)
[Reducible ind]
(body arg : ModuleExpression)
:
def
GaudisCrypt.InductiveFunction.eval'
{t : Sort u_1}
{mt : ModuleTypeRep}
(ind : InductiveFunction t)
(m : Module mt)
:
t
Equations
- ind.eval' m = ind.evalMexpr m.expression
Instances For
def
GaudisCrypt.InductiveFunction.eval
{M : Type 1}
{t : Sort u_1}
(ind : InductiveFunction t)
[i : IsModule M]
(m : M)
:
t
Equations
- ind.eval m = ind.eval' (GaudisCrypt.Module.cast M m)
Instances For
theorem
GaudisCrypt.InductiveFunction.evalMexpr_toModuleTuple
{t : Type u_1}
(ind : InductiveFunction t)
{holes : HoleSigs}
(inst : holes.Instantiation)
:
theorem
GaudisCrypt.eval_induction_step
{t : Type u_1}
(ind : InductiveFunction t)
[Reducible ind]
{m m' : ModuleExpression}
(h : m.ReductionStep m')
:
theorem
GaudisCrypt.evalMexpr_reduce
{t : Type u_1}
(ind : InductiveFunction t)
[Reducible ind]
(m : ModuleExpression)
(h : m.Terminating)
:
theorem
GaudisCrypt.evalMexpr_upper_bound
{t : Type u_1}
{mt : ModuleTypeRep}
(ind : InductiveFunction t)
[Reducible ind]
{m : ModuleExpression}
(h : m.HasType [] mt)
:
theorem
GaudisCrypt.InductiveFunction.app_moduleExpression
{t : Sort u_1}
(ind : InductiveFunction t)
(a b : ModuleExpression)
:
theorem
GaudisCrypt.InductiveFunction.app'
{t : Type u_1}
{A B : ModuleTypeRep}
(ind : InductiveFunction t)
[Reducible ind]
(a : Module (A.arr B))
(b : Module A)
:
theorem
GaudisCrypt.InductiveFunction.app
{t : Type u_1}
{A B : Type 1}
(ind : InductiveFunction t)
[Reducible ind]
[IsModule A]
[IsModule B]
(a : Module.Arr A B)
(b : A)
:
theorem
GaudisCrypt.InductiveFunction.pair_moduleExpression
{t : Sort u_1}
(ind : InductiveFunction t)
(a b : ModuleExpression)
:
theorem
GaudisCrypt.InductiveFunction.pair'
{t : Sort u_1}
{A B : ModuleTypeRep}
(ind : InductiveFunction t)
(a : Module A)
(b : Module B)
:
theorem
GaudisCrypt.InductiveFunction.pair
{t : Sort u_1}
{A B : Type 1}
(ind : InductiveFunction t)
[IsModule A]
[IsModule B]
(a : A)
(b : B)
:
@[simp]
theorem
GaudisCrypt.InductiveFunction.fst_moduleExpression
{t : Sort u_1}
(ind : InductiveFunction t)
(a : ModuleExpression)
:
theorem
GaudisCrypt.InductiveFunction.fst'
{t : Type u_1}
{A B : ModuleTypeRep}
(ind : InductiveFunction t)
[Reducible ind]
(a : Module (A.prod B))
:
theorem
GaudisCrypt.InductiveFunction.fst
{t : Type u_1}
{A B : Type 1}
(ind : InductiveFunction t)
[Reducible ind]
[IsModule A]
[IsModule B]
(a : Module.Prod A B)
:
@[simp]
theorem
GaudisCrypt.InductiveFunction.snd_moduleExpression
{t : Sort u_1}
(ind : InductiveFunction t)
(a : ModuleExpression)
:
theorem
GaudisCrypt.InductiveFunction.snd'
{t : Type u_1}
{A B : ModuleTypeRep}
(ind : InductiveFunction t)
[Reducible ind]
(a : Module (A.prod B))
:
theorem
GaudisCrypt.InductiveFunction.snd
{t : Type u_1}
{A B : Type 1}
(ind : InductiveFunction t)
[Reducible ind]
[IsModule A]
[IsModule B]
(a : Module.Prod A B)
:
@[simp]
theorem
GaudisCrypt.InductiveFunction.unit_moduleExpression
{t : Sort u_1}
(ind : InductiveFunction t)
:
@[simp]
theorem
GaudisCrypt.InductiveFunction.unit
{t : Sort u_1}
(ind : InductiveFunction t)
(m : Module ModuleTypeRep.unit)
:
Instances For
def
GaudisCrypt.InductiveFunctionGettersSetters.transfer
{T : Type 1 → Type u_1}
(ind : InductiveFunctionGettersSetters T)
(x : T ProgramState)
:
Equations
- ind.transfer x = ind.extend GaudisCrypt.ProgramState.globalL (ind.reduce GaudisCrypt.ProgramState.globalL x)
Instances For
def
GaudisCrypt.InductiveFunctionGettersSetters.stmt
{T : Type 1 → Type u_1}
(ind : InductiveFunctionGettersSetters T)
{holes : HoleSigs}
:
StmtWithHoles holes → T ProgramState
Equations
- One or more equations did not get rendered due to their size.
- ind.stmt GaudisCrypt.StmtWithHoles.skip = ind.nothing
- ind.stmt (GaudisCrypt.StmtWithHoles.sample x_1 e) = ind.join (ind.setter x_1) (ind.getter e)
- ind.stmt (GaudisCrypt.StmtWithHoles.hole n x_1 p) = ind.join (ind.setter x_1) (ind.getter p)
- ind.stmt (s1.seq s2) = ind.join (ind.stmt s1) (ind.stmt s2)
- ind.stmt (GaudisCrypt.StmtWithHoles.ifThenElse c t e) = ind.join (ind.getter c) (ind.join (ind.stmt t) (ind.stmt e))
- ind.stmt (GaudisCrypt.StmtWithHoles.while c t) = ind.join (ind.getter c) (ind.stmt t)
Instances For
def
GaudisCrypt.InductiveFunctionGettersSetters.proc
{T : Type 1 → Type u_1}
(ind : InductiveFunctionGettersSetters T)
{sig : ProcedureSignature}
{holes : HoleSigs}
(proc : ProcedureWithHoles holes sig)
:
Equations
- ind.proc proc = ind.join (ind.reduce GaudisCrypt.ProgramState.globalL (ind.stmt proc.body)) (ind.reduce GaudisCrypt.ProgramState.globalL (ind.getter proc.return_val))
Instances For
class
GaudisCrypt.ReducibleGettersSetters
{T : Type 1 → Type u_1}
(ind : InductiveFunctionGettersSetters T)
:
Type (max 2 u_1)
- comm {t : Type 1} : Std.Commutative ind.join
- assoc {t : Type 1} : Std.Associative ind.join
- reduce_mono {a b : Type 1} {r₁ r₂ : T b} (lens : Lens a b) : r₁ ≤ r₂ → ind.reduce lens r₁ ≤ ind.reduce lens r₂
Monotonicity of
reduce. Under only aPreorderthis is not derivable fromreduce_join(the old derivation used antisymmetry to turnr₁ ≤ r₂intojoin r₁ r₂ = r₂). - extend_mono {a b : Type 1} {r₁ r₂ : T a} (lens : Lens a b) : r₁ ≤ r₂ → ind.extend lens r₁ ≤ ind.extend lens r₂
Monotonicity of
extend; seereduce_mono.
Instances
def
GaudisCrypt.InductiveFunctionGettersSetters.inductiveFunction
{T : Type 1 → Type u_1}
(ind : InductiveFunctionGettersSetters T)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
GaudisCrypt.InductiveFunctionGettersSetters.evalMexpr
{T : Type 1 → Type u_1}
(ind : InductiveFunctionGettersSetters T)
:
Equations
- ind.evalMexpr = ind.inductiveFunction.evalMexpr
Instances For
def
GaudisCrypt.InductiveFunctionGettersSetters.eval'
{T : Type 1 → Type u_1}
{t : ModuleTypeRep}
(ind : InductiveFunctionGettersSetters T)
:
Module t → T VariableAssignment
Equations
- ind.eval' = ind.inductiveFunction.eval'
Instances For
def
GaudisCrypt.InductiveFunctionGettersSetters.eval
{T : Type 1 → Type u_1}
{M : Type 1}
(ind : InductiveFunctionGettersSetters T)
[IsModule M]
:
M → T VariableAssignment
Equations
- ind.eval = ind.inductiveFunction.eval
Instances For
@[implicit_reducible]
instance
GaudisCrypt.instReducibleVariableAssignmentInductiveFunctionOfReducibleGettersSetters
{T : Type 1 → Type u_1}
{ind : InductiveFunctionGettersSetters T}
[red : ReducibleGettersSetters ind]
:
Equations
- One or more equations did not get rendered due to their size.