Skip to content

Commit ef3b595

Browse files
committed
update
1 parent 0a933a4 commit ef3b595

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

Loda/Env.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def getCircuitFromEnv (name : String) : Lean.CoreM (Option Ast.Circuit) := do
7979
return lookupCircuit (circuitExt.getState env) name
8080

8181
/-- A type environment: maps variable names to Loda `Ty`s. -/
82-
def TyEnv := List (String × Ast.Ty)
82+
abbrev TyEnv := List (String × Ast.Ty)
8383

8484
/--
8585
Extend `Γ` by binding `ident` to `τ`.

Loda/PropSemantics.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ match Env.lookupTy Γ ident, Env.lookupVal σ ident with
5353
-- any other case is false
5454
| _, _ => False
5555

56-
def tyenvToProp (σ: Env.ValEnv) (Δ: Env.CircuitEnv) (Γ: List (String × Ast.Ty)): Prop :=
56+
def tyenvToProp (σ: Env.ValEnv) (Δ: Env.CircuitEnv) (Γ: Env.TyEnv): Prop :=
5757
∀ e ∈ Γ, varToProp σ Δ Γ e.1
5858

5959
end PropSemantics

Loda/Typing.lean

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,7 @@ def circuitCorrect (δ : Env.CircuitEnv) (c : Ast.Circuit) : Prop :=
158158
PropSemantics.tyenvToProp σ δ Γ →
159159
@TypeJudgment σ δ Γ c.body c.output.snd
160160

161-
/-
162-
(hΓx : Env.lookupTy Γ x = Ty.refin Ty.field (Predicate.eq ex))
163-
(htyenv: PropSemantics.tyenvToProp σ Δ Γ x)
164-
(hmt : PropSemantics.multi_tyenvToProp σ Δ Γ)
165-
-/
166-
167-
lemma lookupTy_mem (Γ: List (String × Ast.Ty)) (x: String) (τ :Ast.Ty) (φ: Ast.Predicate)
161+
lemma lookupTy_mem (Γ: Env.TyEnv) (x: String) (τ :Ast.Ty) (φ: Ast.Predicate)
168162
(h : Env.lookupTy Γ x = Ast.Ty.refin τ φ) :
169163
(x, Ast.Ty.refin τ φ) ∈ Γ := by
170164
by_contra hn
@@ -179,7 +173,7 @@ lemma lookupTy_mem (Γ: List (String × Ast.Ty)) (x: String) (τ :Ast.Ty) (φ: A
179173
}
180174

181175
lemma tyenvToProp_implies_varToProp
182-
(σ : Env.ValEnv) (Δ : Env.CircuitEnv) (Γ : List (String × Ast.Ty))
176+
(σ : Env.ValEnv) (Δ : Env.CircuitEnv) (Γ : Env.TyEnv)
183177
(x : String) (τ : Ast.Ty) (φ : Ast.Predicate)
184178
(hΓx : Env.lookupTy Γ x = Ast.Ty.refin τ φ)
185179
(hmt : PropSemantics.tyenvToProp σ Δ Γ) :

0 commit comments

Comments
 (0)