Expose memory binding(s) in program logic statements #816
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up PR to #789 that now allows the user to decide the name of the memory bound by a program logic statement or probability expression. This makes nested program logic statements clearer.
The syntax is
{&my_memory}after the procedures (and arguments for a Pr) (for the relevant side if two-sided).Examples:
hoare[P.p {&m}: true ==> true]Pr[P.p(a) {&end_mem} @ &start_mem: true] = 0%requiv[P.p {&left} ~ P.p {&right}: true ==> true]The change is backwards compatible since it is optional to provide the memory. If not provided a default name will be used instead (
&hrfor one-sided cases and&1/&2for left/right in two-sided cases). The pretty printer omits the memory binding if the default names are used.Some tactics (conseq?) will probably also want an optional memory parameter, but I'd rather deal with that as needed.