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

Dictionary translation changes for comparisons #1582

Merged
merged 4 commits into from
Feb 15, 2022
Merged

Dictionary translation changes for comparisons #1582

merged 4 commits into from
Feb 15, 2022

Conversation

brianhuffman
Copy link
Contributor

Simplify the formulas generated by the cryptol-saw-core translator for Cryptol comparison operators like <=, <, and <$.

@brianhuffman
Copy link
Contributor Author

There's one further improvement we might want to do that this PR does not do: Lexicographic comparisons on vectors are implemented as a right-fold using the cmp operations. If the definition of vecCmp is unfolded, then we can still end up with redundant logical connectives like ors with False.

Copy link
Contributor

@robdockins robdockins left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

I don't have a strong opinion about the vector issue. I suspect it is less likely to end up in rewrite rules and such.

Brian Huffman added 4 commits February 14, 2022 18:13
Also add similar `slt` field to `SignedCmp` dictionary.

These fields are used to simplify the formulas generated by the
cryptol-saw-core translator for Cryptol operators like `<` and
`<$`, avoiding redundant logical connectives.

Fixes #1565.
This makes it so that `<=` can be translated to less-than-or-equal
operators in saw-core (e.g. `bvsle` or `intLe`) instead of `not`
combined with a strict less-than the other way around.
This should make it possible for `cryptol_ss` to simplify
things like `(<)` to `intLt` even when partially applied.
@brianhuffman brianhuffman added the PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run label Feb 15, 2022
@mergify mergify bot merged commit e746787 into master Feb 15, 2022
@mergify mergify bot deleted the cmp-lt branch February 15, 2022 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: ready to merge Magic flag for pull requests to ask Mergify to merge given an approval and a successful CI run
Projects
None yet
2 participants