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

Tools overview #5792

merged 1 commit into from
Feb 5, 2021

Conversation

TGWDB
Copy link
Contributor

@TGWDB TGWDB commented Jan 29, 2021

  • [V ] Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Jan 29, 2021

Codecov Report

Merging #5792 (f7d1023) into develop (4cc9611) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5792   +/-   ##
========================================
  Coverage    69.54%   69.54%           
========================================
  Files         1243     1243           
  Lines       100701   100701           
========================================
  Hits         70037    70037           
  Misses       30664    30664           
Flag Coverage Δ
cproversmt2 43.32% <ø> (ø)
regression 66.44% <ø> (ø)
unit 32.25% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4cc9611...f7d1023. Read the comment docs.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Basically yes but there are a few more bits and links that might be useful.

- [others (converter, driver, file_converter, java-converter)](#others)

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.


## goto-analyzer

This provides a way to access and invoke various forms of analysis on
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a bit more detailed and restricted than that. goto-analyzer is a wrapper around the abstract interpretation ( http://cprover.diffblue.com/background-concepts.html#abstract_interpretation_section ) implementation ( well, implementations, see http://cprover.diffblue.com/group__analyses.html ) in CPROVER. It allows you to configure what abstractions are used and what is then done with them (verification, display, simplification, etc.). At the moment the best documentation is here : http://cprover.diffblue.com/goto__analyzer__parse__options_8h.html but I have writing a section for the manual on my TODO list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Incorporated these comments into an updated version (some text taken almost directly).

Let me know if you want to coordinate on writing the section for the manual (I'd love to learn more about this, and help write the section if I can).

## goto-cc

This is a compiler that also adds goto program information to the compiled
programs. Note that `goto-cc` is the compiler and linker while `goto-gcc` and
Copy link
Collaborator

Choose a reason for hiding this comment

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

goto-cc is intended as a drop-in replacement for gcc so that you can re-use the same build infrastructure. The key difference is that it builds goto-modelts instead of executables ( somewhere @tautschnig had a patch to build both but it is not the default ). Really important is that depending on the same of the binary, you get emulation of different compilers, such as the Visual Studio one and the CodeWarrior one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a rewrite that I hope reflects this.

Provides a variety of difference checks between two goto programs (produced
by `goto-cc`). This invokes some of the cbmc tools to convert the goto
program and then determine which functions are added/removed/changed.

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).

## janalyzer

This provides a way to access and invoke various forms of analysis on
Java programs.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes; janalyzer is a fork of goto-analyzer with the JVM front-end added.

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.


This is the main analysis engine the performs the analysis
of Java files using bounded model checking. This is a
Java version of the `cbmc` tool (more documentation for
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pedantry perhaps but to me a "java version" implies it is written in Java. The point is that jbmc is an old fork of cbmc with 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, it's a BMC tool for Java bytecode (similar to cbmc being a BMC tool for C).
It has been separated from CBMC in order to support separate compilation of C and Java frontends and tools. Also, JBMC's command line follows conventions of java so that programs can be analysed in the same way you would run them using the java executable. There also lots of additional options to support nondeterministic initialisation of variable size arrays, data structures and strings, control how to assert on exceptions etc.

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 for this (and added some clear phrases from Peter).

Provides a variety of difference checks between two goto programs (produced
by `goto-cc`). This invokes some of the `cbmc` tools to convert the goto
program and then determine which functions are added/removed/changed.

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)

## 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. Note that to use
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a bit more than that. memory-analyzer allows you to run an compiled binary, using gdb and when you are at the right point, it will build a harness that allows you to analyze the program /from that state/.

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 text on this, hope it is clear(er) now.


This is an (Satisfiability Modulo Theory) SMT solver that is shipped
with CProver. The SMT solver here is built on top of a Satisfiability
(SAT) solver. The `smt2_solver` is designer to work with files, and
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is basically an SMT interface to the CPROVER back-end prover.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@martin-cs Can you please clarify whether you are proposing a change to the text (and if so perhaps propose some new text), or whether you were making a comment to help us understand?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think more of the later but let's try the former too...

smt2_solver is an SMT (Satisfiability Modulo Theory) solver. It parses SMT-LIB 2 format and uses CPROVER's internal bit-blasting solver (see solvers/) to resolve queries.

- [others (converter, driver, file_converter, java-converter)](#others)

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
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.


This is the main analysis engine the performs the analysis
of Java files using bounded model checking. This is a
Java version of the `cbmc` tool (more documentation for
Copy link
Member

Choose a reason for hiding this comment

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

Yes, it's a BMC tool for Java bytecode (similar to cbmc being a BMC tool for C).
It has been separated from CBMC in order to support separate compilation of C and Java frontends and tools. Also, JBMC's command line follows conventions of java so that programs can be analysed in the same way you would run them using the java executable. There also lots of additional options to support nondeterministic initialisation of variable size arrays, data structures and strings, control how to assert on exceptions etc.

Provides a variety of difference checks between two goto programs (produced
by `goto-cc`). This invokes some of the `cbmc` tools to convert the goto
program and then determine which functions are added/removed/changed.

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.

Provides a variety of difference checks between two goto programs (produced
by `goto-cc`). This invokes some of the cbmc tools to convert the goto
program and then determine which functions are added/removed/changed.

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.

janalyzer --help
```

## java-unit
Copy link
Member

Choose a reason for hiding this comment

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

Not really an executable for users, but developers.


## 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/

```


## unit
Copy link
Member

Choose a reason for hiding this comment

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

Things below are for developers.

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 developer utilities section and listed the developer tools there.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

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

Thank you for adding all this documentation! One overall comment: would be be worth merging the sections janalyzer/goto-analyzer, jdiff/goto-diff, jbmc/cbmc, java-unit/unit?

- [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

Comment on lines 70 to 72
in addition to the normal compiled program). Note that `goto-cc` is the
compiler and linker while `goto-gcc` and `goto-ld` are symbolic links to
`goto-cc`. The additional object code is used as the internal representation
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 sure the fact that these are symlinks matters the most to a user. Perhaps focus on the resulting behaviour? goto-cc behaves differently, depending on the file name: the command-line options (and ensuing behaviour) are modelled after the program that has the same name as the suffix, i.e., gcc, ld, etc. (we also support cl, link, bcc, as).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been updated now to clarify the role of the different files and de-emphasise the symlinks.

Comment on lines +83 to +93
Note that `goto-cc` can emulate GCC, Visual Studio, and CodeWarrior
compilers.
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.

Comment on lines +91 to +101
This invokes some of the cbmc tools to convert the goto
program and then determine which functions are added/removed/changed.
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?

## goto-harness

This is a tool for creating a harness around a (part of a) goto program that
can then be analysed inside the harness. Harnesses can be either function
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does "inside the harness" mean?

Comment on lines 250 to 254
### others

These (`converter`, `driver`, `file_converter`, `java-converter`)
are build time utilities for other tools and not designed
to be run independently.
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 sure these should even be mentioned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rationale was to have list of all binaries (built on Linux, so some on other platforms may be missing). Open to removing the section though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Understood, but I fear this might cause more confusion than doing good. Not a blocker from my point of view, leaving it to you to decide.

This adds the TOOLS_OVERVIEW.md file (and links to it
from README.md). The Tools Overview is an overview of all
the tools that are part of the CProver package. Each
overview includes main points on how to use the tool and
what the tool is meant to do. Also further documentation
links are provided to better understand the tool.
@TGWDB TGWDB merged commit 0dfbd1e into diffblue:develop Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants