More evaluation for crucible_term
and friends
#855
Labels
needs design
Technical design work is needed for issue to progress
subsystem: saw-core
Issues related to the saw-core representation or the saw-core subsystem
tech debt
Issues that document or involve technical debt
type: enhancement
Issues describing an improvement to an existing feature or capability
Milestone
When processing SAWCore terms that will be injected into the symbolic simulator, the current default behavior is to generate a fresh What4 symbolic variable to represent that term and record this binding in a lookup table (except in very limited special cases where we can easily recognize literal values). Then, when the simulator is finished, the resulting What4 terms are interpreted back into SAWCore; the freshly-created variables are replaced with their original SAWCore meanings.
This process is sound, but prevents the symbolic simulator from accessing the meanings of terms in most cases. This can be very problematic, as it may prevent symbolic termination, interferes with path-sat checking, and may cause necessary "potential" override matches and generally results in less-precise-than-possible results.
On the other hand, we cannot just evaluate every single SAWCore term destined for the simulator. Some constructs cannot be faithfully represented in What4; and in many cases full evaluation is undesirable anyway, as it would lead to a large amount of wasted work translating terms back and forth from SAWCore. This is especially true for compositional verification, where subcomponents of the computation are explicitly intended to be treated as black boxes for later stages of verification.
Instead, we will likely need a more flexible system for determining which terms should be "transparent" to this translation and which should be "opaque". As a first approximation, we will treat functions defined in the SAWCore and Cryptol preludes as being transparent, and other terms as being opaque. We will probably want a UI to allow users to override these defaults at some point, but I believe this is a good starting point.
This ticket is intended to track design discussions and ongoing work regarding this general issue.
The text was updated successfully, but these errors were encountered: