Commit Graph

20554 Commits

Author SHA1 Message Date
Lukasz A.J. Wrona 519a802a1e Add Visual Studio/CMake Codebuild config 2019-10-17 16:21:36 +01:00
Lukasz A.J. Wrona 9cf5be3ee6 Add ansi-c/converter_input.txt to .gitignore 2019-10-17 16:20:59 +01:00
Lukasz A.J. Wrona 77076056e6 Generate ansi_c_library_sources file in a cross platform way 2019-10-16 14:34:06 +01:00
Lukasz A.J. Wrona ecce25fbc8 Display an error in case Git wasn't found
It's probably safe to assume (since the project relies on submodules) that the user has git installed, so this will stop configuration rather than display a warning and then stop with a confusing error.
2019-10-14 15:10:00 +01:00
Lukasz A.J. Wrona f0887bc199 Use git bash when configuring CMake
This way you don't have to use Cygwin on Windows to configure cbmc with CMake and allows you to use Windows's native CMake support (assuming git is installed).
2019-10-14 15:10:00 +01:00
Lukasz A.J. Wrona 7949cac5f7 Add project(CBMC) to CMakeLists
Suppresses a "missing project" warning. Each CBMC project should have a project tag.
2019-10-14 15:10:00 +01:00
Daniel Kroening e7fc79a4c8
Merge pull request #5158 from diffblue/smt2_function_scoping_test
SMT-LIB2 parameter/let/quantifier scopes
2019-10-13 14:51:37 +01:00
Daniel Kroening 835af93ff2
Merge pull request #5160 from diffblue/let_with_multiple_bindings
Let with multiple bindings
2019-10-13 14:50:47 +01:00
Daniel Kroening cd0d0f6c95 smt2 parser: use let with multiple bindings
This avoids deeply recursive expressions.
2019-10-11 19:52:57 +01:00
Daniel Kroening 1872c07d29 smt2 backend: support let with multiple bindings
This avoids deeply recursive expressions.
2019-10-11 19:52:57 +01:00
Daniel Kroening f8cfad349b solver: support let with multiple bindings
This avoids deeply recursive expressions.
2019-10-11 19:52:57 +01:00
Daniel Poetzl afac9c7224
Merge pull request #5122 from danpoe/feature/append-object-constant-evaluation-tests
Tests for constant propagation of append(Object)
2019-10-11 14:06:04 +01:00
Daniel Poetzl 9f818162cb
Merge pull request #5114 from danpoe/feature/string-builder-append
Tests for constant propagation of StringBuilder.append()
2019-10-11 14:05:52 +01:00
Daniel Kroening 31cd424770
Merge pull request #4992 from diffblue/let-is-a-binding
let_exprt can now do multiple bindings
2019-10-10 14:08:02 +01:00
antlechner 093e97c40a
Merge pull request #5157 from antlechner/antonia/no_empty_module_symbols_in_module_map
[TG-9830] [UFC] Exclude symbols with empty module from the symbol module map
2019-10-09 18:38:57 +01:00
thomasspriggs e1e7a74454
Merge pull request #5156 from thomasspriggs/tas/lazy_initialize
Support for an external lazy methods driver to control when the `INITIALIZE_FUNCTION` is generated
2019-10-09 16:20:14 +01:00
Daniel Kroening 6eabb66742 fix for SMT-LIB2 scopes for function definitions and let
SMT-LIB2 function definitions have scopes for the identifiers of the
parameters.  The same holds for let expressions.

This was raised in #5143.

The need to make the scoped identifiers unique will be removed once the IR
bindings have scopes.
2019-10-09 14:51:04 +01:00
Antonia Lechner 4718929976 Add unit tests for inserting symbols with (non-)empty modules 2019-10-09 14:49:39 +01:00
Antonia Lechner 639d4ed6cd Remove unnecessary reset instructions
For each WHEN, the outer GIVEN is going to be re-run, re-initializing
the symbol table, so there is no need to reset the symbols.
2019-10-09 14:49:39 +01:00
Antonia Lechner 2aa3a2e62f Document symbol table map-typed fields 2019-10-09 14:49:39 +01:00
Antonia Lechner e7dec3bfb2 Use auto for iterators
This makes the code more readable, and the type is still clear as we are
just calling lower_bound and upper_bound on a multimap.
2019-10-09 14:49:39 +01:00
Antonia Lechner 9d3246f7da Use local symbol variable where possible
No functional change
2019-10-09 14:49:39 +01:00
Thomas Spriggs 9764ba6a6a Exclude symbols with empty module from the module map
For languages such as Java, where the `module` field of `symbolt` is
kept empty, maintaining the `internal_symbol_module_map` of the symbol
table can cause a performance bottleneck. This is because all symbols
end up mapped to the same key in this map. So when
`symbol_tablet::erase` attempts to remove a symbol from this map the
lookup results in a range containing the entire collection of symbols on
which it then performs a linear search to find the exact symbol to
remove.

Languages which don't set the `module` field never need to do any
lookups in the module map. The downstream EBMC repository always uses a
non-empty module to do its lookups. Therefore we can leave symbols with
an empty module out of the module map. This results in a performance
improvement for Java, whilst retaining EBMC compatibilty.

The performance improvement was confirmed using a subset of 231 methods
from Tika, which succeeded both with and without the fix and were
overall 216 seconds faster with the fix. With rt.jar on the classpath
(but no class from rt.jar being referenced anywhere), the time for a
trivial method went from around 40 seconds to 6 seconds.
2019-10-09 14:49:39 +01:00
Thomas Spriggs 082b368ae6 Restructure TEST_CASEs as SCENARIOs
To describe what the tests are doing.
2019-10-09 13:54:39 +01:00
Thomas Spriggs cd75f9fa50 Update comment 2019-10-09 13:42:51 +01:00
Thomas Spriggs 398968983c Add unit tests of lazy `cprover_initialize` generation
This tests that an empty bodied initialize function is generated by
`typecheck` and that the body is then populated by `convert_lazy_method`
2019-10-09 10:41:31 +01:00
Daniel Kroening db4c76b208
Merge pull request #5143 from diffblue/smt2_parser_table
SMT2 parser: use hash tables instead of if() ... else...
2019-10-08 17:53:27 +01:00
JohnDumbell 357c1b10ce
Merge pull request #5129 from JohnDumbell/jd/feature/constant_string_functions
Constant propagate string-solver function results
2019-10-08 15:44:50 +01:00
Daniel Poetzl c4045310d5
Merge pull request #5155 from danpoe/feature/constant-propagation-of-setlength-and-setcharat
Tests for constant propagation of setLength() and setCharAt()
2019-10-08 14:37:34 +01:00
Thomas Spriggs e53acb9652 Generate `INITIALIZE_FUNCTION` from `convert_single_method`
This allows for an external lazy methods driver to control when the
`INITIALIZE_FUNCTION` is generated.
2019-10-08 14:16:57 +01:00
Daniel Poetzl b44fd4109e Adapt existing StringBuilder tests
Activate two tests marked FUTURE that can meanwhile be solved by the string
solver. Also adapt tests so they cannot be solved via constant propagation, and
load the models library.
2019-10-08 13:28:31 +01:00
Daniel Poetzl a543b91cee Adapt existing StringBuilder.setCharAt() test
Load models and adapt test so it cannot be solved via constant propagation.
2019-10-08 11:36:42 +01:00
Daniel Poetzl 236d453a48 Add tests for StringBuilder.setLength() 2019-10-08 10:46:49 +01:00
Daniel Poetzl df459cf73a Remove StringBuilder.setLength() entry from the string preprocessing table
Preprocessing is unnecessary now as we have a model for setLength() that uses
CProverString.setLength().
2019-10-08 10:46:49 +01:00
Daniel Poetzl c8fdfe7849 Add tests for StringBuilder.setCharAt() 2019-10-08 10:46:49 +01:00
Daniel Poetzl 8a6b6fefdf Remove StringBuilder.setCharAt() entry from the string preprocessing table
Preprocessing is unnecessary now as we have a model for setCharAt() that uses
CProverString.setCharAt().
2019-10-08 10:46:49 +01:00
Daniel Poetzl a3df7aaba3 Add tests for StringBuffer.setLength() 2019-10-08 10:46:49 +01:00
Daniel Poetzl 47eb35ff7e Add tests for StringBuffer.setCharAt() 2019-10-08 10:46:49 +01:00
Daniel Poetzl 3f7a75032a Bump java-models-library 2019-10-08 10:46:49 +01:00
Daniel Kroening a8aa594935 smt2_parser: expressions/functions are now in hash table
This refactors the SMT2 parser to use hash tables instead of chains of
if()...else if()...  for expressions.

This enables extensions, and may have a performance benefit as the number of
expressions grows.
2019-10-08 08:25:26 +01:00
Daniel Kroening ac3701871d smt2_parser: sorts are now in a hash table
This refactors the SMT2 parser to use hash tables instead of chains of
if()...else if()...  for sorts.

This enables extensions, and may have a performance benefit as the number of
sorts grows.
2019-10-08 08:25:26 +01:00
Daniel Kroening 313e40429a smt2_parser: introduce table of commands
This refactors the SMT2 parser to use hash tables instead of chains of
if()...else if()...  for commands.

This enables extensions, and may have a performance benefit as the number of
commands grows.
2019-10-08 08:25:16 +01:00
johndumbell db1f844883 Add String.equalsIgnoreCase() 2019-10-07 17:21:56 +01:00
johndumbell 79882c6063 Add String.replace(...) 2019-10-07 17:21:56 +01:00
johndumbell 9e1f258110 Add String.lastIndexOf(...) 2019-10-07 17:21:56 +01:00
johndumbell b9b3fea07d Add String.toLowerCase() / String.toUpperCase() 2019-10-07 17:21:56 +01:00
johndumbell 030d6a32ef Add String.contains(...) 2019-10-07 17:21:56 +01:00
johndumbell f27e28cc4c Add String.trim() 2019-10-07 17:21:56 +01:00
Peter Schrammel 00c7e3d836
Merge pull request #5133 from peterschrammel/json-interface-validation
Do not ignore invalid command line options in JSON/XML interface [TG-9049]
2019-10-07 11:47:05 +01:00
Chris Smowton aca06bd9e9
Merge pull request #5144 from smowton/smowton/feature/java-record-getstatic-source-locations
Java frontend: record source locations of read static variables
2019-10-05 21:12:04 +01:00