-
Notifications
You must be signed in to change notification settings - Fork 256
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
Implements an {:expect} attribute on an assert statement, which makes it compiled, if not ghost, as well as verified #3458
Closed
Closed
Changes from 1 commit
Commits
Show all changes
189 commits
Select commit
Hold shift + click to select a range
97ac9b6
Adding quicktest
87f0eee
Edit per comment from Remy
848ae6b
Merge branch 'master' of https://github.com/dafny-lang/dafny
4194195
Merge branch 'master' of https://github.com/dafny-lang/dafny
9b54f5f
Merge branch 'master' of https://github.com/dafny-lang/dafny
be99f87
Merge branch 'master' of https://github.com/dafny-lang/dafny
c706f5d
Merge branch 'master' of https://github.com/dafny-lang/dafny
63e22eb
Merge branch 'master' of https://github.com/dafny-lang/dafny
22d7433
Merge branch 'master' of https://github.com/dafny-lang/dafny
78c577d
Merge branch 'master' of https://github.com/dafny-lang/dafny
5795f9f
Merge branch 'master' of https://github.com/dafny-lang/dafny
044c107
Merge branch 'master' of https://github.com/dafny-lang/dafny
69e27cf
Merge branch 'master' into cok-quicktest
davidcok f42c745
Merge branch 'master' of https://github.com/dafny-lang/dafny
9e92bd8
Merge branch 'master' into cok-quicktest
davidcok 92825dc
Merge branch 'master' of https://github.com/dafny-lang/dafny
e201a77
Merge branch 'master' of https://github.com/dafny-lang/dafny
e02d6ce
Merge branch 'master' of https://github.com/dafny-lang/dafny
0465b15
Merge branch 'master' of https://github.com/dafny-lang/dafny
68f52ce
Merge branch 'master' of https://github.com/dafny-lang/dafny
fe933e2
Merge branch 'master' of https://github.com/dafny-lang/dafny
6f34117
Merge branch 'master' of https://github.com/dafny-lang/dafny
c396e83
Merge branch 'master' of https://github.com/dafny-lang/dafny
433c824
Merge branch 'master' of https://github.com/dafny-lang/dafny
82c8060
Merge branch 'master' of https://github.com/dafny-lang/dafny
7859237
Merge branch 'master' of https://github.com/dafny-lang/dafny
8bd7d03
Merge branch 'master' of https://github.com/dafny-lang/dafny
42be55b
Merge branch 'master' of https://github.com/dafny-lang/dafny
7ef5288
Merge branch 'master' of https://github.com/dafny-lang/dafny
98c5e41
Merge branch 'master' of https://github.com/dafny-lang/dafny
9f1e92c
Merge branch 'master' of https://github.com/dafny-lang/dafny
d78800a
Merge branch 'master' of https://github.com/dafny-lang/dafny
dc2f742
Merge branch 'master' of https://github.com/dafny-lang/dafny
8b4e194
Merge branch 'master' of https://github.com/dafny-lang/dafny
c292bae
Merge branch 'master' of https://github.com/dafny-lang/dafny
50702f8
Merge branch 'master' of https://github.com/dafny-lang/dafny
c49f8a3
Merge branch 'master' of https://github.com/dafny-lang/dafny
9c68747
Merge branch 'master' of https://github.com/dafny-lang/dafny
aee08f5
Merge branch 'master' of https://github.com/dafny-lang/dafny
6bba113
Merge branch 'master' of https://github.com/dafny-lang/dafny
032e12a
Merge branch 'master' of https://github.com/dafny-lang/dafny
e11fd63
Merge branch 'master' of https://github.com/dafny-lang/dafny
24921df
Merge branch 'master' of https://github.com/dafny-lang/dafny
2e3a81f
Merge branch 'master' of https://github.com/dafny-lang/dafny
91e05eb
Merge branch 'master' of https://github.com/dafny-lang/dafny
ba9f954
Merge branch 'master' of https://github.com/dafny-lang/dafny
47815c1
Checking included files
956e476
Merge branch 'master' of https://github.com/dafny-lang/dafny
5aa1aa9
Merge branch 'master' of https://github.com/dafny-lang/dafny
834cee3
Merge branch 'master' of https://github.com/dafny-lang/dafny
f6b3d49
Merge branch 'master' of https://github.com/dafny-lang/dafny
977b36a
Merge branch 'cok-quicktest' of https://github.com/davidcok/dafny
043986b
Merge branch 'master' of https://github.com/dafny-lang/dafny
710f269
Merge branch 'master' of https://github.com/dafny-lang/dafny
ea10461
Merge branch 'master' of https://github.com/dafny-lang/dafny
09591e8
Merge branch 'master' of https://github.com/dafny-lang/dafny
408f44e
Merge branch 'master' of https://github.com/dafny-lang/dafny
02ffee4
Merge branch 'master' of https://github.com/dafny-lang/dafny
c99fbe9
Merge branch 'master' of https://github.com/dafny-lang/dafny
f4d4a02
Merge branch 'master' of https://github.com/dafny-lang/dafny
448cb44
Merge branch 'master' of https://github.com/dafny-lang/dafny
a1e28fd
Merge branch 'master' of https://github.com/dafny-lang/dafny
77f4e1f
Merge branch 'master' of https://github.com/dafny-lang/dafny
c8dc66a
Link to snapshot for v3.9.0
30165e3
Merge branch 'master' of https://github.com/dafny-lang/dafny
ad14c5c
Link to snapshot for v3.9.0
f9d72de
Link to snapshot for v3.9.0
a60dd9a
Fixing Snapshot file
c04d360
Some typos and workding changes
48ccd27
Edits to use the language of greatest predicates and greatest lemmas
f3ed37b
Merge branch 'master' of https://github.com/dafny-lang/dafny
9a34972
Merge branch 'master' of https://github.com/dafny-lang/dafny
4389f19
Conflict resolution
473be16
Merge branch 'master' of https://github.com/dafny-lang/dafny
0559d39
Merge branch 'master' of https://github.com/dafny-lang/dafny
23ed17e
Merge branch 'master' of https://github.com/dafny-lang/dafny
b4a9a3b
Merge branch 'master' of https://github.com/dafny-lang/dafny
bd94cc5
Merge remote-tracking branch 'upstream/master'
ceb95b7
Merge remote-tracking branch 'upstream/master'
e7d5dea
Merge remote-tracking branch 'upstream/master'
b49eeda
Merge remote-tracking branch 'upstream/master'
ef86f34
Merge remote-tracking branch 'upstream/master'
12a7f03
Merge remote-tracking branch 'upstream/master'
bfab006
Merge branch 'master' of https://github.com/dafny-lang/dafny
d4deeb6
Merge branch 'master' of https://github.com/dafny-lang/dafny
f12cc28
Merge branch 'master' of https://github.com/dafny-lang/dafny
6820ca2
Merge branch 'master' of https://github.com/dafny-lang/dafny
9d3411f
Merge branch 'master' of https://github.com/dafny-lang/dafny
5bd3845
Merge branch 'master' of https://github.com/dafny-lang/dafny
b548d41
Merge branch 'master' of https://github.com/dafny-lang/dafny
ae1e30c
Merge branch 'master' of https://github.com/dafny-lang/dafny
b527539
Merge branch 'master' of https://github.com/dafny-lang/dafny
0713e90
Merge branch 'master' of https://github.com/dafny-lang/dafny
f1e788e
just touching
4510b5d
Merge branch 'master' of https://github.com/dafny-lang/dafny
a07d7a1
Merge branch 'master' of https://github.com/dafny-lang/dafny
48455cc
Spurious edit on master
125c70e
Merge branch 'master' of https://github.com/dafny-lang/dafny
1fd6798
Merge branch 'master' of https://github.com/dafny-lang/dafny
1c47231
Merge branch 'master' of https://github.com/dafny-lang/dafny
f757e02
Merge branch 'master' of https://github.com/dafny-lang/dafny
266e045
Merge branch 'master' of https://github.com/dafny-lang/dafny
56b04e5
Merge branch 'master' of https://github.com/dafny-lang/dafny
57c7af0
Merge branch 'master' of https://github.com/dafny-lang/dafny
85be9ee
Merge branch 'master' of https://github.com/dafny-lang/dafny
be76074
Merge branch 'master' of https://github.com/dafny-lang/dafny
c8fed8b
Merge branch 'master' of https://github.com/dafny-lang/dafny
9eee8f1
Merge branch 'master' of https://github.com/dafny-lang/dafny
29864c7
Merge branch 'master' of https://github.com/dafny-lang/dafny
94970bb
Merge branch 'master' of https://github.com/dafny-lang/dafny
d72c416
Merge branch 'master' of https://github.com/dafny-lang/dafny
9ef66f0
Merge branch 'master' of https://github.com/dafny-lang/dafny
d0a57a9
Merge branch 'master' of https://github.com/dafny-lang/dafny
917c5b9
Merge branch 'master' of https://github.com/dafny-lang/dafny
4b7b4ed
Merge branch 'master' of https://github.com/dafny-lang/dafny
8008caa
Merge branch 'master' of https://github.com/dafny-lang/dafny
26eca7f
Merge branch 'master' of https://github.com/dafny-lang/dafny
06930ef
Merge branch 'master' of https://github.com/dafny-lang/dafny
271c77b
Merge branch 'master' of https://github.com/dafny-lang/dafny
f3ce788
Merge branch 'master' of https://github.com/dafny-lang/dafny
5485716
Merge branch 'master' of https://github.com/dafny-lang/dafny
4096c4c
Merge branch 'master' of https://github.com/dafny-lang/dafny
a3d9f25
Merge branch 'master' of https://github.com/dafny-lang/dafny
e76a535
Merge branch 'master' of https://github.com/dafny-lang/dafny
04c0277
Merge branch 'master' of https://github.com/dafny-lang/dafny
22a34bd
Merge branch 'master' of https://github.com/dafny-lang/dafny
a90bfb9
Merge branch 'master' of https://github.com/dafny-lang/dafny
07ec7ec
Merge branch 'master' of https://github.com/dafny-lang/dafny
46b373e
Merge branch 'master' of https://github.com/dafny-lang/dafny
6e86c02
Merge branch 'master' of https://github.com/dafny-lang/dafny
2a105e3
Merge branch 'master' of https://github.com/dafny-lang/dafny
dd74785
Merge branch 'master' of https://github.com/dafny-lang/dafny
d44975e
Merge branch 'master' of https://github.com/dafny-lang/dafny
5b5f6ea
Merge branch 'master' of https://github.com/dafny-lang/dafny
d154427
Merge branch 'master' of https://github.com/dafny-lang/dafny
a1fd105
Merge branch 'master' of https://github.com/dafny-lang/dafny
29af14d
Merge branch 'master' of https://github.com/dafny-lang/dafny
a322ff5
Merge branch 'master' of https://github.com/dafny-lang/dafny
7091bdd
Merge branch 'master' of https://github.com/dafny-lang/dafny
f62aeab
Merge branch 'master' of https://github.com/dafny-lang/dafny
6f30d24
RUnning nightly-tests only on main repo
ab590c1
Merge branch 'master' of https://github.com/dafny-lang/dafny
e8784ea
Merge branch 'master' of https://github.com/dafny-lang/dafny
4ea5f26
Merge branch 'master' of https://github.com/dafny-lang/dafny
9cb7aae
Merge branch 'master' of https://github.com/dafny-lang/dafny
6a3706d
fix: Specify Python version in the integration tests (#3340)
fabiomadge 9b05c3f
chore: Remove final `set-output` (#3342)
fabiomadge 83f2282
Documentation snapshot for V3.10.0 (#3208)
davidcok 2082ca0
Initial C# port of auditor (#3175)
atomb 5bf62da
Improve Z3 detection (#3233)
atomb 8ce274f
Add a missing expression clone (#3346)
atomb ea164ef
Use %diff instead of diff for test (#3349)
atomb 6fd8891
Add missing release notes (#3335)
keyboardDrummer aa4f204
Fix: Other CLI files that are not found do not trigger exceptions (#3…
MikaelMayer e878202
Cok retry induction tests (#3307)
davidcok a472528
Documenting compilation errors (#3341)
davidcok 9811ada
Revert "Cok retry induction tests (#3307)" (#3364)
keyboardDrummer 60b6c66
Jar files, both library and executable, are now created as part of bu…
davidcok bb84559
Do not fail the deep test check on in progress runs (#3363)
keyboardDrummer a19f44c
Enable passing a percentage as a value for --cores (#3357)
keyboardDrummer a2fbc0e
Fix: Proper warning that 'new' cannot be used in expressions, instead…
MikaelMayer 56a6565
Merge conflicts
df7c8d0
Merge conflict
5448b35
Link to snapshot for v3.9.0
f11e7d0
Merge remote-tracking branch 'upstream/master'
5a0a032
FIxing diffs to upstream
0464a88
Merge branch 'master' of https://github.com/dafny-lang/dafny
48e1a83
Merge branch 'master' of https://github.com/dafny-lang/dafny
7aea103
Merge branch 'master' of https://github.com/dafny-lang/dafny
1b3fb64
Merge branch 'master' of https://github.com/davidcok/dafny
42a99ef
Merge branch 'master' of https://github.com/dafny-lang/dafny
01de15d
Merge branch 'master' of https://github.com/dafny-lang/dafny
101a0d1
Merge branch 'master' of https://github.com/davidcok/dafny
8f1fa1d
Merge branch 'master' of https://github.com/dafny-lang/dafny
66b628f
Merge branch 'master' of https://github.com/dafny-lang/dafny
cec9d52
Merge branch 'master' of https://github.com/davidcok/dafny
62b0c59
Merge branch 'master' of https://github.com/dafny-lang/dafny
8d8ee67
Merge branch 'master' of https://github.com/dafny-lang/dafny
47a5f5c
Merge branch 'master' of https://github.com/dafny-lang/dafny
b6201ab
Merge branch 'master' of https://github.com/dafny-lang/dafny
9b9202e
Merge branch 'master' of https://github.com/dafny-lang/dafny
aa8672c
Merge branch 'master' of https://github.com/dafny-lang/dafny
290a574
Implementation and new tests
157bc22
Implementing an optional argument for the :expect attribute
0fd8646
Adding a news release
774fc6a
Fixing a crash in Java
70e7a65
Update docs/DafnyRef/Statements.md
davidcok 52ec29f
Fixing a test
9660410
Merge branch 'cok-3410-assert-expect' of https://github.com/davidcok/…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Implementing an optional argument for the :expect attribute
- Loading branch information
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
git-issue-3410f.dfy(6,19): Error: ghost variables such as i are allowed only in specification contexts. i was inferred to be ghost based on its declaration or initialization. | ||
1 resolution/type errors detected in git-issue-3410f.dfy | ||
git-issue-3410f.dfy(12,9): Error: assert with {:expect} statement is not allowed in this context (because this is a ghost method or because the statement is guarded by a specification-only expression) | ||
git-issue-3410f.dfy(16,2): Error: assert with {:expect} statement is not allowed in this context (because this is a ghost method or because the statement is guarded by a specification-only expression) | ||
3 resolution/type errors detected in git-issue-3410f.dfy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// RUN: %exits-with 2 %baredafny resolve --use-basename-for-filename "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method m() { | ||
assert {:expect "",""} true; | ||
assert {:expect 10} true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
git-issue-3410g.dfy(5,11): Error: :expect attribute may have at most one argument | ||
1 resolution/type errors detected in git-issue-3410g.dfy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: %exits-with 1 %baredafny run --no-verify --use-basename-for-filename "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method Main() { | ||
var i: int := 42; | ||
assert {:expect "expecting 42" } i == 41; | ||
print "Done\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
Dafny program verifier did not attempt verification | ||
[Program halted] git-issue-3410h.dfy(6,2): expecting 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: %exits-with 1 %baredafny run --no-verify --use-basename-for-filename "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method Main() { | ||
var i: int := 42; | ||
assert {:expect i } i == 41; | ||
print "Done\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
Dafny program verifier did not attempt verification | ||
[Program halted] git-issue-3410k.dfy(6,2): 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the future, it seems like we could also support adding this to other specification contexts like
requires
,ensures
,invariant
, etc. (although see my independent question about whether this is the name we want)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite my slack comment, I see your point. I'm open to any naming, but making it anything other than an attribute would be more work and harder to generalize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On thinking about it more I like using a
{:checked}
attribute. I think that terminology fits in well with the documentation for the related--test-assumptions
option (in fact I even wonder if the option should becheck-assumptions
to avoid implying it's strongly coupled todafny test
.We could think of
expect P;
as a short form forassume {:checked} P;
(that's actually allowed when compiling).Interested in @atomb's option here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about {:check} to match assert, assume, expect as active present tense verbs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thought: perhaps it would be better if
expect
itself behaved this way. That is, if it had to be both verified and checked at runtime. We could change this for Dafny 4.0.I submit that even when writing a
{:test}
in Dafny, you almost always believe the expression you'reexpect
-ing to be true. Tests often look a lot like examples, and examples in Dafny should verify as well, i.e. if you can't satisfy the precondition of the function you're trying to call, it's often an indication the specified interface of the code you're testing is wrong or too weak/strong.We would also allow
expect {:axiom} P;
just likeassert {:axiom} P;
, for easy backwards compatibility and those times it's too much work to proveP
.:- expect {:axiom} ...
as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seebees I'm curious whether what I'm saying above jives with your more substantial experience than mine in using
expect
in Dafny tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the set of contracts currently supported,
--check-assumptions
would be a nice improvement on naming. However, I worry it might be confusing if we extend it to evaluate other contracts at runtime, including those that, at least in principle, might be verified. What do others think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note there is deeper discussion happening on the issue now, so we should move further replies there: #3410 (comment)