fix: grind minor issues (#11244)
This PR fixes minor issues in `grind`. In preparation for adding `grind -revert`.
This commit is contained in:
parent
fa5d08b7de
commit
6dd8ad13e5
2 changed files with 8 additions and 4 deletions
|
|
@ -91,6 +91,10 @@ where
|
|||
return e'
|
||||
|
||||
preprocess (e : Expr) : M Expr := do
|
||||
/-
|
||||
**Note**: We must use `instantiateMVars` here because this function is called using the result of `inferType`.
|
||||
-/
|
||||
let e ← instantiateMVars e
|
||||
/-
|
||||
We must unfold reducible constants occurring in `prop` because the congruence closure
|
||||
module in `grind` assumes they have been expanded.
|
||||
|
|
|
|||
|
|
@ -1003,11 +1003,11 @@ def Goal.getENode? (goal : Goal) (e : Expr) : Option ENode :=
|
|||
def getENode? (e : Expr) : GoalM (Option ENode) :=
|
||||
return (← get).getENode? e
|
||||
|
||||
def throwNonInternalizedExpr (e : Expr) : CoreM α :=
|
||||
def throwNonInternalizedExpr (e : Expr) : MetaM α :=
|
||||
throwError "internal `grind` error, term has not been internalized{indentExpr e}"
|
||||
|
||||
/-- Returns node associated with `e`. It assumes `e` has already been internalized. -/
|
||||
def Goal.getENode (goal : Goal) (e : Expr) : CoreM ENode := do
|
||||
def Goal.getENode (goal : Goal) (e : Expr) : MetaM ENode := do
|
||||
let some n := goal.enodeMap.find? { expr := e }
|
||||
| throwNonInternalizedExpr e
|
||||
return n
|
||||
|
|
@ -1066,7 +1066,7 @@ def getRoot? (e : Expr) : GoalM (Option Expr) := do
|
|||
return (← get).getRoot? e
|
||||
|
||||
/-- Returns the root element in the equivalence class of `e`. -/
|
||||
def Goal.getRoot (goal : Goal) (e : Expr) : CoreM Expr :=
|
||||
def Goal.getRoot (goal : Goal) (e : Expr) : MetaM Expr :=
|
||||
return (← goal.getENode e).root
|
||||
|
||||
@[inline, inherit_doc Goal.getRoot]
|
||||
|
|
@ -1091,7 +1091,7 @@ def Goal.getNext? (goal : Goal) (e : Expr) : Option Expr := Id.run do
|
|||
return some n.next
|
||||
|
||||
/-- Returns the next element in the equivalence class of `e`. -/
|
||||
def Goal.getNext (goal : Goal) (e : Expr) : CoreM Expr :=
|
||||
def Goal.getNext (goal : Goal) (e : Expr) : MetaM Expr :=
|
||||
return (← goal.getENode e).next
|
||||
|
||||
@[inline, inherit_doc Goal.getRoot]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue