Skip to content

Commit fde9ac5

Browse files
Explain unsound and experimental options in documentation.
Some use of CBMC or JBMC can yield verification results that must not be taken at face value. Co-authored-by: Michael Tautschnig <[email protected]>
1 parent c40ea7e commit fde9ac5

File tree

2 files changed

+71
-3
lines changed

2 files changed

+71
-3
lines changed

doc/cprover-manual/index.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
* [Integration into Build Systems with goto-cc](goto-cc/)
3131
* [Integration with Visual Studio builds](visual-studio/)
3232

33-
9. Solvers
33+
9. [The CPROVER API Reference](api/)
3434

35-
* [Incremental SMT solver](smt2-incr/)
35+
10. Background Information on selected Command-line Options
3636

37-
10. [The CPROVER API Reference](api/)
37+
* [Incremental SMT solver](smt2-incr/)
38+
* [Unsound options](unsound_options/)

doc/cprover-manual/unsound_options.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[CPROVER Manual TOC](../)
2+
3+
## Unsound CLI options for various tools
4+
5+
### Context
6+
7+
In [#6480](https://github.com/diffblue/cbmc/issues/6480), there has been some extensive
8+
conversation about what it means for certain options to produce *unsound* behavior.
9+
10+
We concluded that *unsound* in this context is a proxy for the following two behaviors
11+
that we want to avoid:
12+
13+
* **A spurious counter example to an assertion**, which means that the tool may report
14+
a coverage property (or a line of code) as reachable when in fact it is not, and
15+
* **Wrong proof to an assertion**, which means that it might indicate an assertion passing
16+
when it's not.
17+
18+
We expect that, by default, CBMC and JBMC display none of the behavior we
19+
described above (and if they do, it's an extremely serious bug that we aim to
20+
fix on an ASAP basis), but be aware that certain tools, like `goto-instrument`,
21+
may contain components that are experimental in nature and thus do
22+
transformations that eventually lead to behavior such as the ones described
23+
above. Furthermore, some options lead to unsound analysis results *by design*,
24+
and some transformations performed by `goto-instrument` will yield verification
25+
results that are (by design) unsound when taking verification of the
26+
non-transformed program as reference.
27+
28+
### Examples of Options that may yield Unsound Results
29+
30+
The following options will produce a warning when used with CBMC or JBMC:
31+
32+
* Use of `--unwind` or `--unwindset` without `--unwinding-assertions`, or the
33+
use of `--partial-loops`.
34+
* Depth or complexity-limited analysis (`--depth`, `--symex-complexity-limit`).
35+
36+
See [Understanding Loop Unwinding](../cbmc/unwinding/) for an elaboration of
37+
these options.
38+
39+
### Experimental Options
40+
41+
Be advised that the following command line options to `cbmc` and `goto-instrument`
42+
have been reported to be unsound:
43+
44+
* `--full-slice` has been reported to be unsound in issue [cbmc#260](https://github.com/diffblue/cbmc/issues/260)
45+
In particular, `--full-slice` appears to lead to spurious counter examples,
46+
because values that get assigned by a function whose body gets sliced out are
47+
no longer present in the trace, but still result in flipped verification results.
48+
49+
`cbmc` and `goto-instrument` have also been modified to warn that options used
50+
are unsound as part of their output. An example of how that output looks is shown
51+
below:
52+
53+
```sh
54+
$ cbmc --full-slice ~/Devel/cbmc_bugs/6394/before-slice.out
55+
CBMC version 5.45.0 (cbmc-5.43.0-77-g99c5a92de1-dirty) 64-bit arm64 macos
56+
Reading GOTO program from file
57+
Reading: ~/Devel/cbmc_bugs/6394/before-slice.out
58+
Generating GOTO Program
59+
Adding CPROVER library (x86_64)
60+
Removal of function pointers and virtual functions
61+
Generic Property Instrumentation
62+
**** WARNING: Experimental option --full-slice, analysis results may be unsound. See https://github.com/diffblue/cbmc/issues/260
63+
Performing a full slice
64+
Running with 8 object bits, 56 offset bits (default)
65+
Starting Bounded Model Checking
66+
[...]
67+
```

0 commit comments

Comments
 (0)