fix: assertion violations at grind checkInvariants (#9700)

This PR fixes assertion violations when `checkInvariants` is enabled in
`grind`
This commit is contained in:
Leonardo de Moura 2025-08-03 14:27:26 +02:00 committed by GitHub
parent d0dc5dfd3d
commit cf48c6004d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -384,6 +384,7 @@ where
-- We must swap the congruence root to ensure `isDiseq` and `getDiseqFor?` work properly
modify fun s => { s with congrTable := s.congrTable.insert { e := n.self } }
setENode n.self { n with congr := n.self }
setENode e { (← getENode e) with congr := n.self }
/-- Ensures collection of equations to be processed is empty. -/
private def resetNewFacts : GoalM Unit :=

View file

@ -47,8 +47,8 @@ def addCongrTable (e : Expr) : GoalM Unit := do
we must ensure that `e` is still the congruence root.
-/
modify fun s => { s with congrTable := s.congrTable.insert { e } }
let node ← getENode e'
setENode e' { node with congr := e }
setENode e' { (← getENode e') with congr := e }
setENode e { (← getENode e) with congr := e }
else
let node ← getENode e
setENode e { node with congr := e' }