Skip to content

Tools overview #5792

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

Merged
merged 1 commit into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ and passing the resulting equation to a decision procedure.

For full information see [cprover.org](http://www.cprover.org/cbmc).

For an overview of the various tools that are part of CProver and
how to use them see [TOOLS_OVERVIEW.md](TOOLS_OVERVIEW.md).


Versions
========

Expand Down
256 changes: 256 additions & 0 deletions TOOLS_OVERVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
## Overview of CProver Tools

This document provides a brief overview of the various tools in
the CProver project. The goal is as to provide a lightweight reference
with links to detailed documentation on each of the tools.

The tools in the CProver project are as follows:
- [cbmc](#cbmc)
- [goto-analyzer](#goto-analyzer)
- [goto-cc (goto-gcc, goto-ld)](#goto-cc)
- [goto-diff](#goto-diff)
- [goto-harness](#goto-harness)
- [goto-instrument](#goto-instrument)
- [janalyzer](#janalyzer)
- [jbmc](#jbmc)
- [jdiff](#jdiff)
- [memory-analyzer](#memory-analyzer)
- [smt2_solver](#smt2_solver)
- [symtab2gb](#symtab2gb)
- [Developer Utilities](#developer-utilities)
- [java-unit](#java-unit)
- [unit](#unit)
- [others (converter, driver, file_converter, java-converter)](#others)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, and makes me wonder whether this should be linked (or included in?) the top-level README file so that people accessing the repository see it right away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added link in README.md


The rest of this document provides a section on each of these tools in alphabetical order.
Most links in this document are to the [CProver online documentation](http://cprover.diffblue.com/index.html).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure how linking is done in the rest of the documentation but if there is an option to have these as local / relative links that would be great.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should definitely use relative links.

Copy link
Contributor Author

@TGWDB TGWDB Feb 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no consistent way of linking.

I was working on another (draft, so very provisional) pull request (see #5781) and it was recommended to use links to the online documentation at diffblue.com.

Exact quote is:

README.md references http://cprover.diffblue.com/, so I'd go with that in top-level files (README.md, COMPILING.md, CODING_STANDARD.md, and possibly any files to be added at that level).

So should I document with:
A. Links to the local documentation path (e.g. doc/html/index.html)
B. Links to the absolute location (e.g. http://cprover.diffblue.com/index.html)
C. Something else? (E.g. relative html links, although these will not work when .md files are used like this one?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the confusion is that the top-level .md files are currently not compiled into cprover.diffblue.com, but only those in doc and the README.md files in the source directories.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My rationale was that this is a top level .md file (similar to README.md) and so we should link to the diffblue.com URLs. Since this is not going to be compiled into the website, then I understand the current linking is correct?

The above said, if we wish to move this document to another location (or have another reason to change), let me know and I can redo the links as relative.



## cbmc

The C Bounded Model Checker (`cbmc`) is the main tool used in the CProver suite.
`cbmc` does the entire analysis from the source code through to the result,
including generating traces. This includes invoking various sub-tools and
modules.

For details on usage of the `cbmc` tool see the following documentation
- [Developer Tutorial](http://cprover.diffblue.com/tutorial.html)
includes a very brief tutorial on many aspects of `cbmc` and other tools.

For details on the architecture of the `cbmc` tool and how the analysis is performed
see the following documents:
- [CBMC Architecture](http://cprover.diffblue.com/cbmc-architecture.html)
gives a high level overview of the `cbmc` architecture and data flow.
- [Background Concepts](http://cprover.diffblue.com/background-concepts.html)
overviews all the key concepts used in the `cbmc` analysis.

For details on compiling, testing, contributing, and documentation related to
development see:
- [CProver Developer Documentation](http://cprover.diffblue.com/index.html)


## goto-analyzer

The `goto-analyzer` is a wrapper program around the
[abstract interpretation](http://cprover.diffblue.com/background-concepts.html#abstract_interpretation_section)
implementations. (For more detail on these implementations see
[here](http://cprover.diffblue.com/group__analyses.html).)
It is possible to configure which abstractions are used and what
is done with the chosen abstractions (verification, display,
simplification, etc.). The current best documentation is available
[here](http://cprover.diffblue.com/goto__analyzer__parse__options_8h.html).

Other documentation useful for this tool can be found:
- [Analysis Information](http://cprover.diffblue.com/group__analyses.html)

Details of all the options can be seen by running
```
goto-analyzer --help
```

## goto-cc

This is a compiler designed to be able to be dropped in to an existing
build process to replace the existing compiler. `goto-cc` is able to do
normal compilation, but is designed to output goto programs (optionally
in addition to the normal compiled program). Note that `goto-cc` is both
the compiler and linker (`goto-gcc` and `goto-ld` are symbolic links to
`goto-cc`, where the file name is used to ensure the program behaves
according to the name, e.g. if called from `goto-gcc` then `goto-cc`
will behave like `gcc`). The additional object code is used as the internal
representation for `cbmc` and related tools. These can also be extracted and
used themselves.

Further information on `goto-cc` can be found:
- [Developer Tutorial](http://cprover.diffblue.com/tutorial.html) with
some very simple examples and notes.
- [goto-cc](http://cprover.diffblue.com/group__goto-cc.html) information
on the `goto-cc` compilers
- [goto Programs](http://cprover.diffblue.com/group__goto-programs.html)
for information on goto programs and how they are used.

Note that `goto-cc` can emulate GCC, Visual Studio, and CodeWarrior
compilers.
Comment on lines +92 to +93
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, see my notes about for symlinks.



## goto-diff

Provides a variety of difference checks between two goto programs
produced by `goto-cc` (essentially a `diff` tool for goto programs).
This invokes some of the cbmc tools to convert the goto
program and then determine which functions are added/removed/changed.
Comment on lines +100 to +101
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that any other tools are being invoked?


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially a diff tool for goto-programs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the text for this (and also jdiff).

Details of all the options can be seen by running
```
goto-diff --help
```
this includes both options for the difference, and options for the goto
program instrumentation.


## goto-harness

This is a tool for creating a harness around a (part of a) goto program that
can then be analysed (using the harness). Harnesses can be either function
call environments, or memory snapshots.

Documentation on `goto-harness` can be found
[here](http://cprover.diffblue.com/md__home_travis_build_diffblue_cbmc_doc_architectural_goto-harness.html)
including details and examples.

Details of all the options can be seen by running
```
goto-harness --help
```


## goto-instrument

This is a collection of tools for analysing and modifying goto programs
(programs created with #goto-cc). Generally these take a goto program
and output another goto program.

Further examples and documentation can be found:
- [goto-instrument](http://cprover.diffblue.com/group__goto-instrument.html)
has an overview of `goto-instrument` and a small tutorial example.
- [Developer Tutorial](http://cprover.diffblue.com/tutorial.html) has high
level overview and some example commands for `goto-instrument`.


## janalyzer

This provides a way to access and invoke various forms of analysis on
Java programs. This is a fork of [goto-analyzer](#goto-analyzer) with
a Java Virtual Machine front end.

Documentation useful for this tool can be found:
- [Analysis Information](http://cprover.diffblue.com/group__analyses.html)

Details of all the options can be seen by running
```
janalyzer --help
```


## jbmc

This is the main analysis engine the performs the analysis
of Java files using bounded model checking. This is a
version of the `cbmc` tool that checks Java programs
(more documentation for `cbmc` is available and much of
it applies to `jbmc` since they use many of the same back
end utilities).

Note that the `jbmc` tool follows `java` conventions so that
programs can be analyzed in the same way you would run them
using the `java` executable. There also many additional
options to support nondeterministic initialisation of variable
size arrays, data structures and strings, control how to assert
on exceptions etc.

For some light information on usage of the jbmc tool see the following documentation
- [JBMC homepage](https://www.cprover.org/jbmc/) includes some
simple examples and information.

For details on how analysis is performed in the `cbmc` and
`jbmc` tools see see the following documents:
- [CBMC Architecture](http://cprover.diffblue.com/cbmc-architecture.html)
gives a high level overview of the `cbmc` architecture and data flow that *should also apply to* `jbmc`.
- [Background Concepts](http://cprover.diffblue.com/background-concepts.html)
overviews all the key concepts used in the `jbmc` analysis.

For details on compiling, testing, contributing, and documentation related to development see:
- [CProver Development Documentation](http://cprover.diffblue.com/index.html)


## jdiff

Provides a variety of difference checks between two goto programs (produced
by `goto-cc`). This invokes some of the `cbmc`/`jbmc` tools to convert the goto
program and then determine which functions are added/removed/changed.
This is a clone of `goto-diff` for Java programs and is essentially
a `diff` for goto programs generated from Java code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, I believe (@peterschrammel ?) that jdiff is goto-diff forked and the JVM front-end added.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just a clone of goto-diff for use on Java bytecode input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated text (and also on goto-diff)

Details of all the options can be seen by running
```
jdiff --help
```
this includes both options for the difference, and options for the goto
program instrumentation.


## memory-analyzer

This is a wrapper program that provides a front end to `gdb` that adds some
useful features related to the other goto utilities. In particular
`memory-analyzer` can run a compiled binary using `gdb` and then (at the
right point) create a harness from the current program state for use with
`goto-harness`.

Note that to use `memory-analyzer` the program must be compiled with
`goto-cc`. To make best use of `memory-analyzer` and `gdb` you should
compile with the `-g` option.

For further documentation and examples see
[here](http://cprover.diffblue.com/md__home_travis_build_diffblue_cbmc_doc_architectural_memory-analyzer.html).


## smt2_solver

This is an (Satisfiability Modulo Theories) SMT solver that
parses SMT-LIB 2 format files and uses CProver's internal bit-blasting
solver (see [solvers](http://cprover.diffblue.com/group__solvers.html))
to resolve queries.

## symtab2gb

This utility is to compile a cbmc symbols table (in JSON format) into a goto binary.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used to integrate external language frontends, e.g. https://github.com/diffblue/gnat2goto/

This is to support integration of external language frontends
(e.g. [Ada using GNAT2GOTO](https://github.com/diffblue/gnat2goto/)).
For usage run
```
symtab2gb --help
```


## Developer Utilities

The utilities below are designed for developer use.

### java-unit

Runs Java unit tests. For more details use
```
java-unit --help
```
Default behaviour is to only show failed test cases.


### unit

Runs C unit tests. For more details use
```
unit --help
```
Default behaviour is to only show failed test cases.