File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/Lean/Meta/Tactic/Grind Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,23 @@ private def ppEqcs (goal : Goal) : MetaM (Array MessageData) := do
99
99
result := result.push <| .trace { cls := `eqc } "Equivalence classes" otherEqcs
100
100
return result
101
101
102
+ private def ppEMatchTheorem (thm : EMatchTheorem) : MetaM MessageData := do
103
+ let m := m!"{← thm.origin.pp}\n {← inferType thm.proof}\n patterns: {thm.patterns.map ppPattern}"
104
+ return .trace { cls := `thm } m #[]
105
+
106
+ private def ppActiveTheorems (goal : Goal) : MetaM MessageData := do
107
+ let m ← goal.thms.toArray.mapM ppEMatchTheorem
108
+ let m := m ++ (← goal.newThms.toArray.mapM ppEMatchTheorem)
109
+ if m.isEmpty then
110
+ return ""
111
+ else
112
+ return .trace { cls := `ematch } "E-matching" m
113
+
102
114
def goalToMessageData (goal : Goal) : MetaM MessageData := goal.mvarId.withContext do
103
115
let mut m : Array MessageData := #[.ofGoal goal.mvarId]
104
116
m := m.push <| ppExprArray `facts "Asserted facts" goal.facts.toArray `prop
105
117
m := m ++ (← ppEqcs goal)
118
+ m := m.push (← ppActiveTheorems goal)
106
119
addMessageContextFull <| MessageData.joinSep m.toList ""
107
120
108
121
def goalsToMessageData (goals : List Goal) : MetaM MessageData :=
You can’t perform that action at this time.
0 commit comments