GaloisInc / saw-script

The SAW scripting language.
BSD 3-Clause "New" or "Revised" License
442 stars 63 forks source link

Feature request: more ways to conditionalize a ProofScript #1195

Open msaaltink opened 3 years ago

msaaltink commented 3 years ago

The experimental functions goal_num_when and goal_num_ite are really useful for pulling out goals that need compicated scripts. Most of the time, for me, that's just the final goal(s) in a proof, dealing with the postcondition(s) or any points_to assertions. For that purpose, the interface is a bit awkward; I know this will be the last in the numbered list of goals, but do not know before running the proof what its number will be.

A few different things might make this more convenient and make proof scripts more robust:

I'm sure you can think of more ideas. Anything like this might make the scripts more readable, more robust, and easier to write.

kquick commented 3 years ago

Discussion:

robdockins commented 2 years ago

I have two ideas in mind here that I think will meet most of the needs I have presently.

First: more careful tracking of the provenance of goals. In particular, I'd like to be able to tell the difference between goals generated by the simulator itself (memory safety and such) and goals that arise from the preconditions of overrides; for those, especially, I want to know what is the call site of the override, and what is the actual, original precondition statement (points_to, assert, etc).

Second, I'd like the ability to add arbitrary string "tags" to goals that I can use later to identify particular ones of interest; then I can use a goal_when_has_tag, or similar, to filter the goals.

Both of these basically require some mechanism to round-trip some additional metadata about goals through the symbolic simulator. I think this can be done by using What4 term annotations and a side lookup map on the SAW side.

robdockins commented 2 years ago

PR #1679 partially addresses this issue by implementing the ideas mentioned in the comment above.