Skip to content

Commit

Permalink
Inhabitation reasoning bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JOSHCLUNE committed Jun 9, 2024
1 parent da37648 commit 5fb1680
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Duper/Util/TypeInhabitationReasoning.lean
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ def removeVanishedVarsHelper (c : Clause) (verifiedInhabitedTypes : abstractedMV
potentiallyUninhabitedTypes := abstractedType :: potentiallyUninhabitedTypes
resPotentiallyVacuous := true
| some _ => -- Don't remove mvarId because it appears in clause body
let abstractedType ← abstractMVars mvarType -- Need to redefine `abstractedType` because `Meta.findInstance` can modify metavariables that appear in `mvarType`
trace[duper.typeInhabitationReasoning.debug] "Adding abstractedType {abstractedType.expr} corresponding to {mvarType} to verifiedInhabitedtypes"
verifiedInhabitedTypes := abstractedType :: verifiedInhabitedTypes
else
if verifiedInhabitedTypes.contains abstractedType then
Expand Down Expand Up @@ -298,6 +300,8 @@ def removeVanishedVarsHelper (c : Clause) (verifiedInhabitedTypes : abstractedMV
resPotentiallyVacuous := true
| some _ =>
trace[duper.typeInhabitationReasoning.debug] "{mvar} is to be removed because Meta.findInstance found an instance for {mvarType}"
let abstractedType ← abstractMVars mvarType -- Need to redefine `abstractedType` because `Meta.findInstance` can modify metavariables that appear in `mvarType`
trace[duper.typeInhabitationReasoning.debug] "Adding abstractedType {abstractedType.expr} corresponding to {mvarType} to verifiedInhabitedtypes"
verifiedInhabitedTypes := abstractedType :: verifiedInhabitedTypes
mvarIdsToRemove := mvarId :: mvarIdsToRemove
if mvarIdsToRemove.isEmpty then
Expand Down

0 comments on commit 5fb1680

Please sign in to comment.