-
Notifications
You must be signed in to change notification settings - Fork 274
Docs for incremental SMT backed #7005
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
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'm not convinced the "CPROVER Manual" (rendered at https://www.cprover.org/cprover-manual/) is the right place for this: the level of abstraction of other information presented in there is quite a bit higher, and I am opposed to putting work-in-progress stuff in there. I think the CBMC man page is a good candidate, or else just a README.md file in the source directory.
Codecov Report
@@ Coverage Diff @@
## develop #7005 +/- ##
========================================
Coverage 77.85% 77.85%
========================================
Files 1569 1569
Lines 180656 180656
========================================
Hits 140648 140648
Misses 40008 40008 Continue to review full report at Codecov.
|
Hi @tautschnig I don't believe the This is supposed to be the documentation that we have for final users of the new SMT backend. The decision for putting it there was made on the rationale that a user would look for supporting information on the tool's manual, which is represented by that directory. Indeed, that directory also contains other files that have a mix of user documentation/architectural stuff, such as However, in that case, guidance should be given on where pieces of documentation like the one that we are adding now should go, given that the other folders under |
doc/cprover-manual/smt2-incr.md
Outdated
|
||
The SMT incremental backend supports the following `C` primitives: | ||
|
||
- Bit vector arithmetics |
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.
We should mention that we support C integers via bit-vector arithmetic (bit-vectors are not a C level construct AFAIK)
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.
changed
doc/cprover-manual/smt2-incr.md
Outdated
- Floating point values and arithmetics | ||
- Structs | ||
|
||
Requirement to use the incremental SMT backend is to have a solver which accepts |
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.
We can remove the word requirement
, or phrase it like:
Usage of the incremental SMT backend requires a SMT solver compatible with SMTlib v2.6 formatted input
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.
changed
doc/cprover-manual/smt2-incr.md
Outdated
solver of choice using the interactive mode and accepting input from the | ||
standard input. | ||
|
||
Examples are: |
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 would phrase this as
Examples of invocations with various solvers
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.
changed
doc/cprover-manual/smt2-incr.md
Outdated
2. `--incremental-smt2-solver 'cvc5 --lang=smtlib2.6 --incremental'` to use the | ||
CVC5 solver. | ||
|
||
Note that the solver has to be user-supplied and CBMC does not come packaged |
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 believe this information is inaccurate - we do build an SMT2 solver with CBMC (you can find regression tests for that under regression/smt2_solver
and the binary under <build>/bin/smt2_solver
) but we are not targeting that as it's very primitive and its current level of SMTlib support is unknown.
I suggest we rephrase that as
The new incremental SMT backend has been designed to interoperate with external solvers
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.
changed
doc/cprover-manual/smt2-incr.md
Outdated
with any SMT solver, so the solver name must be in the `PATH` or an executable | ||
with full path must be provided. | ||
|
||
Also note that because of the partial array support, the `--slice-formula` |
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 would phrase that as
Due to lack of support for conversion of
array_of
expressions that are generated by CBMC in the new SMT backend, we currently have to supply an extra argument--slice-formula
so that instances ofarrayof_exprt
are removed from the formula to be converted.
As we move forward with our array-support implementation, we anticipate that the need for this extra flag will be diminished.
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.
changed
doc/cprover-manual/smt2-incr.md
Outdated
|
||
CBMC comes with a solver-agnostic incremental SMT backend. | ||
|
||
The SMT incremental backend supports the following `C` primitives: |
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.
We should probably refer to them as "major features" or just "features", not primitives, IMO.
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.
changed
Warning: I may end up hijacking this PR to discuss plans for documentation.
I'm not sure why it is "orthogonal," but more on that below.
Well, the The My opinion (and I do by no means claim to be authoritative on this, just my own thoughts):
I don't see the above examples as "architectural stuff" (or at least not in the way that I'd understand that phrase). If there is more cleanup in
I don't want us to start the discussion from where in the source tree a piece of documentation will go. I expect that discussion to start from the potential consumer of such documentation. When that is determined, we can find a suitable place in the source tree. If the audience (as I think is the case here) is a CBMC user (as opposed to a contributor/developer), then it needs to fit with the level of abstraction that is covered by a particular (collection of) document(s). If there is no so suitable collection, then perhaps we need to create a new one. But I want to make sure we don't just end up dumping text in the repository: we have a lot of documentation across the code base, but largely lack consistency. And we should aim to improve on this, not make it even worse just so that we can tick some "documentation" checkbox. |
b9fff92
to
3b022df
Compare
Hello @tautschnig, thank you for taking the time to share your thoughts. I'm in agreement with a lot of what's written there, and I share the feeling that the CBMC documentation situation is unsatisfactory, and merits a lengthier conversation and plan to move it to a better place. We also want to get this PR moving though (to get some user documentation about the new SMT backend so that you guys can start playing with it), so I propose the following two actions for now:
Let me know your thoughts, and thanks again for starting this conversation. |
Done: #7006
In my opinion, yes, it would be a great fit. Feel free to use the existing |
3b022df
to
bb63a73
Compare
doc/cprover-manual/index.md
Outdated
## 10. New SMT backend | ||
|
||
[New SMT2 incremental backend](smt2-incr/) | ||
|
||
## 11. [The CPROVER API Reference](api/) |
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.
Left-over?
doc/man/cbmc.1
Outdated
Use the incremental SMT backend where <cmd> is the command to invoke the SMT | ||
solver of choice using incremental mode and accepting input from the standard input. | ||
Note that the solver name must be in the "PATH" or be an executable with full | ||
path. Also the flag --slice-formula should be added to remove some not-yet supoorted features. |
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.
s/supoorted/supported/
[CPROVER Manual TOC](../) | ||
|
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 safely be removed.
Usage of the incremental SMT backend requires a SMT solver compatible with | ||
incremental SMTlib v2.6 formatted input from the standard input and that | ||
supports the `QF_AUFBV` (Quantifier Free Array Uninterpreted Functions and Bit | ||
Vectors). |
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.
This would also be valuable information to copy into the man
page.
1. `--incremental-smt2-solver 'z3 -smt2 -in'` to use the Z3 solver. | ||
2. `--incremental-smt2-solver 'cvc5 --lang=smtlib2.6 --incremental'` to use the | ||
CVC5 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.
Would also be nice to see in the man
page.
bb63a73
to
2610713
Compare
Add documentation for the new incremental SMT backend.