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
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. (A further step would be to allow using Cryptol enums in MIR specifications, as proposed in #1976.)
In order to import an
enum
into SAWCore, we need to have a corresponding SAWCore representation. Two possible representations that we could pick are: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.The text was updated successfully, but these errors were encountered: