Open
Conversation
1268804 to
ee97d51
Compare
…at the smt level + generalize mvar instanitation at preprocessing phase
ee97d51 to
5278b11
Compare
15 tasks
RSoulatIOHK
approved these changes
Mar 19, 2026
Collaborator
RSoulatIOHK
left a comment
There was a problem hiding this comment.
Apart from the known limitations currently, this works really well and is really elegant. Way more elegant than any solution I was considering.
RSoulatIOHK
reviewed
Mar 19, 2026
|
|
||
| private def SortExpr.hash : SortExpr → UInt64 | ||
| | .SymbolSort s => mixHash 17 s.hash | ||
| | .ParamSort s ps => mixHash 19 (Array.foldl (λ acc se => (acc.1 + 2, mixHash acc.2 se.hash)) (1, s.hash) ps).1 |
Collaborator
There was a problem hiding this comment.
The fold accumulates a (counter, hash) pair, right?
Shouldn't the final projection be .2 the accumulated hash rather than .1 (the counter) so that we can differentiate between List Nat and List Int for example?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Properly handling sort universe at smt level
Description
This PR addresses issue #43 and perform the following modifications:
Optimization:
normMVar. This function expects that eachmvarmust be assigned in the Lean4 environment whenoptimizeExpris invoked. Otherwise an error is triggerednormFVarhas been simplified to directly optimize any assigned value (if any). Indeed, anymvarin the assigned value will now be handled bynormMVar.normLevelhas been updated to only normalize any universe level meta variable present in a given Level.Smt Translation
isSortOrInhabitedto considerexistsQuantifierflag to forbid sort type quantifier removal for existential quantifiersBlaster tactic
mvarinstantiation at the preprocessing phase.Test suite:
Issue31.leanhas been added to show that:Issue25.leanhas been updated to avoid wrong sort unificationIssue27.leanhas been updated to reflect current implementationIssue15.leanhas been updated to consider new test casesIssue20.leanhas been updated to consider new test casesCloses #32
Checklist