Guide: Update language about logic functions and document #[open] #1649
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.
Following up on conversation in #1643. The first section of the "Logic functions" page was out of date, also mentioning
#[predicate]
which has been removed, plus it was a bit unclear about what is allowed where within a logic function. I rewrote that part with what I believe are the correct rules but please check. Also, I saw that #1622 would maybe change the situation re: loops? If so, that will need to be changed soon.I added another paragraph documenting
#[open]
and saying a little about how it relates to how the logic function is used, e.g. as a lemma or as a predicate. I do think it might be useful to say more about lemmas somewhere and note how/when to use them and that actually any function can be considered a lemma if its pre/postconditions are useful for the prover but its body doesn't do anything useful for the program. I just realized this myself, maybe it is obvious if you have more experience working with automated provers though. For what it's worth, I found the Dafny tutorial on lemmas very helpful (actually I would have been totally lost trying to learn Creusot if I hadn't gone through the Dafny guides first, maybe it's worth recommending?)