Skip to content

Commit 4b1c20b

Browse files
combined full-slice with reachability-slice
1 parent 09df414 commit 4b1c20b

File tree

11 files changed

+47
-34
lines changed

11 files changed

+47
-34
lines changed

regression/cbmc-java/slice1/test.desc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
KNOWNBUG
2+
testSlice.class
3+
--full-slice
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$

regression/goto-instrument/chain.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@ name=${name%.c}
1212

1313
args=${@:1:$#-1}
1414

15-
if [ -f $name.c ] ; then
16-
$goto_cc -o $name.gb $name.c
15+
$goto_cc -o $name.gb $name.c
1716
# $goto_instrument --show-goto-functions $name.gb
18-
$goto_instrument $args $name.gb ${name}-mod.gb
19-
if [ ! -e ${name}-mod.gb ] ; then
20-
cp $name.gb ${name}-mod.gb
21-
elif echo "$args" | grep -q -- "--dump-c" ; then
22-
mv ${name}-mod.gb ${name}-mod.c
23-
$goto_cc ${name}-mod.c -o ${name}-mod.gb
24-
rm ${name}-mod.c
25-
fi
17+
$goto_instrument $args $name.gb ${name}-mod.gb
18+
if [ ! -e ${name}-mod.gb ] ; then
19+
cp $name.gb ${name}-mod.gb
20+
elif echo "$args" | grep -q -- "--dump-c" ; then
21+
mv ${name}-mod.gb ${name}-mod.c
22+
$goto_cc ${name}-mod.c -o ${name}-mod.gb
23+
rm ${name}-mod.c
24+
fi
2625
$goto_instrument --show-goto-functions ${name}-mod.gb
2726
$cbmc ${name}-mod.gb
28-
else
29-
$cbmc $name
30-
fi
3127

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
KNOWNBUG
2-
testSlice.class
1+
CORE
2+
main.c
33
--full-slice
4-
^EXIT=10$
4+
^EXIT=0$
55
^SIGNAL=0$
6-
^VERIFICATION FAILED$
6+
^VERIFICATION SUCCESSFUL$

regression/goto-instrument/slice25/test.desc

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/cbmc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ OBJ += ../ansi-c/ansi-c$(LIBEXT) \
3232
../pointer-analysis/rewrite_index$(OBJEXT) \
3333
../pointer-analysis/goto_program_dereference$(OBJEXT) \
3434
../goto-instrument/full_slicer$(OBJEXT) \
35+
../goto-instrument/reachability_slicer$(OBJEXT) \
3536
../goto-instrument/nondet_static$(OBJEXT) \
3637
../goto-instrument/cover$(OBJEXT) \
3738
../analyses/analyses$(LIBEXT) \

src/cbmc/cbmc_parse_options.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Author: Daniel Kroening, kroening@kroening.com
5050
#include <goto-symex/adjust_float_expressions.h>
5151

5252
#include <goto-instrument/full_slicer.h>
53+
#include <goto-instrument/reachability_slicer.h>
5354
#include <goto-instrument/nondet_static.h>
5455
#include <goto-instrument/cover.h>
5556

@@ -821,6 +822,19 @@ bool cbmc_parse_optionst::process_goto_program(
821822
status() << "Generic Property Instrumentation" << eom;
822823
goto_check(ns, options, goto_functions);
823824

825+
// full slice?
826+
if(cmdline.isset("full-slice"))
827+
{
828+
status() << "Performing a full slice" << eom;
829+
full_slicer(goto_functions, ns);
830+
831+
status() << "Performing a reachability slice" << eom;
832+
if(cmdline.isset("property"))
833+
reachability_slicer(goto_functions, cmdline.get_values("property"));
834+
else
835+
reachability_slicer(goto_functions);
836+
}
837+
824838
// checks don't know about adjusted float expressions
825839
adjust_float_expressions(goto_functions, ns);
826840

src/goto-instrument/full_slicer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Author: Daniel Kroening, kroening@kroening.com
1717
#include <goto-programs/remove_skip.h>
1818

1919
#include "full_slicer_class.h"
20-
#include <iostream>
2120

2221
void full_slicert::add_dependencies(
2322
const cfgt::nodet &node,

0 commit comments

Comments
 (0)