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

More Prop simplification rules #628

Merged
merged 1 commit into from
Jan 7, 2025
Merged

More Prop simplification rules #628

merged 1 commit into from
Jan 7, 2025

Conversation

msooseth
Copy link
Collaborator

@msooseth msooseth commented Jan 6, 2025

Description

Three more prop simplification rules.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@msooseth msooseth requested a review from blishko January 6, 2025 19:58
@@ -1232,6 +1234,9 @@ simplifyProp prop =
go (PNeg (PBool b)) = PBool (Prelude.not b)
go (PNeg (PNeg a)) = a

-- Empty buf
go (PEq (Lit 0) (BufLength k)) = peq k (ConcreteBuf "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure this is a simplification?
Is it better on the SMT level to compare arrays instead of computing buffer length and comparing it to 0?

@msooseth
Copy link
Collaborator Author

msooseth commented Jan 6, 2025 via email

@blishko
Copy link
Collaborator

blishko commented Jan 7, 2025

I think it's OK. I was just thinking that if ever hevm would couple buffers with length, then asking for length would be much easier.
But I guess that is not going to happen any time soon.

Copy link
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

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

LGTM!

@msooseth
Copy link
Collaborator Author

msooseth commented Jan 7, 2025

Thanks for the review!

@msooseth msooseth merged commit b44f4b9 into main Jan 7, 2025
9 checks passed
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.

2 participants