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

Revised semantics for errors #619

Closed
brianhuffman opened this issue Jun 24, 2019 · 3 comments
Closed

Revised semantics for errors #619

brianhuffman opened this issue Jun 24, 2019 · 3 comments
Assignees
Labels
semantics Issues related to the dynamic semantics of Cryptol.

Comments

@brianhuffman
Copy link
Contributor

@robdockins and I have been thinking about changing the denotational semantics for error values in cryptol for quite some time. Currently the reference interpreter says that error values (things like DivideByZero or OutOfBounds or ⊥) only exist at base types (e.g. Bit and Integer). But this design makes it very tricky to implement certain partial operations correctly, for example indexing operators like @. (See #422.)

We'd like to change the semantic domains to include error values at every type, not just at base types. This should make it easier to implement an efficient evaluator that also agrees with the reference interpreter. It should also make it easier to eventually implement a :safe command (#284) because it will make it simpler to specify whether an expression denotes an error.

@brianhuffman brianhuffman added the semantics Issues related to the dynamic semantics of Cryptol. label Jun 24, 2019
@yav
Copy link
Member

yav commented Jun 24, 2019

It would be nice to still support an implementation technique where arrays are "exploded" into individual elements (i.e., eta expanded). Not sure if allowing errors everywhere interferes with that or not, but it seems like a worthwhile use case to support.

@robdockins
Copy link
Contributor

We revised the reference semantics in #866 along these lines, and it now agrees much more closely with the actual behavior of the REPL interpreter. The main interpreter still does not agree in some cases with the reference semantics, but all the cases I know about are related to the special handling of bitvector values.

@robdockins robdockins self-assigned this Mar 29, 2021
@robdockins
Copy link
Contributor

I believe this is now complete, as of #1136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semantics Issues related to the dynamic semantics of Cryptol.
Projects
None yet
Development

No branches or pull requests

3 participants