feat: add admit tactic
This commit is contained in:
parent
9526a4da3b
commit
eb32fec77e
2 changed files with 14 additions and 0 deletions
|
|
@ -340,5 +340,9 @@ u ← getDecLevel `mkArrayLit type;
|
|||
listLit ← mkListLit type xs;
|
||||
pure (mkApp (mkApp (mkConst `List.toArray [u]) type) listLit)
|
||||
|
||||
def mkSorry (type : Expr) (synthetic : Bool) : MetaM Expr := do
|
||||
u ← getLevel type;
|
||||
pure $ mkApp2 (mkConst `sorryAx [u]) type (toExpr synthetic)
|
||||
|
||||
end Meta
|
||||
end Lean
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Meta.Basic
|
||||
import Lean.Meta.AppBuilder
|
||||
import Lean.Meta.LevelDefEq
|
||||
|
||||
namespace Lean
|
||||
|
|
@ -44,5 +45,14 @@ instance Meta.hasOrelse {α} : HasOrelse (MetaM α) := ⟨Meta.orelse⟩
|
|||
@[init] private def regTraceClasses : IO Unit :=
|
||||
registerTraceClass `Meta.Tactic
|
||||
|
||||
/-- Assign `mvarId` to `sorryAx` -/
|
||||
def admit (mvarId : MVarId) (synthetic := true) : MetaM Unit :=
|
||||
withMVarContext mvarId $ do
|
||||
checkNotAssigned mvarId `admit;
|
||||
mvarType ← getMVarType mvarId;
|
||||
val ← mkSorry mvarType synthetic;
|
||||
assignExprMVar mvarId val;
|
||||
pure ()
|
||||
|
||||
end Meta
|
||||
end Lean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue