Support quantification over the Cryptol # kind #2209
Labels
missing cryptol features
Issues about features in Cryptol that don't work in SAW
needs design
Technical design work is needed for issue to progress
needs test
Issues for which we should add a regression test
subsystem: cryptol-saw-core
Issues related to Cryptol -> saw-core translation with cryptol-saw-core
subsystem: saw-core
Issues related to the saw-core representation or the saw-core subsystem
topics: error-messages
Issues involving the messages SAW produces on error
type: feature request
Issues requesting a new feature or capability
usability
An issue that impedes efficient understanding and use
Milestone
Example
Suppose we have a Cryptol module
Example
inExample.cry
below and the subsequent SAW script.The example above will cause SAW to produce an error:
As an aside, this error message probably also deserves a SAW issue for usability.
To confirm that this error is due to
Example::p
being parametric, we can instantiate the type parameter explicitly:In this case, SAW successfully proves the theorem.
Discussion
An example like this is surprising to me because the kind of the type variable in the Cryptol expression is
#
, which is the numeric kind. I'd sort of expect, at a high level, that quantifying over the numeric should be possible by (say) translating to SMT by introducing a symbolic variable for the type variable, and introducing SMT constraints corresponding to the type constraints (e.g,2 <= N
above). As I write this, it occurs to me that if a Cryptol sequence is encoded as an SMT bitvector then this would mean the SMT solver would need to support variables whose kind is "bitvector of lengthx
" wherex
is a symbolic Nat. Maybe that's not a thing?I don't think I have any recommendations for this. It is chiefly a usability issue since the user can always manually instantiate the property with all satisfying numerics. However, it does show up quite a bit in conjunction with #2208, because the mitigation for that is to make every declaration in the module parametric.
The text was updated successfully, but these errors were encountered: