Skip to content

Incremental BMC for CEGIS #416

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
429adec
goto-instrument --remove-function-body
tautschnig Apr 10, 2017
ab78f8d
allow direct accesses into arrays despite signedness mismatch
Apr 9, 2017
e9fc7a3
first stab at instrumenting memory-mapped I/O
Apr 9, 2017
9791d28
Do not configure bmct/prop_convt before reading goto programs
tautschnig May 24, 2017
d9d4c0a
restore do_bmc interface, for the benefit of cegis and hw-cbmc; parti…
May 25, 2017
625b348
the c_types now have stronger C++ types
May 25, 2017
299e494
Message handlers maintain counters of messages per level
tautschnig Jul 7, 2016
3512cbc
Support flush at eom to ensure complete output
tautschnig Jul 7, 2016
c27a209
Removed legacy_typecheckt interface, use new message counters
tautschnig Jul 7, 2016
d816886
Make goto-cc fail when warnings are emitted and -Werror and -Wextra a…
tautschnig Jul 7, 2016
7312781
Pass message handler on to compilet
tautschnig Apr 28, 2017
aea33d5
get-gcc-builtins: only dump declarations not found in existing files
tautschnig Apr 26, 2017
421cc8a
Split generic GCC built-ins, extend using current GCC trunk
tautschnig Apr 26, 2017
be6860b
builtin-headers-ia32: remove space before '*'
tautschnig Apr 27, 2017
09af83f
Updates to ia32 headers by get-gcc-builtins.sh
tautschnig Apr 27, 2017
49b0124
Added further ia32 GCC built-ins
tautschnig Apr 27, 2017
cc2d100
Added destination/source overlap checks to C string library
tautschnig Apr 10, 2017
973ff38
Added __CPROVER_array_replace to complement __CPROVER_array_set
tautschnig Apr 10, 2017
945250a
Use array_{copy,replace,set} in C library to avoid loops
tautschnig Apr 10, 2017
edd002d
added memcpy_chk implementation
tautschnig Apr 12, 2017
0f40d2c
Do not inline functions using arrays of symbolic size
tautschnig Apr 24, 2017
7d12539
Fix and extend byte extract flattening
tautschnig May 19, 2017
abc5a93
Do not use ID_pointer_offset directly, use pointer_offset() from poin…
tautschnig May 25, 2017
fb2155a
Dereferencing to void induces 0 read bytes
tautschnig May 25, 2017
8beb023
Inside newlib, __assert_func takes a non-const argument
tautschnig Jun 28, 2016
e224481
Ensure type consistency in scanf("%s", ...)
tautschnig Aug 1, 2016
1115dbe
Update initializer and expression types after linking
tautschnig Apr 18, 2017
2e4761c
Rework and fix parsing of unicode strings
tautschnig May 31, 2017
cb60d8b
Add conversion/checking scripts
reuk Apr 25, 2017
40fc7df
Update script based on review feedback
reuk May 1, 2017
66f7a77
Add legalese handling to conversion script
reuk May 12, 2017
4536071
Move conversion scripts to scripts folder
reuk May 12, 2017
4dd2f6e
Fix up linter script to accept new Copyright label
reuk May 12, 2017
cdaf12d
Revert "Fix up linter script to accept new Copyright label"
reuk Jun 6, 2017
0243754
Allow python script to reformat in place
reuk May 12, 2017
493cee1
Fix parameter list bug
reuk May 16, 2017
8527fb5
Update postprocessor comparison script
reuk May 30, 2017
0f956c6
Modify reformatting script to retain existing headers
reuk Jun 6, 2017
5a8c739
Reformat src
reuk Jun 6, 2017
2c0a697
Incremental BMC
Sep 16, 2016
6b30f8c
Check dependencies between commandline options for incremental
peterschrammel Jan 10, 2017
819b129
Fix for Clang's initialization warning
peterschrammel Jan 10, 2017
783db62
linter fixes: white space, assert and reformatting
polgreen May 25, 2017
8f4e45f
align type safety_checkert and message_handlert with cbmc master
polgreen May 25, 2017
b1df152
incremental BMC changes merged in
polgreen May 25, 2017
00c9df9
rearrange includes
polgreen May 25, 2017
4c5c503
fix regression tests
polgreen May 25, 2017
269acea
magic numbers comment
polgreen May 25, 2017
8761a86
fix based on linter output
polgreen May 26, 2017
b7b5fdf
fix compile errors caused by merge
polgreen May 31, 2017
db17769
move try-catch statement
polgreen May 31, 2017
6b6d3eb
Fix coverage error for incremental mode
polgreen Jun 13, 2017
d6fca94
formatting for linter
polgreen Jun 14, 2017
4134a15
fix regression test syntax
polgreen Jun 13, 2017
6f7070c
remove merge mistakes
polgreen Jun 22, 2017
59d6559
use failed tests printer
polgreen Jun 22, 2017
e7d1fe2
use incremental mode in incremental regression tests
polgreen Jun 22, 2017
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 regression/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ DIRS = ansi-c \
goto-analyzer \
goto-instrument \
goto-instrument-typedef \
cbmc-incr-oneloop \
cbmc-incr \
cbmc-with-incr \
test-script \
# Empty last line

Expand All @@ -19,3 +22,4 @@ clean:
$(MAKE) -C "$$dir" clean; \
fi; \
done;

2 changes: 1 addition & 1 deletion regression/array-refinement-with-incr/Array_UF9/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ unsigned int SIZE;
int linear_search(int *a, int n, int q) {
unsigned int j=0;
while (j<n && a[j]!=q) {
j;
j++;
if (j==20) j=-1;
}
if (j<SIZE) return 1;
Expand Down
11 changes: 8 additions & 3 deletions regression/cbmc-incr-oneloop/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
default: tests.log

test:
@../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc --slice-formula"
@if ! ../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc --slice-formula" ; then \
../failed-tests-printer.pl ; \
exit 1 ; \
fi

tests.log: ../test.pl
@../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc --slice-formula"

@if ! ../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc --slice-formula" ; then \
../failed-tests-printer.pl ; \
exit 1 ; \
fi
show:
@for dir in *; do \
if [ -d "$$dir" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-incr-oneloop/unwind-forever1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
THOROUGH
main.c
--incremental-check main.0
^EXIT=142$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-incr-oneloop/unwind-forever2/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
THOROUGH
main.c
--incremental-check main.0
^EXIT=142$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--unwind-max 10 --incremental-check main.0
--unwind-max 10 --incremental-check main.0 --unwinding-assertions
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
Expand Down
10 changes: 7 additions & 3 deletions regression/cbmc-incr/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
default: tests.log

PARAM = --incremental --magic-numbers
PARAM = --incremental
# --refine --slice-formula

test:
@../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc $(PARAM)"
@if ! ../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc --incremental" ; then \
../failed-tests-printer.pl ; \
exit 1 ; \
fi

tests.log: ../test.pl
@../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc $(PARAM)"
@if ! ../test.pl -c "perl -e 'alarm shift @ARGV; exec @ARGV' 30 ../../../src/cbmc/cbmc --incremental" ; then \
../failed-tests-printer.pl ; \

show:
@for dir in *; do \
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-incr/unwinding-assertion1/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--unwind-max 10
--unwind-max 10 --unwinding-assertions
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Free1/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--pointer-check
--pointer-check --stop-on-fail
^EXIT=10$
^SIGNAL=0$
^Counterexample:$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Free2/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--pointer-check
--pointer-check --stop-on-fail
^EXIT=10$
^SIGNAL=0$
^Counterexample:$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Free3/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--pointer-check
--pointer-check --stop-on-fail
^SIGNAL=0$
^Counterexample:$
^VERIFICATION FAILED$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Free4/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--pointer-check
--pointer-check --stop-on-fail
^SIGNAL=0$
^Counterexample:$
^VERIFICATION FAILED$
Expand Down
4 changes: 2 additions & 2 deletions regression/cbmc-with-incr/Function5/test.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CORE
main.c
--pointer-check --bounds-check
--pointer-check --bounds-check --stop-on-fail
^SIGNAL=0$
^EXIT=10$
^Counterexample:$
^ dereference failure: object bounds in .*$
^ dereference failure: pointer outside object bounds in .*$
^VERIFICATION FAILED$
--
^warning: ignoring
4 changes: 2 additions & 2 deletions regression/cbmc-with-incr/Multi_Dimensional_Array6/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ main.c
--unwind-max 3 --no-unwinding-assertions --all-properties
^EXIT=10$
^SIGNAL=0$
^\[main\.assertion\.1\] assertion matriz\[\(signed long int\)j\]\[\(signed long int\)k\] <= maior: OK$
^\[main\.assertion\.2\] assertion matriz\[\(signed long int\)0\]\[\(signed long int\)0\] < maior: FAILED$

^\[main\.assertion\.2\] assertion matriz\[\(signed long int\)0\]\[\(signed long int\)0\] \< maior: FAILURE$
^\*\* 1 of 2 failed \(2 iterations\)$
--
^warning: ignoring
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Overflow_Addition1/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--signed-overflow-check
--signed-overflow-check --stop-on-fail
^SIGNAL=0$
^Counterexample:$
^VERIFICATION FAILED$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Pointer_Arithmetic5/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--pointer-check --bounds-check --function f
--pointer-check --bounds-check --function f --stop-on-fail
^SIGNAL=0$
^Counterexample:$
^VERIFICATION FAILED$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Pointer_Arithmetic8/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--pointer-check --bounds-check
--pointer-check --bounds-check --stop-on-fail
^SIGNAL=0$
^Counterexample:$
^VERIFICATION FAILED$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Pointer_byte_extract2/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ main.c
--all-properties --little-endian
^EXIT=10$
^SIGNAL=0$
^\[main\.assertion\.2\] .*: FAILED$
^\[main\.assertion\.2\] .*: FAILURE$
^\*\* 1 of 2 failed \(2 iterations\)$
--
^warning: ignoring
4 changes: 2 additions & 2 deletions regression/cbmc-with-incr/Pointer_byte_extract5/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ main.c
--all-properties --bounds-check --32
^EXIT=10$
^SIGNAL=0$
^\[main\.array_bounds\.5\] array.List upper bound in .*: FAILED$
^\*\* 1 of 9 failed \(2 iterations\)$
array\.List dynamic object upper bound in p->List\[2\]: FAILURE
\*\* 1 of 11 failed \(2 iterations\)
--
^warning: ignoring
4 changes: 2 additions & 2 deletions regression/cbmc-with-incr/Pointer_byte_extract8/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ main.c
--all-properties --bounds-check --32 --no-simplify
^EXIT=0$
^SIGNAL=0$
^\[main\.array_bounds\.5\] array.List upper bound: FAILED$
^\*\* 1 of 9 failed \(2 iterations\)$
^\[main\.array_bounds\.5\] array.List upper bound: FAILURE$
^\*\* 1 of 9 failed (2 iterations)$
--
^warning: ignoring
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/String2/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--pointer-check --bounds-check
--pointer-check --bounds-check --stop-on-fail
^EXIT=10$
^SIGNAL=0$
^Counterexample:$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/Undefined_Function1/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c

--stop-on-fail
^SIGNAL=0$
^\*\*\*\* WARNING: no body for function f$
^Counterexample:$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-with-incr/pipe1/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ main.c
--all-properties
^EXIT=10$
^SIGNAL=0$
^\[main\.assertion\.4\] assertion data\[1\]==31: FAILED$
^\[main\.assertion\.4\] assertion data\[1\]==31: FAILURE$
^\*\* 1 of 5 failed \(2 iterations\)$
--
^warning: ignoring
13 changes: 3 additions & 10 deletions scripts/reformat_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ def is_block_valid(self, block):
def convert_sections(self, block):
return [self.format_module(block)]

def needs_new_header(self, file_contents):
return (re.search(r'^\/\/\/ \\file$', file_contents, flags=re.MULTILINE)
is None)


class FunctionFormatter(GenericFormatter):
def __init__(self, doc_width):
Expand Down Expand Up @@ -192,7 +188,6 @@ def convert_sections(self, block):

def replace_block(
block_contents,
file_contents,
file,
header_formatter,
class_formatter,
Expand All @@ -204,10 +199,9 @@ def replace_block(
{f.name: f.contents for f in parse_fields(block_contents.group(1))})

if header_formatter.is_block_valid(block):
converted = header_formatter.convert(header_from_block(block))
if header_formatter.needs_new_header(file_contents) and converted:
return block_contents.group(0) + converted + '\n'
return block_contents.group(0)
return '%s%s\n' % (
block_contents.group(0),
header_formatter.convert(header_from_block(block)))

if class_formatter.is_block_valid(block):
return class_formatter.convert(class_from_block(block))
Expand Down Expand Up @@ -237,7 +231,6 @@ def convert_file(file, inplace):
new_contents = block_re.sub(
lambda match: replace_block(
match,
contents,
file,
header_formatter,
class_formatter,
Expand Down
1 change: 0 additions & 1 deletion src/ansi-c/expr2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3166,7 +3166,6 @@ std::string expr2ct::convert_code_array_replace(
unsigned indent)
{
std::string dest=indent_str(indent)+"ARRAY_REPLACE(";

forall_operands(it, src)
{
unsigned p;
Expand Down
16 changes: 1 addition & 15 deletions src/ansi-c/get-gcc-builtins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ cat > gcc-builtins.h <<EOF
#include <unistd.h>
#include <stdio.h>
#include <wctype.h>

typedef char __gcc_v8qi __attribute__ ((__vector_size__ (8)));
typedef char __gcc_v16qi __attribute__ ((__vector_size__ (16)));
typedef char __gcc_v32qi __attribute__ ((__vector_size__ (32)));
Expand All @@ -50,7 +49,6 @@ typedef long long __gcc_v2di __attribute__ ((__vector_size__ (16)));
typedef long long __gcc_v4di __attribute__ ((__vector_size__ (32)));
typedef long long __gcc_v8di __attribute__ ((__vector_size__ (64)));
typedef unsigned long long __gcc_di;

EOF

cat > builtins.h <<EOF
Expand Down Expand Up @@ -98,17 +96,14 @@ cat > builtins.h <<EOF
#define short_unsigned_type_node unsigned short
#define short_integer_type_node short
#define unsigned_char_type_node unsigned char

// some newer versions of GCC apparently support __floatXYZ
#define dfloat32_type_node __float32
#define dfloat64_type_node __float64
#define dfloat128_type_node __float128

#define build_qualified_type(t, q) q t
#define build_pointer_type(t) t*
#define TYPE_QUAL_VOLATILE volatile
#define TYPE_QUAL_CONST const

#define DEF_PRIMITIVE_TYPE(ENUM, TYPE) \
NEXTDEF ENUM TYPE
#define DEF_FUNCTION_TYPE_0(ENUM, RETURN) \
Expand All @@ -135,7 +130,6 @@ NEXTDEF ENUM(name) RETURN name(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, A
NEXTDEF ENUM(name) RETURN name(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, ARG10)
#define DEF_FUNCTION_TYPE_11(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, ARG10, ARG11) \
NEXTDEF ENUM(name) RETURN name(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9, ARG10, ARG11)

#define DEF_FUNCTION_TYPE_VAR_0(ENUM, RETURN) \
NEXTDEF ENUM(name) RETURN name()
#define DEF_FUNCTION_TYPE_VAR_1(ENUM, RETURN, ARG1) \
Expand All @@ -152,21 +146,15 @@ NEXTDEF ENUM(name) RETURN name(ARG1, ARG2, ARG3, ARG4, ARG5, ...)
NEXTDEF ENUM(name) RETURN name(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ...)
#define DEF_FUNCTION_TYPE_VAR_7(ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
NEXTDEF ENUM(name) RETURN name(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ...)

#define DEF_POINTER_TYPE(ENUM, TYPE) \
NEXTDEF ENUM TYPE*

#define DEF_POINTER_TYPE_CONST(ENUM, TYPE, C) \
NEXTDEF ENUM const TYPE*

#include "builtin-types.def"

NEXTDEF DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, \
FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT, COND) \
TYPE(MANGLE(NAME));

#include "i386-builtin-types-expanded.def"

NEXTDEF BDESC(mask, icode, name, code, comparison, flag) \
flag(MANGLEi386(name));
NEXTDEF BDESC_FIRST(kind, KIND, mask, icode, name, code, comparison, flag) \
Expand All @@ -176,12 +164,10 @@ EOF
grep '^DEF_VECTOR_TYPE' i386-builtin-types.def | \
awk -F '[,() \t]' '{ print "#define " $3 " __gcc_" tolower($3) }' \
> i386-builtin-types-expanded.def

grep -v '^DEF_FUNCTION_TYPE[[:space:]]' i386-builtin-types.def | \
grep '^DEF_P' | \
sed '/^DEF_POINTER_TYPE[^,]*, [^,]*, [^,]*$/ s/_TYPE/_TYPE_CONST/' \
>> i386-builtin-types-expanded.def

cat i386-builtin-types.def | \
sed '/^DEF_FUNCTION_TYPE[[:space:]]/! s/.*//' | \
sed 's/^DEF_FUNCTION_TYPE[[:space:]]*(\([^,]*\))/\1_FTYPE_VOID/' | \
Expand Down Expand Up @@ -272,4 +258,4 @@ cat gcc-builtins.h | sed 's/__builtin/XX__builtin/' | \
gcc -D__CPROVER_size_t=size_t -c -fno-builtin -x c - -o gcc-builtins.o
rm gcc-builtins.o

echo "Successfully built gcc-builtins.h"
echo "Successfully built gcc-builtins.h"
4 changes: 4 additions & 0 deletions src/cbmc/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
SRC = all_properties.cpp \
bmc.cpp \
bmc_cover.cpp \
bmc_incremental.cpp \
bmc_incremental_one_loop.cpp \
bv_cbmc.cpp \
cbmc_dimacs.cpp \
cbmc_languages.cpp \
Expand All @@ -11,6 +13,8 @@ SRC = all_properties.cpp \
fault_localization.cpp \
show_vcc.cpp \
symex_bmc.cpp \
symex_bmc_incremental.cpp \
symex_bmc_incremental_one_loop.cpp \
symex_coverage.cpp \
xml_interface.cpp \
# Empty last line
Expand Down
Loading