Skip to content

Commit 42f9f36

Browse files
Improve docs content layout and front page
1 parent 7e00a30 commit 42f9f36

File tree

10 files changed

+418
-710
lines changed

10 files changed

+418
-710
lines changed

doc/architectural/cbmc-guide.md

-601
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
\ingroup module_hidden
2+
\page cprover-architecture-overview CProver Architecture Overview
3+
4+
\author Martin Brain, Peter Schrammel
5+
6+
# Overview of CPROVER Directories
7+
8+
## `src/`
9+
10+
The source code is divided into a number of sub-directories, each
11+
containing the code for a different part of the system.
12+
13+
- GOTO-Programs
14+
15+
* \ref goto-programs
16+
* \ref linking
17+
18+
- Symbolic Execution
19+
* \ref goto-symex
20+
21+
- Static Analyses
22+
23+
* \ref analyses
24+
* \ref pointer-analysis
25+
26+
- Solvers
27+
* \ref solvers
28+
29+
- Language Front Ends
30+
31+
* Language API: \ref langapi
32+
* C: \ref ansi-c
33+
* C++: \ref cpp
34+
* Java: \ref java_bytecode
35+
* JavaScript: \ref jsil
36+
37+
- Tools
38+
39+
* \ref cbmc
40+
* \ref clobber
41+
* \ref goto-analyzer
42+
* \ref goto-instrument
43+
* \ref goto-diff
44+
* \ref memory-models
45+
* \ref goto-cc
46+
* \ref jbmc
47+
48+
- Utilities
49+
50+
* \ref big-int
51+
* \ref json
52+
* \ref xmllang
53+
* \ref util
54+
* \ref miniz
55+
* \ref nonstd
56+
57+
In the top level of `src` there are only a few files:
58+
59+
* `config.inc`: The user-editable configuration parameters for the
60+
build process. The main use of this file is setting the paths for the
61+
various external SAT solvers that are used. As such, anyone building
62+
from source will likely need to edit this.
63+
64+
* `Makefile`: The main systems Make file. Parallel builds are
65+
supported and encouraged; please don’t break them!
66+
67+
* `common`: System specific magic required to get the system to build.
68+
This should only need to be edited if porting CBMC to a new platform /
69+
build environment.
70+
71+
* `doxygen.cfg`: The config file for doxygen.cfg
72+
73+
## `doc/`
74+
75+
Contains the CBMC man page. Doxygen HTML pages are generated
76+
into the `doc/html` directory when running `doxygen` from `src`.
77+
78+
## `regression/`
79+
80+
The `regression/` directory contains the test suites.
81+
They are grouped into directories for each of the tools/modules.
82+
Each of these contains a directory per test case, containing a C or C++
83+
file that triggers the bug and a `.desc` file that describes
84+
the tests, expected output and so on. There is a Perl script,
85+
`test.pl` that is used to invoke the tests as:
86+
87+
../test.pl -c PATH_TO_CBMC
88+
89+
The `–help` option gives instructions for use and the
90+
format of the description files.
91+
92+
93+
# General Information
94+
95+
First off, read the \ref cbmc-user-manual "CBMC User Manual". It describes
96+
how to get, build and use CBMC. This document covers the
97+
internals of the system and how to get started on development.
98+
99+
## Documentation
100+
101+
Apart from the (user-orientated) CBMC user manual and this document, most
102+
of the rest of the documentation is inline in the code as `doxygen` and
103+
some comments. A man page for CBMC, goto-cc and goto-instrument is
104+
contained in the `doc/` directory and gives some options for these
105+
tools. All of these could be improved and patches are very welcome. In
106+
some cases the algorithms used are described in the relevant papers.
107+
108+
## Architecture
109+
110+
This section provides a graphical overview of how CBMC fits together.
111+
CBMC takes C code or a goto-binary as input and tries to emit traces
112+
of executions that lead to crashes or undefined behaviour. The diagram
113+
below shows the intermediate steps in this process.
114+
115+
\dot
116+
digraph G {
117+
118+
rankdir="TB";
119+
node [shape=box, fontcolor=blue];
120+
121+
subgraph top {
122+
rank=same;
123+
1 -> 2 -> 3 -> 4;
124+
}
125+
126+
subgraph bottom {
127+
rank=same;
128+
5 -> 6 -> 7 -> 8 -> 9;
129+
}
130+
131+
/* shift bottom subgraph over */
132+
9 -> 1 [color=white];
133+
134+
4 -> 5;
135+
136+
1 [label="command line\nparsing" URL="\ref cbmc_parse_optionst"];
137+
2 [label="preprocessing,\nparsing" URL="\ref preprocessing"];
138+
3 [label="language\ntype-checking" URL="\ref type-checking"];
139+
4 [label="goto\nconversion" URL="\ref goto-conversion"];
140+
5 [label="instrumentation" URL="\ref instrumentation"];
141+
6 [label="symbolic\nexecution" URL="\ref symbolic-execution"];
142+
7 [label="SAT/SMT\nencoding" URL="\ref sat-smt-encoding"];
143+
8 [label="decision\nprocedure" URL="\ref decision-procedure"];
144+
9 [label="counter example\nproduction" URL="\ref counter-example-production"];
145+
}
146+
\enddot
147+
148+
The \ref cbmc-user-manual "CBMC User Manual" describes CBMC from a user
149+
perspective. Each node in the diagram above links to the appropriate
150+
class or module documentation, describing that particular stage in the
151+
CBMC pipeline.
152+
CPROVER is structured in a similar fashion to a compiler. It has
153+
language specific front-ends which perform limited syntactic analysis
154+
and then convert to an intermediate format. The intermediate format can
155+
be output to files (this is what `goto-cc` does) and are (informally)
156+
referred to as “goto binaries” or “goto programs”. The back-end are
157+
tools process this format, either directly from the front-end or from
158+
it’s saved output. These include a wide range of analysis and
159+
transformation tools (see \ref other-tools).
160+
161+
## Coding Standards
162+
163+
See `CODING_STANDARD.md` file in the root of the CBMC repository.
164+
165+
CPROVER is written in a fairly minimalist subset of C++; templates and
166+
meta-programming are avoided except where necessary.
167+
External library dependencies are avoided (only STL and a SAT solver
168+
are required). Boost is not used. The `util` directory contains many
169+
utilities that are not (yet) in the standard library.
170+
171+
Patches should be formatted so that code is indented with two space
172+
characters, not tab and wrapped to 80 columns. Headers for doxygen
173+
should be given (and preferably filled!) and the author will be the
174+
person who first created the file. Add doxygen comments to
175+
undocumented functions as you touch them. Coding standards
176+
and doxygen comments are enforced by CI before a patch can be
177+
merged by running `clang-format` and `cpplint`.
178+
179+
Identifiers should be lower case with underscores to separate words.
180+
Types (classes, structures and typedefs) names must end with a `t`.
181+
Types that model types (i.e. C types in the program that is being
182+
interpreted) are named with `_typet`. For example `ui_message_handlert`
183+
rather than `UI_message_handlert` or `UIMessageHandler` and
184+
`union_typet`.
185+
186+
187+
\section other-tools Other Tools
188+
189+
FIXME: The text in this section is a bit outdated.
190+
191+
The CPROVER subversion archive contains a number of separate programs.
192+
Others are developed separately as patches or separate
193+
branches.Interfaces are have been and are continuing to stablise but
194+
older code may require work to compile and function correctly.
195+
196+
In the main archive:
197+
198+
* `CBMC`: A bounded model checking tool for C and C++. See
199+
\ref cbmc.
200+
201+
* `goto-cc`: A drop-in, flag compatible replacement for GCC and other
202+
compilers that produces goto-programs rather than executable binaries.
203+
See \ref goto-cc.
204+
205+
* `goto-instrument`: A collection of functions for instrumenting and
206+
modifying goto-programs. See \ref goto-instrument.
207+
208+
Model checkers and similar tools:
209+
210+
* `SatABS`: A CEGAR model checker using predicate abstraction. Is
211+
roughly 10,000 lines of code (on top of the CPROVER code base) and is
212+
developed in its own subversion archive. It uses an external model
213+
checker to find potentially feasible paths. Key limitations are
214+
related to code with pointers and there is scope for significant
215+
improvement.
216+
217+
* `Scratch`: Alistair Donaldson’s k-induction based tool. The
218+
front-end is in the old project CVS and some of the functionality is
219+
in `goto-instrument`.
220+
221+
* `Wolverine`: An implementation of Ken McMillan’s IMPACT algorithm
222+
for sequential programs. In the old project CVS.
223+
224+
* `C-Impact`: An implementation of Ken McMillan’s IMPACT algorithm for
225+
parallel programs. In the old project CVS.
226+
227+
* `LoopFrog`: A loop summarisation tool.
228+
229+
* `TAN`: Christoph’s termination analyser.
230+
231+
Test case generation:
232+
233+
* `cover`: A basic test-input generation tool. In the old
234+
project CVS.
235+
236+
* `FShell`: A test-input generation tool that allows the user to
237+
specify the desired coverage using a custom language (which includes
238+
regular expressions over paths). It uses incremental SAT and is thus
239+
faster than the naïve “add assertions one at a time and use the
240+
counter-examples” approach. Is developed in its own subversion.
241+
242+
Alternative front-ends and input translators:
243+
244+
* `Scoot`: A System-C to C translator. Probably in the old
245+
project CVS.
246+
247+
* `???`: A Simulink to C translator. In the old project CVS.
248+
249+
* `???`: A Verilog front-end. In the old project CVS.
250+
251+
* `???`: A converter from Codewarrior project files to Makefiles. In
252+
the old project CVS.
253+
254+
Other tools:
255+
256+
* `ai`: Leo’s hybrid abstract interpretation / CEGAR tool.
257+
258+
* `DeltaCheck?`: Ajitha’s slicing tool, aimed at locating changes and
259+
differential verification. In the old project CVS.
260+
261+
There are tools based on the CPROVER framework from other research
262+
groups which are not listed here.

