Support importing Cryptol enums into SAWCore #2052
Labels
missing cryptol features
Issues about features in Cryptol that don't work in SAW
subsystem: cryptol-saw-core
Issues related to Cryptol -> saw-core translation with cryptol-saw-core
type: feature request
Issues requesting a new feature or capability
Milestone
The Need
Since #2020, SAW bundles a version of Cryptol that includes support for Cryptol's
enum
declarations. It it still not possible to import Cryptol files that defineenum
s into SAWCore, however. For example, given this Cryptol and SAW file:If you run
test.saw
, it will throw an error message:Alternatively, you might also see this error message if you load a program which uses (but does not define) an
enum
:This issue tracks lifting this restriction.
Design Choices, Elaborated
The major design choice here for the translation of enums into SAWCore is to pick one of
enum
declaration to a SAWCoredata
declaration with the same field types.enum
declaration to a value defined in terms ofEithers
, which provides an "anonymous sum" representation.Discussion on design choice
Choice 1
Choice 2
For now we are proceeding with design Choice 2, when possible, abstracting over aspects that would change under Choice 1.
Implementation and progress
fixed the Fixing nominals in cryptol lib bug (solving #2230) #2233 bug.
learning the Cryptol, SawCore, and translation ('cryptol-saw-core') code.
All (or most all) the changes will be in
cryptol-saw-core/src/Verifier/SAW/Cryptol.hs
:Add tests.
Further Steps & Improvements
load_sawcore_from_file
follows (onsaw
command-line). This processes SAWCoredata
declarations.The text was updated successfully, but these errors were encountered: