Skip to content

Commit 6dd8ad1

Browse files
authored
fix: grind minor issues (#11244)
This PR fixes minor issues in `grind`. In preparation for adding `grind -revert`.
1 parent fa5d08b commit 6dd8ad1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Lean/Meta/Tactic/Grind/MarkNestedSubsingletons.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ where
9191
return e'
9292

9393
preprocess (e : Expr) : M Expr := do
94+
/-
95+
**Note**: We must use `instantiateMVars` here because this function is called using the result of `inferType`.
96+
-/
97+
let e ← instantiateMVars e
9498
/-
9599
We must unfold reducible constants occurring in `prop` because the congruence closure
96100
module in `grind` assumes they have been expanded.

src/Lean/Meta/Tactic/Grind/Types.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,11 +1003,11 @@ def Goal.getENode? (goal : Goal) (e : Expr) : Option ENode :=
10031003
def getENode? (e : Expr) : GoalM (Option ENode) :=
10041004
return (← get).getENode? e
10051005

1006-
def throwNonInternalizedExpr (e : Expr) : CoreM α :=
1006+
def throwNonInternalizedExpr (e : Expr) : MetaM α :=
10071007
throwError "internal `grind` error, term has not been internalized{indentExpr e}"
10081008

10091009
/-- Returns node associated with `e`. It assumes `e` has already been internalized. -/
1010-
def Goal.getENode (goal : Goal) (e : Expr) : CoreM ENode := do
1010+
def Goal.getENode (goal : Goal) (e : Expr) : MetaM ENode := do
10111011
let some n := goal.enodeMap.find? { expr := e }
10121012
| throwNonInternalizedExpr e
10131013
return n
@@ -1066,7 +1066,7 @@ def getRoot? (e : Expr) : GoalM (Option Expr) := do
10661066
return (← get).getRoot? e
10671067

10681068
/-- Returns the root element in the equivalence class of `e`. -/
1069-
def Goal.getRoot (goal : Goal) (e : Expr) : CoreM Expr :=
1069+
def Goal.getRoot (goal : Goal) (e : Expr) : MetaM Expr :=
10701070
return (← goal.getENode e).root
10711071

10721072
@[inline, inherit_doc Goal.getRoot]
@@ -1091,7 +1091,7 @@ def Goal.getNext? (goal : Goal) (e : Expr) : Option Expr := Id.run do
10911091
return some n.next
10921092

10931093
/-- Returns the next element in the equivalence class of `e`. -/
1094-
def Goal.getNext (goal : Goal) (e : Expr) : CoreM Expr :=
1094+
def Goal.getNext (goal : Goal) (e : Expr) : MetaM Expr :=
10951095
return (← goal.getENode e).next
10961096

10971097
@[inline, inherit_doc Goal.getRoot]

0 commit comments

Comments
 (0)