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

Allow forall statements in expressions #146

Open
wilcoxjay opened this issue Oct 10, 2017 · 2 comments
Open

Allow forall statements in expressions #146

wilcoxjay opened this issue Oct 10, 2017 · 2 comments
Labels
difficulty: easy Issues that should take a few days at most to fix kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: parser First phase of Dafny's pipeline part: verifier Translation from Dafny to Boogie (translator) status: designed Issues that have a complete story on how to implement this feature and why we want it

Comments

@wilcoxjay
Copy link
Collaborator

Occasionally, when a function has a universally quantified precondition, it would be convenient to be able to use a forall statement to prove the precondition inline in an expression context.

@wilcoxjay wilcoxjay added the kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny label Oct 10, 2017
@RustanLeino
Copy link
Collaborator

Nice idea. I think this would be simple to implement. It would involve another use of the StmtExpr production, which already handles (calls and the more similar) assert/assume/calc statements.

@wilcoxjay
Copy link
Collaborator Author

It's good to hear that this shouldn't introduce any new difficulties in translation.

One thing I'm worried about is parsing it. I think it will be impossible to distinguish forall statement-expressions from universal quantifiers until the opening curly brace or ensures token. I don't think we can even distinguish these with a lookahead, because we need to skip over arbitrary expressions. Instead, we may need to introduce new nonterminals for "a prefix of either a universal quantifier or a forall statement-expression".

@acioc acioc added this to the Post 3.0 milestone Jul 8, 2020
@robin-aws robin-aws removed this from the Post 3.1 milestone Sep 22, 2021
@cpitclaudel cpitclaudel added difficulty: easy Issues that should take a few days at most to fix part: verifier Translation from Dafny to Boogie (translator) part: parser First phase of Dafny's pipeline status: designed Issues that have a complete story on how to implement this feature and why we want it labels May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy Issues that should take a few days at most to fix kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny part: parser First phase of Dafny's pipeline part: verifier Translation from Dafny to Boogie (translator) status: designed Issues that have a complete story on how to implement this feature and why we want it
Projects
None yet
Development

No branches or pull requests

5 participants