@@ -396,16 +396,16 @@ inductive Expr where
396396 Expr.letE `x (.const `Nat []) (.lit (.natVal 2)) (.app (.const `Nat.succ []) (.bvar 0)) true
397397 ```
398398
399- If the `nonDep ` flag is `true`, then the elaborator treats this as a *non-dependent `let`* (known as a *`have` expression* ).
399+ If the `nondep ` flag is `true`, then the elaborator treats this as a *non-dependent `let`* (known as a *`have` expression* ).
400400 Given an environment, a metavariable context, and a local context,
401401 we say a let-expression `let x : t := v; e` is non-dependent when it is equivalent
402402 to `(fun x : t => e) v`. In contrast, the dependent let-expression
403403 `let n : Nat := 2; fun (a : Array Nat n) (b : Array Nat 2) => a = b` is type correct,
404404 but `(fun (n : Nat) (a : Array Nat n) (b : Array Nat 2) => a = b) 2` is not.
405405
406- The kernel does not verify `nonDep ` when type checking. This is an elaborator feature.
406+ The kernel does not verify `nondep ` when type checking. This is an elaborator feature.
407407 -/
408- | letE (declName : Name) (type : Expr) (value : Expr) (body : Expr) (nonDep : Bool)
408+ | letE (declName : Name) (type : Expr) (value : Expr) (body : Expr) (nondep : Bool)
409409
410410 /--
411411 Natural number and string literal values.
@@ -670,9 +670,9 @@ def mkSimpleThunkType (type : Expr) : Expr :=
670670def mkSimpleThunk (type : Expr) : Expr :=
671671 mkLambda `_ BinderInfo.default (mkConst `Unit) type
672672
673- /-- Returns `let x : t := v; b`, a dependent `let` expression. If `nonDep := true`, then returns a `have`. -/
674- @[inline] def mkLet (x : Name) (t : Expr) (v : Expr) (b : Expr) (nonDep : Bool := false ) : Expr :=
675- .letE x t v b nonDep
673+ /-- Returns `let x : t := v; b`, a `let` expression. If `nondep := true`, then returns a `have`. -/
674+ @[inline] def mkLet (x : Name) (t : Expr) (v : Expr) (b : Expr) (nondep : Bool := false ) : Expr :=
675+ .letE x t v b nondep
676676
677677/-- Returns `have x : t := v; b`, a non-dependent `let` expression. -/
678678@[inline] def mkHave (x : Name) (t : Expr) (v : Expr) (b : Expr) : Expr :=
@@ -724,7 +724,7 @@ def mkStrLit (s : String) : Expr :=
724724@[export lean_expr_mk_app] def mkAppEx : Expr → Expr → Expr := mkApp
725725@[export lean_expr_mk_lambda] def mkLambdaEx (n : Name) (d b : Expr) (bi : BinderInfo) : Expr := mkLambda n bi d b
726726@[export lean_expr_mk_forall] def mkForallEx (n : Name) (d b : Expr) (bi : BinderInfo) : Expr := mkForall n bi d b
727- @[export lean_expr_mk_let] def mkLetEx (n : Name) (t v b : Expr) (nonDep : Bool) : Expr := mkLet n t v b nonDep
727+ @[export lean_expr_mk_let] def mkLetEx (n : Name) (t v b : Expr) (nondep : Bool) : Expr := mkLet n t v b nondep
728728@[export lean_expr_mk_lit] def mkLitEx : Literal → Expr := mkLit
729729@[export lean_expr_mk_mdata] def mkMDataEx : MData → Expr → Expr := mkMData
730730@[export lean_expr_mk_proj] def mkProjEx : Name → Nat → Expr → Expr := mkProj
@@ -875,7 +875,7 @@ def isLet : Expr → Bool
875875
876876/-- Return `true` if the given expression is a non-dependent let-expression (a have-expression). -/
877877def isHave : Expr → Bool
878- | letE (nonDep := nonDep ) .. => nonDep
878+ | letE (nondep := nondep ) .. => nondep
879879 | _ => false
880880
881881@[export lean_expr_is_have] def isHaveEx : Expr → Bool := isHave
@@ -1020,8 +1020,8 @@ def letBody! : Expr → Expr
10201020 | letE _ _ _ b .. => b
10211021 | _ => panic! "let expression expected"
10221022
1023- def letNonDep ! : Expr → Bool
1024- | letE _ _ _ _ nonDep => nonDep
1023+ def letNondep ! : Expr → Bool
1024+ | letE _ _ _ _ nondep => nondep
10251025 | _ => panic! "let expression expected"
10261026
10271027def consumeMData : Expr → Expr
@@ -1854,26 +1854,26 @@ def updateLambda! (e : Expr) (newBinfo : BinderInfo) (newDomain : Expr) (newBody
18541854 | lam n d b bi => updateLambda! (lam n d b bi) bi newDomain newBody
18551855 | _ => panic! "lambda expected"
18561856
1857- @[inline] private unsafe def updateLet!Impl (e : Expr) (newType : Expr) (newVal : Expr) (newBody : Expr) (newNonDep : Bool) : Expr :=
1857+ @[inline] private unsafe def updateLet!Impl (e : Expr) (newType : Expr) (newVal : Expr) (newBody : Expr) (newNondep : Bool) : Expr :=
18581858 match e with
1859- | letE n t v b nonDep =>
1860- if ptrEq t newType && ptrEq v newVal && ptrEq b newBody && nonDep == newNonDep then
1859+ | letE n t v b nondep =>
1860+ if ptrEq t newType && ptrEq v newVal && ptrEq b newBody && nondep == newNondep then
18611861 e
18621862 else
1863- letE n newType newVal newBody newNonDep
1863+ letE n newType newVal newBody newNondep
18641864 | _ => panic! "let expression expected"
18651865
18661866@[implemented_by updateLet!Impl]
1867- def updateLet! (e : Expr) (newType : Expr) (newVal : Expr) (newBody : Expr) (newNonDep : Bool) : Expr :=
1867+ def updateLet! (e : Expr) (newType : Expr) (newVal : Expr) (newBody : Expr) (newNondep : Bool) : Expr :=
18681868 match e with
1869- | letE n _ _ _ _ => letE n newType newVal newBody newNonDep
1869+ | letE n _ _ _ _ => letE n newType newVal newBody newNondep
18701870 | _ => panic! "let expression expected"
18711871
1872- /-- Like `Expr.updateLet!` but preserves the `nonDep ` flag. -/
1872+ /-- Like `Expr.updateLet!` but preserves the `nondep ` flag. -/
18731873@[inline]
18741874def updateLetE! (e : Expr) (newType : Expr) (newVal : Expr) (newBody : Expr) : Expr :=
18751875 match e with
1876- | letE n t v b nonDep => updateLet! (letE n t v b nonDep ) newType newVal newBody nonDep
1876+ | letE n t v b nondep => updateLet! (letE n t v b nondep ) newType newVal newBody nondep
18771877 | _ => panic! "let expression expected"
18781878
18791879def updateFn : Expr → Expr → Expr
0 commit comments