-
Notifications
You must be signed in to change notification settings - Fork 274
Adds documentation about function contracts #6185
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
Conversation
e0a6080
to
18b1ae6
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6185 +/- ##
===========================================
+ Coverage 67.40% 75.62% +8.22%
===========================================
Files 1157 1454 +297
Lines 95236 160922 +65686
===========================================
+ Hits 64197 121705 +57508
- Misses 31039 39217 +8178
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
18b1ae6
to
c8ba8bd
Compare
@@ -0,0 +1,502 @@ | |||
# Function Contracts |
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.
Overall comment: this file contains too much "how" and not enough "what". We do not need to explain the implementations of ASSIGNS and is_fresh, but we should explain what they do, perhaps using examples. Also, my thought is that there should be a page for each construct (similar to a reference manual) with examples that demonstrate how the construct works. So, I'd like to see some refactoring, and a few more examples of how the constructs work.
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.
I've re-write and re-sctructured the documentation to highlight "what" instead of "how" and added more examples.
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.
Couple of initial comments
c8ba8bd
to
11d0b0c
Compare
4b66d29
to
1fc3c88
Compare
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.
Thank you! Documentation patches are very welcome!
__CPROVER_old(*identifier*) | ||
``` | ||
|
||
Refers to the value of a given object in the pre-state of a function within the |
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.
Can it also be used for loops?
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.
Not yet, but we have an intern working on this, so hopefully soon 🙂
@@ -0,0 +1,43 @@ | |||
# Quantifiers |
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.
Would it be possible to add something about the impact this has on the choice of back-end and that depending on how they are used, it may be necessary to use an SMT solver.
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.
+1. Thanks for pointing this out!
We had planned to do this (#6149). Let's make the changes as part of this PR.
1fc3c88
to
52f760e
Compare
52f760e
to
7734945
Compare
9f74394
to
811995a
Compare
a2047bd
to
14555a4
Compare
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.
Thats a massive, and fantastic, addition to the docs - many thanks!
Signed-off-by: Felipe R. Monteiro <[email protected]>
14555a4
to
4f80ed1
Compare
Related to #6149.
Signed-off-by: Felipe R. Monteiro [email protected]
Adds a section about "Function Contracts" to the CPROVER manual.