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

Handle TError in constrant guard translator #1935

Merged
merged 1 commit into from
Sep 7, 2023
Merged

Handle TError in constrant guard translator #1935

merged 1 commit into from
Sep 7, 2023

Conversation

bboston7
Copy link
Contributor

@bboston7 bboston7 commented Sep 6, 2023

When using constraint guards in instantiations of parameterized modules, Cryptol may replace impossible constraints with TError. To support this behavior, this change adds a case to
importNumericConstraintAsBool that translates those TError constraints to False. This is consistent with
checkProp in Cryptol, which is the Cryptol function that handles evaluation of constraint guard constraints (among other things).

When using constraint guards in instantiations of parameterized modules,
Cryptol may replace impossible constraints with `TError`. To support
this behavior, this change adds a case to
`importNumericConstraintAsBool` that translates those `TError` constraints
to `False`. This is consistent with
[`checkProp` in Cryptol](https://github.com/GaloisInc/cryptol/blob/3973b15236ace5c11fdfabbf811d97daee7885ed/src/Cryptol/Eval.hs#L247),
which is the Cryptol function that handles evaluation of constraint
guard constraints.
@bboston7 bboston7 added the subsystem: cryptol-saw-core Issues related to Cryptol -> saw-core translation with cryptol-saw-core label Sep 6, 2023
@bboston7 bboston7 self-assigned this Sep 6, 2023
@bboston7 bboston7 merged commit ed0af53 into master Sep 7, 2023
@bboston7 bboston7 deleted the bb/cg-error branch September 7, 2023 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: cryptol-saw-core Issues related to Cryptol -> saw-core translation with cryptol-saw-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants