Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split on unique conditions. #2010

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Split on unique conditions. #2010

merged 3 commits into from
Jan 16, 2024

Conversation

andreistefanescu
Copy link
Contributor

No description provided.

@@ -936,7 +936,7 @@ hoistIfs sc t = do
let ss :: Simpset () = addRules rules emptySimpset

(t', conds) <- doHoistIfs sc ss cache itePat . snd =<< rewriteSharedTerm sc ss t
splitConds sc ss (map fst conds) t'
splitConds sc ss (Set.toList $ Set.fromList $ map fst conds) t'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend using nubOrd from Data.List.Extra, which we already use in other parts of saw-script:

import Data.List.Extra (nubOrd)

...

splitConds sc ss (nubOrd $ map fst conds) t'

@@ -936,7 +936,7 @@ hoistIfs sc t = do
let ss :: Simpset () = addRules rules emptySimpset

(t', conds) <- doHoistIfs sc ss cache itePat . snd =<< rewriteSharedTerm sc ss t
splitConds sc ss (map fst conds) t'
splitConds sc ss (Set.toList $ Set.fromList $ map fst conds) t'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This deserves some comments about why we need to remove duplicates here.

@andreistefanescu andreistefanescu merged commit 3aa9f31 into master Jan 16, 2024
38 checks passed
@andreistefanescu andreistefanescu deleted the split-cond branch January 16, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants