Skip to content

Commit d0f51b1

Browse files
author
Owen Jones
committed
Squashed 'cbmc/' changes from 5d3ea03..4f5e148
4f5e148 Merge pull request diffblue#2713 from thk123/dump/expr2c-configuration 01b7418 Merge pull request diffblue#2710 from thomasspriggs/tas/struct_component b763877 Merge pull request diffblue#2737 from diffblue/remove-appveyor 9c3fd45 Add AWS CodeBuild badges 4261fd8 Remove appveyor badge fe23db7 Remove appveyor.yml 21857a7 Add support for getting components by name to `struct_exprt` 05993f4 Merge pull request diffblue#2727 from tautschnig/fptr-debug 0ecd008 Merge pull request diffblue#2701 from antlechner/antonia/enum-constants 159bf15 Merge pull request diffblue#2205 from diffblue/rename_symbol_type 5ca6cd2 Restrict new clinit_wrapper calls to enum types 6e04213 Reformatting the structs to aid readability 0cfacb8 Add type2c conversion for specifying a type name c3fef70 Add a clean configuration for expr2c 3a40db1 Make expr2ct configurable in a number of ways 097cf71 Merge pull request diffblue#2731 from diffblue/increase-version 170c1ea Merge pull request diffblue#2730 from diffblue/parent-child-invariant c9e46ae Temporarily remove new UNREACHABLE statements 03e3877 Add tests for nondet initialization of enums 3e32140 CI lazy methods: load clinit for all param types 5542c54 Move nondet enum initialization to new function 6ecf4f9 Nondet-init enums by assigning them to a constant 6c84caa Refactor logic for generating a nondet int 07d1e44 Always run clinit_wrapper before nondet object init 3be826f Add some documentation to java_object_factory 5e80310 add invariant on parent-child class relationship 2cf1931 Merge pull request diffblue#2661 from jeannielynnmoulton/jeannie/JavaMethodType c6acc9c increased version number in preparation for release 5.10 0ee4178 Merge pull request diffblue#2729 from tautschnig/add-sub-conflict f5aff56 Merge pull request diffblue#2705 from danpoe/feature/replace-function-calls 89048e6 Function-pointer remvoval: print human-friendly debug messages 1fc3118 Use pointer difference type when adding to pointer 072b592 Merge pull request diffblue#2726 from tautschnig/java-loc 4dca215 Goto program should not use java_method_typet 273fff4 Add can_cast_type and precondition. 6cb7e5d Reinstate require_code and add require_java_method 78f7cb7 Refactor constructors for java_method_typet 6cefc61 Unit tests conversion from code_typet to java_method_typet c3b8b5a Update tag in to_java_method_type 972315a Update docs on java_method_typet constructor 211931c Add tag for java_method_type 551df9c Update unit tests to use java_method_typet da18c9f Change variables named code_type to method_type f1bd41e Change code_typet to java_method_typet in jbmc be3c4c6 Merge pull request diffblue#2430 from tautschnig/vs-function-id 03fa885 Replace function calls c4d79ab Java string preprocessing: use provided source location fb0c552 Java string preprocessing: use and document parameter function_id c31edca Merge pull request diffblue#2725 from tautschnig/replace-symbolt-code-type 2c1fc06 Merge pull request diffblue#2721 from tautschnig/replace_symbol-cleanup2 8211a78 Merge pull request diffblue#2722 from tautschnig/cleanup-valuest 30bc071 Add "// empty last line" to options list in goto_instrument_parse_options.h 8c8801c List source files in goto-programs/Makefile in lexicographic order 40d28ae replace_symbolt: report replacements in code_typet::return_type 4b9df3b Revert "Ignore return value" e39ea2e Merge pull request diffblue#2683 from karkhaz/kk-continue-unsafe 424ab4f --stop-on-fail now stops on failed path 545bff8 Add clear() to path exploration worklist 95d8d0f Generalise option setting from strategy unit tests e85fb77 Cleanup constant_propagator_domaint::valuest 18d08bf Merge pull request diffblue#2719 from tautschnig/quiet-unit-tests 30d557a Constant propagation: Check type consistency before adding to replacement map a5ce621 Make unit tests quiet 61b3086 Merge pull request diffblue#2468 from tautschnig/vs-names 7bfd36b Merge pull request diffblue#2714 from diffblue/msvc-asm 3785941 Remove names of unused parameters af79cb9 add support for Visual Studio style inline assembler 254b4d4 Merge pull request diffblue#2642 from diffblue/remove_asm_fix 26009a3 remove_asm now guarantees that functions called exist 9c10f38 Merge pull request diffblue#2716 from tautschnig/fix-buildspec c3b2beb Merge pull request diffblue#2635 from qaphla/move_is_lvalue e247a29 CodeBuild: Remove empty artifact stanza 756018d Merge pull request diffblue#2709 from owen-jones-diffblue/doc/how-to-run-tests bba5dea Merge pull request diffblue#2699 from diffblue/goto-cc-clang 355fbd2 avoid assert() 6178908 bump goto binary version f93deec type symbols now use ID_symbol_type 22b755a Merge pull request diffblue#2711 from diffblue/mode-gcc-asm-functions cf75535 Merge pull request diffblue#2702 from owen-jones-diffblue/doc/minor-fixes-to-cprover-developer-documentation 5c06786 set mode for functions added by remove_asm ef53b65 Update description of regression test framework 312ca1d Add section to documentation about running tests d7ddf59 Merge pull request diffblue#2700 from romainbrenguier/clean-up/side-effect-location 119e88b Pass location around for nondet initialization 50660db Specify source location for nondet expressions d1f2ad9 Replace -> with → e448db6 Merge pull request diffblue#2708 from owen-jones-diffblue/coding-standard-class-comments 519370d State that identifiers should be good 30d29b9 Replace unicode arrows → with ascii ones -> 611374f Document classes and member variables unless obvious adb7ef0 Minor fixes to documentation outline fd4f563 Add side_effect_exprt constructor with location 98657d8 Merge pull request diffblue#2668 from diffblue/expose_remove_preconditions 6a36fa4 Merge pull request diffblue#2615 from owen-jones-diffblue/doc/cbmc-developer-guide 61a8c30 Merge pull request diffblue#2666 from NlightNFotis/invariant_changes c0bcce7 use clang as native compiler for goto-clang 1f19e23 goto-cc: use result of our native compiler detection d9d9e2a Merge pull request diffblue#2692 from diffblue/follow-tags f94d5e2 follow union, struct and enum tags 99e33bd fix typo in comments for struct_tag_typet 1f53246 expose remove_preconditions f212505 Avoids using expr.op0 when type is known 7b36ca2 Moves is_lvalue to expr_util.c 4782b48 Fix invariant regression tests efb1c40 Refactor invariant_failedt definition. 515f050 Pass the condition to the invariant_failedt constructor. bf6dd9e Added extra use-case hints to the already present invariant definitions. 612b4f8 Address review comments 7233f92 Rearrange everything into separate pages 1cb3cdd Move other tools into a separate file 82eefb7 Fix links between files d9e690b Move folder walkthrough to a separate file 2939db4 Address review comments 8d5cbcb Create CBMC developer guide documentation git-subtree-dir: cbmc git-subtree-split: 4f5e148
1 parent 199e814 commit d0f51b1

File tree

288 files changed

+3348
-1734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+3348
-1734
lines changed

CODING_STANDARD.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ Formatting is enforced using clang-format. For more information about this, see
5959
```
6060
Note that the `\file` tag must be immediately followed by a newline in order
6161
for Doxygen to relate the comment to the current file.
62-
- Each function should be preceded by a Doxygen comment describing that
63-
function. The format should match the [LLVM
62+
- Each class, member variable and function should be preceded by a Doxygen
63+
comment describing it when it is not immediately obvious what it does. The
64+
format should match the [LLVM
6465
guidelines](http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments),
65-
with one extension: `\param` and `\return` comments longer than a single line
66-
should have subsequent lines indented by two spaces, so that the tags stand
67-
out. An example:
66+
with one extension: for functions, `\param` and `\return` comments longer than
67+
a single line should have subsequent lines indented by two spaces, so that the
68+
tags stand out. An example:
6869
```c++
6970
/// This sentence, until the first dot followed by whitespace, becomes
7071
/// the brief description. More detailed text follows. Feel free to
@@ -93,6 +94,7 @@ Formatting is enforced using clang-format. For more information about this, see
9394
- Use #ifdef DEBUG to guard debug code
9495
9596
# Naming
97+
- Identifiers should make clear the purpose of the thing they are naming.
9698
- Identifiers may use the characters `[a-z0-9_]` and should start with a
9799
lower-case letter (parameters in constructors may start with `_`).
98100
- Omit names of parameters or exception objects when they are not used. If

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
[![Build Status][travis_img]][travis] [![Build Status][appveyor_img]][appveyor]
1+
[![Build Status][travis_img]][travis]
2+
![Build Status][codebuild_img]
3+
![Build Status][codebuild_windows_img]
24
[![Build Status][coverity_img]][coverity]
35