doc/architectural/front-page.md

+69-25
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,90 @@
1-
CProver Documentation
1+
CProver Developer Documentation
22
=====================
33

4-
\author Kareem Khazem
5-
64
These pages contain user tutorials, automatically-generated API
75
documentation, and higher-level architectural overviews for the
8-
CProver codebase. Users can download CProver tools from the
9-
<a href="http://www.cprover.org/">CProver website</a>; contributors
10-
should use the <a href="https://github.com/diffblue/cbmc">repository</a>
11-
hosted on GitHub.
6+
CProver codebase. CProver is a platform for software verification. Users can
7+
download CProver tools from the <a href="http://www.cprover.org/">CProver
8+
website</a>; contributors should use the
9+
<a href="https://github.com/diffblue/cbmc">repository</a> hosted on GitHub. CBMC
10+
is part of CProver.
11+
12+
CBMC is a Bounded Model Checker for C and C++ programs. It supports C89, C99,
13+
most of C11 and most compiler extensions provided by gcc and Visual Studio. It
14+
also supports SystemC using Scoot. It allows verifying array bounds (buffer
15+
overflows), pointer safety, arithmetic exceptions and user-specified assertions.
16+
Furthermore, it can check C and C++ for consistency with other languages, such
17+
as Verilog. The verification is performed by unwinding the loops in the program
18+
and passing the resulting equation to a decision procedure.
19+
20+
For further information see [cprover.org](http://www.cprover.org/cbmc).
21+
22+
Versions
23+
========
24+
25+
Get the [latest release](https://github.com/diffblue/cbmc/releases)
26+
* Releases are tested and for production use.
27+
28+
Get the current *develop* version: `git clone https://github.com/diffblue/cbmc.git`
29+
* Develop versions are not recommended for production use.
30+
31+
Report bugs
32+
===========
33+
34+
If you encounter a problem please file a bug report:
35+
* Create an [issue](https://github.com/diffblue/cbmc/issues)
36+
37+
Contributing to the code base
38+
=============================
39+
40+
1. Fork the the CBMC repository on GitHub.
41+
2. Clone your fork with `git clone [email protected]:YOURNAME/cbmc.git`
42+
3. Create a branch from the `develop` branch (default branch)
43+
4. Make your changes - follow the
44+
<a href="https://github.com/diffblue/cbmc/blob/develop/CODING_STANDARD.md">
45+
coding guidelines</a>
46+
5. Push your changes to your branch
47+
6. Create a Pull Request targeting the `develop` branch
48+
49+
License
50+
=======
51+
52+
<a href="https://github.com/diffblue/cbmc/blob/develop/LICENSE">4-clause BSD
53+
license</a>.
54+
55+
Overview of Documentation
56+
=======
1257

1358
### For users:
1459

15-
* The \ref cprover-manual "CProver Manual" details the capabilities of
16-
CBMC and SATABS and describes how to install and use these tools. It
60+
* The \ref cbmc-user-manual "CBMC User Manual" details the capabilities of
61+
CBMC and describes how to install and use these tools. It
1762
also covers the underlying theory and prerequisite concepts behind how
1863
these tools work.
1964

65+
* There is a helpful user tutorial on the wiki with lots of linked resources,
66+
you can access it <a href=
67+
"https://svn.cprover.org/wiki/doku.php?id=cprover_tutorial">here</a>.
68+
2069
### For contributors:
2170

71+
* The \subpage cprover-architecture-overview "CProver Architecture Overview"
72+
is a single document describing the layout of the codebase and many of the
73+
important data structures. It probably contains more information than the
74+
module pages at the moment, but may be somewhat out-of-date.
75+
76+
* For higher-level architectural information, each of the pages under
77+
the <a href="modules.html">Modules</a>
78+
link gives an overview of a directory in the CProver codebase.
79+
2280
* If you already know exactly what you're looking for, the API reference
2381
is generated from the codebase. You can search for classes and class
2482
members in the search bar at top-right or use one of the links in the
2583
sidebar.
2684

27-
* For higher-level architectural information, each of the pages under
28-
the "Modules" link in the sidebar gives an overview of a directory in
29-
the CProver codebase.
30-
31-
* The \ref module_cbmc "CBMC guided tour" is a good start for new
32-
contributors to CBMC. It describes the stages through which CBMC
33-
transforms source files into bug reports and counterexamples, linking
34-
to the relevant documentation for each stage.
35-
36-
* The \subpage cbmc-hacking "CBMC hacking HOWTO" helps new contributors
85+
* The \subpage tutorial "CBMC Developer Tutorial" helps new contributors
3786
to CProver to get their feet wet through a series of programming
38-
exercises---mostly modifying goto-instrument, and thus learning to
87+
exercises - mostly modifying goto-instrument, and thus learning to
3988
manipulate the main data structures used within CBMC.
4089

41-
* The \subpage cbmc-guide "CBMC guide" is a single document describing
42-
the layout of the codebase and many of the important data structures.
43-
It probably contains more information than the module pages at the
44-
moment, but may be somewhat out-of-date.
45-
4690
\defgroup module_hidden _hidden

0 commit comments

Comments
 (0)