feat: add admit tactic

This commit is contained in:
Leonardo de Moura 2020-08-05 15:33:49 -07:00
parent 9526a4da3b
commit eb32fec77e
2 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -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