Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: more ways to conditionalize a ProofScript #1195

Open
msaaltink opened this issue Apr 19, 2021 · 3 comments
Open

Feature request: more ways to conditionalize a ProofScript #1195

msaaltink opened this issue Apr 19, 2021 · 3 comments
Labels
needs design Technical design work is needed for issue to progress type: feature request Issues requesting a new feature or capability
Milestone

Comments

@msaaltink
Copy link
Contributor

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:

  • allow numbering from the end, rather than the front, so that the last goal is number -1, or with a separate goal_reverse_num_ite command that numbers the goals in reverse.
  • attach some extra information to a goal, e.g. "establish the precondition of routine X called from line Y", or "show that the postcondition on line L is satisfied". These would be pretty helpful in cases of proof failure, and then there could be a goal_type_ite command to match the different types of generated goals (precondition of called routine, postcondition, points_to condition, ...)
  • allow the user to attach labels to parts of a specification, then conditionalize a proof command for a particular label. e.g., llvm_named_precond "Input_is_nonnegative" (llvm_term {{ x >= 0 }}.
  • have something like goal_when that looks at the goal itself. There are usually function names appearing in my postconditions that do not appear in other goals. This might be a bit fragile, though.

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

@robdockins robdockins added type: feature request Issues requesting a new feature or capability needs design Technical design work is needed for issue to progress labels Apr 23, 2021
@kquick
Copy link
Member

kquick commented Apr 23, 2021

Discussion:

  • Might want to be more explicit about goal naming.
  • goal_when number name term might be useful.
  • goal_num_ite nesting is awkward and complicated; maybe have a statement with a list of guards and a default.
  • Currently runs the separate proof scripts from the beginning for each goal. Could have a single script with a number of sub-goals; some subtle things to think about with this and possibly have both modes for backward compatibility.

@robdockins
Copy link
Contributor

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 robdockins self-assigned this May 26, 2022
@robdockins
Copy link
Contributor

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

@robdockins robdockins removed their assignment Aug 26, 2022
@sauclovian-g sauclovian-g added this to the Someday milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs design Technical design work is needed for issue to progress type: feature request Issues requesting a new feature or capability
Projects
None yet
Development

No branches or pull requests

4 participants