46
[CProver Wiki](http://www.cprover.org/wiki)
@@ -49,7 +51,7 @@ License
4951

5052
[travis]: https://travis-ci.org/diffblue/cbmc
5153
[travis_img]: https://travis-ci.org/diffblue/cbmc.svg?branch=master
52-
[appveyor]: https://ci.appveyor.com/project/diffblue/cbmc/
53-
[appveyor_img]: https://ci.appveyor.com/api/projects/status/github/diffblue/cbmc?svg=true&branch=master
54+
[codebuild_img]: https://codebuild.us-east-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoieVl4UDBKaVU2NEZIeE9GKzhMVWJUQ1RORXRZeGFEdm9LZnhvbWt4Q3oxb29uOTdWZDhZUkUvK2Z0eTBndU5pWkcyUXFZb1pDRVpBNXVob3R0R2tYZkdFPSIsIml2UGFyYW1ldGVyU3BlYyI6IkZ0TzR2a21XbHFkWnlYMkwiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=develop
55+
[codebuild_windows_img]: https://codebuild.us-east-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiTFQ4Q0lCSEc1Rk5NcmlzaFZDdU44Vk8zY0c1VCtIVWMwWnJMRitmVFI5bE94Q3dhekVPMWRobFU2Q0xTTlpDSWZUQ3J1eksrWW1rSll1OExXdll2bExZPSIsIml2UGFyYW1ldGVyU3BlYyI6InpqcloyaEdxbjBiQUtvNysiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=develop
5456
[coverity]: https://scan.coverity.com/projects/diffblue-cbmc
5557
[coverity_img]: https://scan.coverity.com/projects/13552/badge.svg

appveyor.yml

Lines changed: 0 additions & 92 deletions
This file was deleted.

buildspec-windows.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ phases:
8080
$env:Path = "C:\tools\cygwin\bin;$env:Path"
8181
cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && bash -c "make -C jbmc/unit test BUILD_ENV=MSVC" '
8282
83-
artifacts:
84-
files:
85-
8683
cache:
8784
paths:
8885
- 'c:\clcache\**\*'

buildspec.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ phases:
2727
- make -C jbmc/unit test
2828
- make -C jbmc/regression test
2929
- echo Build completed on `date`
30-
artifacts:
31-
files:
3230
cache:
3331
paths:
3432
- '/var/cache/apt/**/*'
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
\ingroup module_hidden
2+
\page background-concepts Background Concepts
3+
4+
\author Martin Brain, Peter Schrammel
5+
6+
# Representations #
7+
8+
## AST: types, globals, variables, functions, code blocks, language primitives, assignments, expressions, variables ##
9+
10+
To be documented.
11+
12+
## CFG ##
13+
14+
To be documented.
15+
16+
## SSA ##
17+
18+
To be documented.
19+
20+
# Analysis techniques #
21+
22+
## Bounded model checking ##
23+
24+
To be documented (can copy from the CBMC manual).
25+
26+
## SAT and SMT ##
27+
28+
To be documented.
29+
30+
## Static analysis ##
31+
32+
To be documented.

doc/architectural/bmct-class.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
\ingroup module_hidden
2+
\page bmct-class Bmct class
3+
4+
\author
5+
6+
## equation ##
7+
8+
To be documented.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
\ingroup module_hidden
2+
\page cbmc-architecture CBMC Architecture
3+
4+
\author Martin Brain, Peter Schrammel
5+
6+
This section provides a graphical overview of how CBMC fits together.
7+
CBMC takes C code or a goto-binary as input and tries to emit traces
8+
of executions that lead to crashes or undefined behaviour. The diagram
9+
below shows the intermediate steps in this process.
10+
11+
\dot
12+
digraph G {
13+
14+
rankdir="TB";
15+
node [shape=box, fontcolor=blue];
16+
17+
subgraph top {
18+
rank=same;
19+
1 -> 2 -> 3 -> 4;
20+
}
21+
22+
subgraph bottom {
23+
rank=same;
24+
5 -> 6 -> 7 -> 8 -> 9;
25+
}
26+
27+
/* shift bottom subgraph over */
28+
9 -> 1 [color=white];
29+
30+
4 -> 5;
31+
32+
1 [label="command line\nparsing" URL="\ref cbmc_parse_optionst"];
33+
2 [label="preprocessing,\nparsing" URL="\ref preprocessing"];
34+
3 [label="language\ntype-checking" URL="\ref type-checking"];
35+
4 [label="goto\nconversion" URL="\ref goto-conversion"];
36+
5 [label="instrumentation" URL="\ref instrumentation"];
37+
6 [label="symbolic\nexecution" URL="\ref symbolic-execution"];
38+
7 [label="SAT/SMT\nencoding" URL="\ref sat-smt-encoding"];
39+
8 [label="decision\nprocedure" URL="\ref decision-procedure"];
40+
9 [label="counter example\nproduction" URL="\ref counter-example-production"];
41+
}
42+
\enddot
43+
44+
The \ref cbmc-user-manual "CBMC User Manual" describes CBMC from a user
45+
perspective. Each node in the diagram above links to the appropriate
46+
class or module documentation, describing that particular stage in the
47+
CBMC pipeline.
48+
CPROVER is structured in a similar fashion to a compiler. It has
49+
language specific front-ends which perform limited syntactic analysis
50+
and then convert to an intermediate format. The intermediate format can
51+
be output to files (this is what `goto-cc` does) and are (informally)
52+
referred to as “goto binaries” or “goto programs”. The back-end are
53+
tools process this format, either directly from the front-end or from
54+
it’s saved output. These include a wide range of analysis and
55+
transformation tools (see \ref section-other-tools).
56+
57+
# Concepts #
58+
## {C, java bytecode} → Parse tree → Symbol table → GOTO programs → GOTO program transformations → BMC → counterexample (goto_tracet) → printing ##
59+
60+
To be documented.
61+
62+
## Instrumentation: goto functions → goto functions ##
63+
64+
To be documented.
65+
66+
## Goto functions → BMC → Counterexample (trace) ##
67+
68+
To be documented.
69+
70+
## Trace → interpreter → memory map ##
71+
72+
To be documented.
73+
74+
## Goto functions → abstract interpretation ##
75+
76+
To be documented.
77+
78+
## Executables (flow of transformations): ##
79+
80+
### goto-cc ###
81+
82+
To be documented.
83+
84+
### goto-instrument ###
85+
86+
To be documented.
87+
88+
### cbmc ###
89+
90+
To be documented.
91+
92+
### goto-analyzer ###
93+
94+
To be documented.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
\ingroup module_hidden
2+
\page compilation-and-development Compilation and Development
3+
4+
\author Martin Brain, Peter Schrammel
5+
6+
## Makefiles ##
7+
8+
First off, read the \ref cbmc-user-manual "CBMC User Manual". It describes
9+
how to get, build and use CBMC. This document covers the
10+
internals of the system and how to get started on development.
11+
12+
## CMake files ##
13+
14+
To be documented.
15+
16+
## Personal configuration: config.inc, macro DEBUG ##
17+
18+
To be documented.
19+
20+
## Running tests ##
21+
22+
### Regression tests ###
23+
24+
The regression tests are contained in the `regression/` folder.
25+
They are grouped into directories for each of the tools/modules.
26+
Each of these contains multiple directories, each of which contains
27+
input files and one or more`.desc` files that describe what command
28+
to run, what output is expected and so on. There is a Perl script,
29+
`test.pl` that is used to invoke the tests as:
30+
31+
../test.pl -c PATH_TO_CBMC
32+
33+
The `–help` option gives instructions for use and the
34+
format of the description files.
35+
36+
To be documented further.
37+
38+
### Unit tests ###
39+
40+
To be documented.
41+
42+
## Documentation ##
43+
44+
Apart from the (user-orientated) CBMC user manual and this document, most
45+
of the rest of the documentation is inline in the code as `doxygen` and
46+
some comments. A man page for CBMC, goto-cc and goto-instrument is
47+
contained in the `doc/` directory and gives some options for these
48+
tools. All of these could be improved and patches are very welcome. In
49+
some cases the algorithms used are described in the relevant papers.
50+
51+
## Accessing doxygen documentation ##
52+
53+
The doxygen documentation can be [accessed online](http://cprover.diffblue.com).
54+
To build it locally, run `doxygen` in `/src`. HTML output will be created in
55+
`/doc/html`. The index page is `/doc/html/index.html`.
56+
57+
## Coding standards ##
58+
59+
See <a
60+
href="https://github.com/diffblue/cbmc/blob/master/CODING_STANDARD.md">
61+
`CODING_STANDARD.md`</a> file in the root of the CBMC repository.
62+
63+
CPROVER is written in a fairly minimalist subset of C++; templates and
64+
meta-programming are avoided except where necessary.
65+
External library dependencies are avoided (only STL and a SAT solver
66+
are required). Boost is not used. The `util` directory contains many
67+
utilities that are not (yet) in the standard library.
68+
69+
Patches should be formatted so that code is indented with two space
70+
characters, not tab and wrapped to 80 columns. Headers for doxygen
71+
should be given (and preferably filled!) and the author will be the
72+
person who first created the file. Add doxygen comments to
73+
undocumented functions as you touch them. Coding standards
74+
and doxygen comments are enforced by CI before a patch can be
75+
merged by running `clang-format` and `cpplint`.
76+
77+
Identifiers should be lower case with underscores to separate words.
78+
Types (classes, structures and typedefs) names must end with a `t`.
79+
Types that model types (i.e. C types in the program that is being
80+
interpreted) are named with `_typet`. For example `ui_message_handlert`
81+
rather than `UI_message_handlert` or `UIMessageHandler` and
82+
`union_typet`.

0 commit comments

Comments
 (0)