lean4-htt/src/Lean/Elab/Eval.lean
2025-07-25 12:02:51 +00:00

24 lines
667 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-
Copyright (c) 2022 Sebastian Ullrich. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich
-/
module
prelude
public import Lean.Meta.Eval
public import Lean.Elab.SyntheticMVars
public section
namespace Lean.Elab.Term
open Meta
unsafe def evalTerm (α) (type : Expr) (value : Syntax) (safety := DefinitionSafety.safe) : TermElabM α := withoutModifyingEnv do
let v ← elabTermEnsuringType value type
synthesizeSyntheticMVarsNoPostponing
let v ← instantiateMVars v
if (← logUnassignedUsingErrorInfos (← getMVars v)) then throwAbortTerm
evalExpr α type v safety
end Lean.Elab.Term