Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
329 commits
Select commit Hold shift + click to select a range
d9c8a8b
Comment unknown objects equalities - causing problems
viktormalik Apr 28, 2017
fc32b8e
Heap-interval domain: combination of domains.
viktormalik Apr 28, 2017
7ae7415
Heap-interval domain: remove abstract value from the domain (it is no…
viktormalik Jul 3, 2017
834dcc9
Heap domain: include all pointers into the pointer part of the template.
viktormalik Jul 3, 2017
c9e5284
SSA heap analysis: use only with interprocedural heap analysis.
viktormalik Jul 3, 2017
10b170f
Change heap regression tests.
viktormalik Jul 21, 2017
b478462
Comments and cleanup for heap branch.
viktormalik Aug 11, 2017
941c778
Update heap tests.
viktormalik Aug 11, 2017
0b3b0ba
Fix errors overlooked in merge of heap branch.
viktormalik Aug 11, 2017
a568713
Changes needed for the merge of heap branch into master.
viktormalik Aug 17, 2017
66810a7
Improved formatting.
viktormalik Sep 1, 2017
583db78
Fix in ssa_inliner: use utility function for obtaining identifier of …
viktormalik Sep 7, 2017
e7e390c
Repair code formatting for heap branch so that cpplint succeedes.
viktormalik Sep 22, 2017
53d1c90
Strategy solver for heap domain does not fail when the solver returns…
viktormalik Sep 22, 2017
e12bca4
Fix bugs in heap-interval domain combination.
viktormalik Oct 30, 2017
7b0d7de
Abort if tests fail
peterschrammel Nov 6, 2017
a2506b3
Fix formatting
peterschrammel Nov 6, 2017
36dae0f
Set termination/global2 and interprocedural/contextsensitive to KNOWNBUG
peterschrammel Nov 6, 2017
2e8254d
version 0.5.3
peterschrammel Nov 6, 2017
52b6532
Fix compiler warning
peterschrammel Nov 6, 2017
85f21bc
Fix nontermination witnesses
peterschrammel Nov 6, 2017
e7dadfa
Remove old nontermination witnesses
peterschrammel Nov 6, 2017
4a68dc4
Update CBMC pointer
peterschrammel Nov 6, 2017
e18072c
Better nontermination property ids
peterschrammel Nov 6, 2017
354b5c2
Download the chosen SAT solver
peterschrammel Nov 11, 2017
1c895e3
Make invariant bound more configurable
peterschrammel Nov 11, 2017
9f7b03f
version 0.5.4
peterschrammel Nov 11, 2017
bdfb547
Switch off nontermination case in --termination
peterschrammel Nov 11, 2017
18552d4
Fix nontermination tests
peterschrammel Nov 12, 2017
dd9bbf9
Fix invariant extraction for heap-interval
peterschrammel Nov 12, 2017
4bdda5f
Do not report properties when checking nontermination
peterschrammel Nov 12, 2017
52c29bf
Output correctness witness for termination
peterschrammel Nov 14, 2017
c222be9
Update test.pl
peterschrammel Nov 18, 2017
1260613
Deactivate tests whose result depends on SAT solver used
peterschrammel Nov 18, 2017
30f069d
version 0.5.5
peterschrammel Nov 18, 2017
a4b616f
More heap tests
peterschrammel Nov 11, 2017
b4eda8c
Fix can_convert_ssa_expr
peterschrammel Nov 19, 2017
3134999
Improve debug output
peterschrammel Nov 11, 2017
a291ad0
Fix show_ssa for ssa_heap_analysis
peterschrammel Nov 11, 2017
ca29943
Heap analysis: use symbolic dereferencing when accessing objects in t…
viktormalik Sep 8, 2017
8ace140
Fix bug in dereference, #dynamic flag must be checked on type, not on…
viktormalik Oct 5, 2017
15ea861
Dereference: always add unknown_object when pointer points to multipl…
viktormalik Oct 6, 2017
dbf71d8
Heap analysis: do RHS 'concretisation' only if heap objects are acces…
viktormalik Oct 6, 2017
913fee3
solving heap object concretisation in the right-hand side of assignment
martinhruska Oct 10, 2017
5f55072
Do not fail if symbolic dereference cannot be done. Instead, return t…
viktormalik Oct 27, 2017
fe0711e
Addressing cases where a pointer has (not) been redefined before its …
martinhruska Oct 27, 2017
41d8f20
RHS concretisation: handle when the RHS is an object (and not a membe…
viktormalik Oct 28, 2017
16b0046
concretisation also for assertion
martinhruska Nov 2, 2017
514c487
refactoring concretisation of rhs to a function
martinhruska Nov 2, 2017
5c7c0d4
adding rhs (assertion) concretisation test case
martinhruska Nov 2, 2017
b0b81b2
recursive concretisation of rhs
martinhruska Nov 2, 2017
3b3b5d1
taking care about assertion in assigments
martinhruska Nov 2, 2017
6e8cece
making test case more difficult
martinhruska Nov 2, 2017
0ecd4cc
remember concretisation of rhs
martinhruska Nov 2, 2017
ce27a7b
k-induction: do not unwind if dynamic objects are present
viktormalik Nov 9, 2017
9900ebf
Heap domain: improve updating of rows.
viktormalik Nov 14, 2017
d7fa366
Deactivate goto-into-loop unwinding
peterschrammel Nov 19, 2017
6737dab
Version 0.5.6
peterschrammel Nov 19, 2017
57def9d
Validate witnesses before reporting status
peterschrammel Nov 20, 2017
3589104
Update cbmc prerequisites
peterschrammel Nov 22, 2017
8b8635e
Symbolic dereference: improve concretisation of objects on RHS.
viktormalik Nov 20, 2017
72ffb14
Temporary fix: do not dynamically add pointed objects.
viktormalik Nov 20, 2017
75f98d3
Adding missing initialisation
peterschrammel Nov 21, 2017
1e94ab1
Termination analysis does not support linked lists
peterschrammel Nov 22, 2017
b807166
Restrict dynamic memory allocation detection to loops
peterschrammel Nov 22, 2017
97db310
Version 0.5.7
peterschrammel Nov 22, 2017
a9b40b5
Fix nontermination --trace option
peterschrammel Nov 22, 2017
051d86a
Add object-bits dummy option
peterschrammel Nov 25, 2017
ebba461
Improve calculation of size parameter for malloc.
viktormalik Nov 24, 2017
6108ad3
Hack to disable programs containing pointer arithmetics.
viktormalik Nov 24, 2017
fd05fb4
Hack to disable assertion hoisting for overflow-shl
peterschrammel Nov 26, 2017
7c58b9c
Mark regression tests that require further attention
peterschrammel Nov 26, 2017
32f6a98
Version 0.6.0
peterschrammel Nov 27, 2017
f3d2a90
Pointed objects: do not create empty object
viktormalik Jan 23, 2018
c8842b8
Improve heap domain by tracking symbolic execution paths
viktormalik Jan 8, 2018
f0abdee
Add test for the heap domain.
viktormalik Jan 8, 2018
45d96c6
Move the function for finding value of a symbolic path into strategy_…
viktormalik Jan 16, 2018
07a2206
Abstract domains: project_on_vars: if vars is empty, return whole abs…
viktormalik Feb 12, 2018
ab62de8
Add concept of symbolic paths
viktormalik Feb 12, 2018
8e084da
Heap-interval domain: improve domain combination
viktormalik Feb 12, 2018
3e1e5f3
Heap domain: undo solving in symbolic paths
viktormalik Feb 12, 2018
d6dd980
Add new abstract domain for computing invariants for different symbol…
viktormalik Feb 12, 2018
87a7740
Heap domain: if a row is nondet, clear all pointing rows
viktormalik Feb 12, 2018
35917d0
New tests for heap manipulation
viktormalik Feb 12, 2018
b5b5892
Fix formatting errors
viktormalik Feb 12, 2018
af68bb2
Make map keys non-const
viktormalik Feb 12, 2018
64daeeb
Set "record_malloc" and "record_may_leak" variables to true
viktormalik Feb 26, 2018
5f59a7d
Heap domain: handle incompatible pointer types in get_row_expr
viktormalik Feb 26, 2018
424cf5e
Heap domain: improve transitive row updating
viktormalik Mar 2, 2018
b624ec9
Track allocation sites of dynamic objects in assignmenst and SSA domain
viktormalik Mar 2, 2018
942511d
For dynamic objects allocated in a loop, add allocation guard to post…
viktormalik Mar 2, 2018
5e6503e
Add possibility to use object created in given SSA node at RHS of ass…
viktormalik Mar 2, 2018
66a12ca
Copy pointed info to member expression on symbolic dereference
viktormalik Mar 2, 2018
26684c8
Add new test to heap directory
viktormalik Mar 2, 2018
4af058e
For objects allocated in loops, create one concrete and one abstract …
viktormalik Mar 6, 2018
5859255
Collect allocation guards of concrete/abstract objects and use them i…
viktormalik Mar 6, 2018
7c5cada
Perform some pointer safety checks on concrete objects only
viktormalik Mar 6, 2018
b3eff2a
Heap domain: allow template row to contain a pair of variables as exp…
viktormalik Mar 6, 2018
cf4c5e3
Heap domain: track dependency between __CPROVER_deallocated and other…
viktormalik Mar 6, 2018
5ba86f4
Allow recording free
viktormalik Mar 6, 2018
1a282c0
Do not use pointer access paths in the heap domain
viktormalik Mar 6, 2018
7ade32c
Make unwinder to handle "object-select" guard
viktormalik Mar 6, 2018
8705014
Add tests for memory safety
viktormalik Mar 6, 2018
18b148b
Add another example to heap that uses domain combination
viktormalik Mar 6, 2018
0be684c
Split assignments having the same symbolic dereference object on both…
viktormalik Mar 6, 2018
06e0128
Update process_queue test
viktormalik Mar 6, 2018
0ce8606
Fix bug in splitting assignments having same symbolic deref on both s…
viktormalik Mar 7, 2018
42afc71
Symbolic paths: set loop-select guard to true only if the loop head i…
viktormalik Mar 15, 2018
ebb2d97
Remove dead GOTO instructions
viktormalik Mar 16, 2018
56210f3
Remove dead GOTO instruction only for backwards goto
viktormalik Mar 16, 2018
1fdd369
Better verification of free safety for multiple frees within a loop
viktormalik Mar 20, 2018
d04098e
Create new regression directory with benchmark for SAS 2018 paper
viktormalik Apr 5, 2018
d6428b5
Add combination of heap and zones domain
viktormalik Apr 9, 2018
4cb88ab
Modify SAS 2018 tests to use __VERIFIER_error instead of assert
viktormalik Apr 9, 2018
ff40be0
Add 2 more tests to SAS'18 benchmark
viktormalik Apr 9, 2018
2bfac82
Add new example to SAS'18 benchmark
viktormalik Apr 10, 2018
6524bf1
Add new example to SAS'18 benchmark
viktormalik Apr 10, 2018
4863739
Add combination of heap domain with multiple value domains
viktormalik Apr 10, 2018
99d6003
Update SAS;18 benchmark to use the new --heap-values-incremental switch
viktormalik Apr 10, 2018
0c8a3ab
Analysis of the required number of dynamic object instances
viktormalik May 15, 2018
6b2d154
Add test that reveals an unsoundness in treating of dynamic objects
viktormalik May 15, 2018
4b20b5d
Collect live pointers pointing to a dynamic object at the same time
viktormalik May 16, 2018
67bc0fc
Split dynamic objects into multiple instances based on results of the…
viktormalik May 18, 2018
328499c
rhs_concretisaztion
martinhruska May 18, 2018
df862c9
rhs_concretisaztion
martinhruska May 18, 2018
970b11b
adding case for assert
martinhruska May 18, 2018
f665fb1
Template polyhedra domain: do not generate template rows with 'false'…
viktormalik May 21, 2018
c3ab3f3
Update running example in sas18 directory
viktormalik May 25, 2018
7ae8727
updated running example to make it work
martinhruska May 27, 2018
154bb4c
renamed directory to fmcad
martinhruska May 27, 2018
cf39cd2
problematic version of running example
martinhruska May 27, 2018
0cbf7de
sas18 to fmcad18
martinhruska May 27, 2018
37d74d7
fmcad18 to heap-data
martinhruska May 28, 2018
735e5c4
Comments and refactoring of dynamic objects instances analysis.
viktormalik Jun 28, 2018
16ffaa1
Add missing function comments.
viktormalik Jun 28, 2018
6b67494
Adjust coding style.
viktormalik Jun 28, 2018
b414e3c
Heap-data tests: disable long test and move one from 'heap' directory
viktormalik Jun 28, 2018
14bad7b
Remove debugging output
viktormalik Jun 28, 2018
c75c8d4
Adjust creation of multiple dynamic objects at one allocation site
viktormalik Jun 29, 2018
bc085cd
Add one test to memsafety and disable failing tests.
viktormalik Jun 29, 2018
719684c
Splitting dynamic objects: do not fail on array-typed dynamic objects.
viktormalik Jun 29, 2018
4fe5103
Add memsafety and heap-data to main regression Makefile
viktormalik Jun 29, 2018
dd533c8
Fix bug in creating PHI nodes for dynamic objects in some 'if' branches
viktormalik Jun 29, 2018
54c9a2e
Disable competition mode that kills programs with pointer arithmetic
viktormalik Jun 29, 2018
d70047e
Fix bug in dynobj_instance_analysis.
viktormalik Jul 20, 2018
40facd1
Fix bug in dynobj_instance_analysis.
viktormalik Jul 20, 2018
9572ea2
Adjust code style for latest fix.
viktormalik Jul 20, 2018
c9a7d89
Remove fmcad18 directory, it has already been replaced by heap-data.
viktormalik Jul 20, 2018
c71334c
Remove spurious newlines from some tests in memory categories.
viktormalik Jul 23, 2018
d022890
Fix errors in command line options.
viktormalik Jul 23, 2018
ed80b24
Use has_prefix and CPROVER_PREFIX to check whether a symbol is CPROVE…
viktormalik Jul 23, 2018
556c9c7
Remove debugging output.
viktormalik Jul 26, 2018
9104bda
Rename heap-interval to heap-tpolyhedra including names of all relate…
viktormalik Aug 3, 2018
cbb660c
Refactor combination of heap domain with increasing strength of value…
viktormalik Aug 3, 2018
d938e3e
Code cleanup
viktormalik Aug 3, 2018
215ab5d
Help formatting.
viktormalik Aug 13, 2018
6aa1f00
Merge pull request #120 from viktormalik/master
peterschrammel Aug 13, 2018
e5ee8e7
Update README
peterschrammel Aug 13, 2018
40c0854
Version 0.7
peterschrammel Aug 13, 2018
eaf4581
Merge pull request #122 from diffblue/release-0.7
peterschrammel Aug 14, 2018
23c8d6e
Travis CI: fetch master before running the linter.
viktormalik Sep 7, 2018
fdca164
Refactor tpolyhedra dmoain to use common function for creating row co…
viktormalik Aug 31, 2018
98d08d2
Do not split concrete dynamic objects.
viktormalik Aug 31, 2018
c8c92fe
memsatefy: add 2 more regression tests that now pass.
viktormalik Aug 31, 2018
7a9ee8a
Dynamic object instances: do not include CPROVERsymbols to live varia…
viktormalik Sep 7, 2018
4436b05
Dynamic objects: get rid of allocation guards in templates.
viktormalik Sep 7, 2018
7fb5b48
Regression: add 2 tests to heap running the false tests without k-ind…
viktormalik Sep 14, 2018
515347a
Create fresh symbols for dynamically allocated objects and their fields.
viktormalik Sep 14, 2018
2f72b87
Add message handler to tpolyhedra solver to enable debugging outputs.
viktormalik Sep 14, 2018
d88aef1
tpolyhedra: prevent using pre-value to update itself in symbolic valu…
viktormalik Sep 14, 2018
bdf6b91
Fix missing parentheses in test
peterschrammel Sep 29, 2018
5f5eef5
Merge pull request #126 from diffblue/fix-heap-data-tests
peterschrammel Sep 29, 2018
5dd95a9
Test to expose regression on argument symbols
peterschrammel Sep 30, 2018
df02991
Replace all args by symbols
peterschrammel Sep 30, 2018
ce75e8f
Merge pull request #127 from diffblue/fix-arg-equalities
peterschrammel Oct 4, 2018
16496ff
Dynobj instance analysis: improve detecting malloc-specific variables.
viktormalik Oct 4, 2018
737a5bd
Merge pull request #124 from viktormalik/master
peterschrammel Oct 4, 2018
10412b3
Symderef: do not reuse symbolic deref if some aliased object was assi…
viktormalik Oct 5, 2018
ee865a2
Fix detection of dynamic memory usage in loops.
viktormalik Nov 13, 2018
2eb47e5
Merge pull request #129 from viktormalik/master
peterschrammel Nov 13, 2018
1d75635
heap-zones: do not add difference rows for objects allocated by the s…
viktormalik Nov 16, 2018
9c34d2b
heap-zones: allow adding difference rows for different fields of dynobj
viktormalik Nov 19, 2018
8dde96d
Merge pull request #133 from viktormalik/master
peterschrammel Nov 19, 2018
0af64ba
Update to version 0.7.1
peterschrammel Nov 25, 2018
85b17e5
Added new files & class definition for disjunctive domain
wadkhlemshem Feb 20, 2019
ae7c3e0
Added intialize method
wadkhlemshem Feb 20, 2019
6d05c33
Added join method
wadkhlemshem Feb 20, 2019
94a0644
Added printing to disjunctive domain class
wadkhlemshem Mar 20, 2019
7ac54d5
Added project_on_vars
wadkhlemshem Mar 26, 2019
60dff20
Added base domain pointer
wadkhlemshem May 10, 2019
2e2d68e
Added max no. of disjuncts
wadkhlemshem May 10, 2019
48f8d16
Changed templatet and valuet defs
wadkhlemshem May 10, 2019
4cf5946
Added template kind
wadkhlemshem May 10, 2019
cdae4b4
Added guards and loophead location
wadkhlemshem May 10, 2019
d3a4a75
Added lexigographic metric and tolerance
wadkhlemshem May 10, 2019
b582419
Added merge heuristic
wadkhlemshem May 10, 2019
4ac01bd
Added unresolved and seen edges
wadkhlemshem May 10, 2019
50eecdb
Minor fixes
wadkhlemshem May 10, 2019
5770ab5
Added compilation rule for disjunctive domain
wadkhlemshem May 10, 2019
ee2df9f
Added strategy solver for disjunctive domain class
wadkhlemshem May 10, 2019
f2f66aa
Added get_unresolved_edge
wadkhlemshem May 15, 2019
30e687d
Disjunctive domain: compute post over an edge
wadkhlemshem May 15, 2019
56c89e6
Disjunctive domain: fix zero indexing
wadkhlemshem May 15, 2019
59620e0
Use mp_integer instead of ieee_floatt for merge_heuristic
wadkhlemshem May 16, 2019
ba9ae9f
Use vector of pointers for values to avoid object splicing
wadkhlemshem May 16, 2019
33f27b2
Disjuntive domain: modified printing, initialization, and projection
wadkhlemshem May 16, 2019
ac84b03
Minor edit
wadkhlemshem May 16, 2019
21cbf24
Disjunctive domain : use vector of pointer for template
wadkhlemshem May 16, 2019
55b380a
Minor edits
wadkhlemshem May 16, 2019
4a674af
Added loop body guards for disjunctive domain
wadkhlemshem May 16, 2019
ccac642
Parse options for disjunctive domains
wadkhlemshem May 16, 2019
fd7232c
Addded disjunct limit to parse options
wadkhlemshem May 16, 2019
0615727
Guard collection & checks for disjunctive domains
wadkhlemshem May 16, 2019
6d50321
Added placeholder for get_disjunct_constraint
wadkhlemshem May 16, 2019
618180d
Disjunctive domain: added template generator to strategy solver
wadkhlemshem May 16, 2019
c84be79
Added disjunctive strategy solver to SSA analyzer
wadkhlemshem May 16, 2019
22ded42
Disjunctive domain: add check for presence of loop
wadkhlemshem May 17, 2019
7c683a0
Disjunctive domain: enumerate all paths in the loop
wadkhlemshem May 17, 2019
344a80f
Code refactoring
wadkhlemshem May 17, 2019
013aaf7
Added initial strategy to disjunctive domain solver
wadkhlemshem May 17, 2019
d86a34f
Fixed get_unresolved_edge
wadkhlemshem May 17, 2019
aaaa342
Fixed post computation
wadkhlemshem May 17, 2019
5908939
Disjunctive domain: implemented merge
wadkhlemshem May 17, 2019
adfcefd
Code refactoring
wadkhlemshem May 17, 2019
0eb18fb
Disjunctive domain: added loop
wadkhlemshem May 17, 2019
a3f032b
Renaming for loop copies
wadkhlemshem May 17, 2019
31c41f5
Disjunctive domain: add loophead SSA for new replications
wadkhlemshem May 17, 2019
33a62ad
Disjunctive domain: add loop body after computing post
wadkhlemshem May 17, 2019
b2d8301
printing
wadkhlemshem May 17, 2019
c3811d2
Fixed improvement
wadkhlemshem May 17, 2019
db454a6
Fixed renaming for loopheads
wadkhlemshem May 17, 2019
3550546
Add unresolved edges for new replications
wadkhlemshem May 17, 2019
fa42b7c
Code refactoring
wadkhlemshem May 17, 2019
80a4ebb
Destructor for disjunctive template
wadkhlemshem May 17, 2019
7167440
Code refactoring for rename
wadkhlemshem May 17, 2019
133a49a
Code refactoring and whitespace
wadkhlemshem May 17, 2019
df4aa67
Disjunctive domain solver: add new templates corresponding to each edge
wadkhlemshem May 17, 2019
cda8769
Code refactoring and printing
wadkhlemshem May 17, 2019
dd26132
Minor fix
wadkhlemshem May 17, 2019
782944d
Disjunctive domain solver: add symbolic path to new domain
wadkhlemshem May 17, 2019
bdca590
Variable naming & minor fixes
wadkhlemshem May 17, 2019
76756b6
Added more printing
wadkhlemshem May 17, 2019
1467cb0
Remove loop select & init var
wadkhlemshem May 18, 2019
d68d5d1
Printing
wadkhlemshem May 18, 2019
d0a1dc0
Disjunctive domain solver: send new SSA nodes to solver
wadkhlemshem May 18, 2019
ce10f94
Disjunctive strategy solver: make renaming_map have class wide scope
wadkhlemshem May 21, 2019
993ea7e
Disjunctive domain: add pre constraint & post constraint methods
wadkhlemshem May 21, 2019
3ef5353
Disjunctive strategy solver: add binary search iteration
wadkhlemshem May 21, 2019
02b5eeb
Disjuntive domains: change default limits for testing
wadkhlemshem Aug 28, 2019
727b2a5
Modify post computation
wadkhlemshem Aug 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ matrix:
compiler: clang
env: COMPILER=clang++
- env: NAME="CPP-LINT"
before_script: git fetch origin master:master
script: scripts/run_lint.sh master HEAD

script:
Expand Down
139 changes: 137 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,154 @@
About
=====

2LS is a verification tool for C programs. It is built upon the
2LS ("tools") is a verification tool for C programs. It is built upon the
CPROVER framework ([cprover.org](http://www.cprover.org)), which
supports C89, C99, most of C11 and most compiler extensions provided
by gcc and Visual Studio. It allows verifying array bounds (buffer
overflows), pointer safety, exceptions, user-specified assertions, and
termination properties. The analysis is performed by template-based
predicate synthesis and abstraction refinements techniques.

For more information see [cprover.org](http://www.cprover.org/2LS).

License
=======
4-clause BSD license, see `LICENSE` file.

[build_img]: https://travis-ci.org/diffblue/2ls.svg?branch=master
[travis]: https://travis-ci.org/diffblue/2ls


Overview
========

2LS reduces program analysis problems expressed in second order logic
such as invariant or ranking function inference to synthesis problems
over templates. Hence, it reduces (an existential fragment of) 2nd
order Logic Solving to quantifier elimination in first order logic.

The current tool has following capabilities:

* function-modular interprocedural analysis of C code based on summaries
* summary and invariant inference using generic templates
* combined k-induction and invariant inference
* incremental bounded model checking
* function-modular termination analysis
* non-termination analysis

Releases
========

Download using `git clone http://github.com/diffblue/2ls; cd 2ls; git checkout 2ls-x.y`

* [2LS 0.7](http://github.com/diffblue/2ls/releases/tag/2ls-0.7) (08/2018)
* [2LS 0.6](http://github.com/diffblue/2ls/releases/tag/2ls-0.6) (12/2017)
* [2LS 0.5](http://github.com/diffblue/2ls/releases/tag/2ls-0.5) (01/2017)
* [2LS 0.4](http://github.com/diffblue/2ls/releases/tag/2ls-0.4) (08/2016)
* [2LS 0.3](http://svn.cprover.org/svn/deltacheck/releases/2ls-0.3) (08/2015)
* [2LS 0.2](http://svn.cprover.org/svn/deltacheck/releases/2ls-0.2) (06/2015)
* [2LS 0.1](http://svn.cprover.org/svn/deltacheck/releases/2ls-0.1) (11/2014)

Software Verification Competition Contributions

* [SV-COMP 2018](http://github.com/diffblue/2ls/releases/tag/2ls-0.6) (12/2017)
* [SV-COMP 2017](http://github.com/diffblue/2ls/releases/tag/2ls-0.5-sv-comp-2017) (01/2017)
* [SV-COMP 2016](http://svn.cprover.org/svn/deltacheck/releases/2ls-0.3-sv-comp-2016) (11/2015) [Follow these instructions](http://www.cprover.org/2LS/2ls-sv-comp-2016.pdf)

Installation
============

`cd 2ls; ./install.sh`

Run `src/2ls/2ls`

Command line options
====================

The default abstract domain are intervals. If no options are given a context-insensitive interprocedural analysis is performed. For context-sensitivity, add --context-sensitive.

Other analyses include:

* BMC: --inline --havoc --unwind n
* Incremental BMC: --incremental-bmc
* Incremental k-induction: --havoc --k-induction
* Incremental k-induction and k-invariants (kIkI): --k-induction
* Intraprocedural abstract interpretation with property checks: --inline
* Necessary preconditions: --preconditions
* Sufficient preconditions: --preconditions --sufficient

Currently the following abstract domains are available:

* Intervals (default): --intervals
* Zones: --zones
* Octagons --octagons
* Equalities/disequalities: --equalities
* The abstract domain consisting of the Top element: --havoc

Since release 0.6:

* Heap abstract domain: --heap

Since release 0.7:

* Heap abstract domain with intervals or zones: --heap-[intervals|zones]
* Heap abstract domain with intervals or zones and loop paths: --heap-[intervals|zones] --sympath

Interprocedural Termination Analysis
====================================

Is supported by release 0.1 and >=0.3.

* Universal termination: --termination
* Context-sensitive universal termination: --termination --context-sensitive
* Sufficient preconditions for termination --termination --context-sensitive --preconditions

Since release 0.6:

* Nontermination analysis: --non-termination

Features in development
=======================

* ACDL solver (ATVA'17 [Lifting CDCL to Template-Based Abstract Domains for Program Verification](https://doi.org/10.1007/978-3-319-68167-2_2))
* array domain
* disjunctive domains
* custom template specifications
* modular refinement
* template refinement
* thread-modular analysis

Publications
============

* FMCAD'18 Template-Based Verification of Heap-Manipulating Programs
* TACAS'18 [2LS: Memory Safety and Non-Termination](https://link.springer.com/chapter/10.1007%2F978-3-319-89963-3_24)
* TOPLAS 40(1) 2018 [Bit-Precise Procedure-Modular Termination Analysis](https://dl.acm.org/citation.cfm?doid=3121136)
* ATVA'17 [Compositional Refutation Techniques](https://link.springer.com/chapter/10.1007%2F978-3-319-68167-2_12)
* ATVA'17 [Lifting CDCL to Template-Based Abstract Domains for Program Verification](https://doi.org/10.1007/978-3-319-68167-2_2)
* TACAS'16 [2LS for Program Analysis](http://dl.acm.org/citation.cfm?id=2945506)
* SAS'15 [Safety Verification and Refutation by k-Invariants and k-Induction](http://link.springer.com/chapter/10.1007%2F978-3-662-48288-9_9)
* ASE'15 [Synthesising Interprocedural Bit-Precise Termination Proofs](http://dl.acm.org/citation.cfm?id=2916211) [Experimental log](http://www.cs.ox.ac.uk/people/peter.schrammel/2ls/ase15-experimental_results_log.txt) [Additional material](http://www.cs.ox.ac.uk/people/peter.schrammel/2ls/ase15-additional-material.tgz) [Website](http://www.cprover.org/termination/modular)

Contributors
============

* Björn Wachter
* Cristina David
* Daniel Kroening
* Hongyi Chen
* Madhukar Kumar
* Martin Brain
* Martin Hruska
* Peter Schrammel
* Rajdeep Mukherjee
* Samuel Bücheli
* Saurabh Joshi
* Stefan Marticek
* Viktor Malik

Contact
=======

[Peter Schrammel](http://www.schrammel.it)


13 changes: 11 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

CBMC_REPO=https://github.com/peterschrammel/cbmc
CBMC_VERSION=d95e7da28018fd315b04a1201d5b7cfe8195cbc6
CBMC_VERSION=2ls-prerequisites-0.7

if [ "$1" != "" ]
then
Expand All @@ -12,7 +12,16 @@ git clone $CBMC_REPO
cd cbmc
CBMC=`pwd`
git checkout $CBMC_VERSION
make -C src minisat2-download
if grep '^MINISAT2' src/config.inc > /dev/null
then
make -C src minisat2-download > /dev/null
elif grep '^GLUCOSE' src/config.inc
then
make -C src glucose-download
else
echo "SAT solver not supported"
exit 1
fi
if [ "$COMPILER" != "" ]
then
make -C src CXX=$COMPILER
Expand Down
12 changes: 10 additions & 2 deletions regression/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
DIRS = termination kiki preconditions interprocedural invariants
DIRS = nontermination \
termination \
kiki \
preconditions \
interprocedural \
invariants \
heap \
heap-data \
memsafety

test:
$(foreach var,$(DIRS), make -C $(var) test;)
$(foreach var,$(DIRS), make -C $(var) test || exit 1;)

clean:
$(foreach var,$(DIRS), make -C $(var) clean;)
2 changes: 1 addition & 1 deletion regression/graphml/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#FLAGS = --k-induction --competition-mode --32
FLAGS = --unwind 11 --no-unwinding-assertions
#2LS = ../../../src/summarizer/2ls
#2LS = ../../../src/summarizer/2ls
2LS = $W/svncprover/branches/peter-incremental-unwinding/src/cbmc/cbmc
CPACHECKER = $W/svncpachecker
ULTIMATE = $W/UltimateAutomizer
Expand Down
4 changes: 2 additions & 2 deletions regression/graphml/loop23/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ int main()
int y;
if(x) { return x;}

for(x=0;x<2;x++)
for(x=0;x<2;x++)
{
if(x==y) { return x;}

}
__VERIFIER_assert(0);
return 0;
Expand Down
6 changes: 3 additions & 3 deletions regression/graphml/loop29/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ void main() {
int y;
if(-3>y || y>-1) return;
x += y;
}
__VERIFIER_assert(x==0 || x==-2);
}
}
__VERIFIER_assert(x==0 || x==-2);
}
8 changes: 4 additions & 4 deletions regression/graphml/malloc1/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ int ssl3_connect(SSL *s )

{
blastFlag = 0;
s->state = 12292;
s->state = 12292;
while (1) {
if (s->state == 12292) {
goto switch_1_12292;
Expand All @@ -1047,15 +1047,15 @@ int ssl3_connect(SSL *s )
switch_1_4368: ;
if (blastFlag == 0) {
blastFlag = 1;
}
}
s->state = 4384;
goto switch_1_break;
switch_1_4384: ;
if (blastFlag == 1) {
blastFlag = 2;
goto ERROR;
}
}

goto end;
switch_1_default:
goto end;
Expand Down
20 changes: 20 additions & 0 deletions regression/heap-data/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
default: tests.log

FLAGS = --verbosity 10

test:
@../test.pl -p -c "../../../src/2ls/2ls $(FLAGS)"

tests.log: ../test.pl
@../test.pl -p -c "../../../src/2ls/2ls $(FLAGS)"

show:
@for dir in *; do \
if [ -d "$$dir" ]; then \
vim -o "$$dir/*.c" "$$dir/*.out"; \
fi; \
done;

clean:
@rm -f *.log
@for dir in *; do rm -f $$dir/*.out; done;
40 changes: 40 additions & 0 deletions regression/heap-data/calendar/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
extern int __VERIFIER_nondet_int();
extern void __VERIFIER_error() __attribute__ ((__noreturn__));

#include <stdlib.h>

#define APPEND(l,i) {i->next=l; l=i;}

typedef struct node {
struct node *next;
int event1;
int event2;
} Node;

int main() {
Node *l = NULL;

while (__VERIFIER_nondet_int()) {
int ev1 = __VERIFIER_nondet_int();
int ev2 = __VERIFIER_nondet_int();
if (ev1 < 0 || ev1 > 3 || ev2 < 0 || ev2 > 3)
continue;

if (((ev1 == 0) && (ev2 == 2)) || ((ev1 == 1) && (ev2 == 3)) || ((ev1 == 0) && (ev2 == 3)))
continue;

Node *p = malloc(sizeof(*p));
p->event1 = ev1;
p->event2 = ev2;
APPEND(l,p)
}

Node *i = l;

while (i != NULL) {
if (((i->event1 == 1) && (i->event2 == 3)) || ((i->event1 == 0) && (i->event2 == 2)))
__VERIFIER_error();
i = i->next;
}
}

6 changes: 6 additions & 0 deletions regression/heap-data/calendar/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CORE
main.c
--heap-values-refine --sympath --inline
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
46 changes: 46 additions & 0 deletions regression/heap-data/cart/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
extern int __VERIFIER_nondet_int();
extern void __VERIFIER_error() __attribute__ ((__noreturn__));

#include <stdlib.h>

#define APPEND(l,i) {i->next=l; l=i;}

typedef struct node {
struct node *next;
int stock;
int order;
} Node;

int main() {
Node *l = NULL;

while (__VERIFIER_nondet_int()) {
int stock = __VERIFIER_nondet_int();
if (stock < 0)
continue;

Node *p = malloc(sizeof(*p));
p->stock = stock;
p->order = 0;
APPEND(l,p)
}

Node *i = l;
while (i != NULL) {
int order = __VERIFIER_nondet_int();
if (order < 0 || i->stock < order)
continue;
i->order = order;
i->stock = i->stock;
i = i->next;
}


i = l;
while (i != NULL) {
if (i->order > i->stock)
__VERIFIER_error();
i = i->next;
}
}

6 changes: 6 additions & 0 deletions regression/heap-data/cart/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CORE
main.c
--heap-values-refine --sympath --inline
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Loading