-
Notifications
You must be signed in to change notification settings - Fork 273
consider array_set expressions in the full-slice (do not merge) #898
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
Changes from all commits
9606967
2fc22f4
b823e0a
09df414
4b1c20b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
KNOWNBUG | ||
testSlice.class | ||
--full-slice | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^VERIFICATION FAILED$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class test | ||
{ | ||
public void f1() | ||
{ | ||
int y=0; | ||
y++; | ||
} | ||
|
||
public void f2() | ||
{ | ||
i++; | ||
} | ||
|
||
public int f3() | ||
{ | ||
return i; | ||
} | ||
|
||
private int i; | ||
} | ||
|
||
public class testSlice | ||
{ | ||
public static void main(String[] args) | ||
{ | ||
test t = new test(); | ||
t.f1(); | ||
t.f2(); | ||
assert t.f3()==1; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#include <assert.h> | ||
|
||
int main() | ||
{ | ||
int x = 1; /* considering changing this line */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
KNOWNBUG | ||
main.c | ||
--full-slice | ||
^EXIT=6$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^\-\-full\-slice does not support C/Pthreads yet$ | ||
-- | ||
^warning: ignoring | ||
^VERIFICATION SUCCESSFUL$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
KNOWNBUG | ||
CORE | ||
main.c | ||
--full-slice | ||
^EXIT=0$ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <assert.h> | ||
|
||
int x; | ||
|
||
void f1() | ||
{ | ||
int y=0; | ||
y++; | ||
} | ||
|
||
void f2() | ||
{ | ||
x++; | ||
} | ||
|
||
int main() | ||
{ | ||
f1(); | ||
f2(); | ||
assert(x==1); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CORE | ||
main.c | ||
--full-slice | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ Author: Daniel Kroening, [email protected] | |
#include <goto-symex/adjust_float_expressions.h> | ||
|
||
#include <goto-instrument/full_slicer.h> | ||
#include <goto-instrument/reachability_slicer.h> | ||
#include <goto-instrument/nondet_static.h> | ||
#include <goto-instrument/cover.h> | ||
|
||
|
@@ -821,6 +822,19 @@ bool cbmc_parse_optionst::process_goto_program( | |
status() << "Generic Property Instrumentation" << eom; | ||
goto_check(ns, options, goto_functions); | ||
|
||
// full slice? | ||
if(cmdline.isset("full-slice")) | ||
{ | ||
status() << "Performing a full slice" << eom; | ||
full_slicer(goto_functions, ns); | ||
|
||
status() << "Performing a reachability slice" << eom; | ||
if(cmdline.isset("property")) | ||
reachability_slicer(goto_functions, cmdline.get_values("property")); | ||
else | ||
reachability_slicer(goto_functions); | ||
} | ||
|
||
// checks don't know about adjusted float expressions | ||
adjust_float_expressions(goto_functions, ns); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,6 +318,8 @@ void full_slicert::operator()( | |
const exprt &s=to_code_dead(e_it->first->code).symbol(); | ||
decl_dead[to_symbol_expr(s).get_identifier()].push(e_it->second); | ||
} | ||
else if(e_it->first->is_function_call()) | ||
add_to_queue(queue, e_it->second, e_it->first); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment that this assumes that a rechability slice has been performed, for it would otherwise add way too much to the slice. |
||
} | ||
|
||
// compute program dependence graph (and post-dominators) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1410,16 +1410,6 @@ void goto_instrument_parse_optionst::instrument_goto_program() | |
nondet_volatile(symbol_table, goto_functions); | ||
} | ||
|
||
// reachability slice? | ||
if(cmdline.isset("reachability-slice")) | ||
{ | ||
status() << "Performing a reachability slice" << eom; | ||
if(cmdline.isset("property")) | ||
reachability_slicer(goto_functions, cmdline.get_values("property")); | ||
else | ||
reachability_slicer(goto_functions); | ||
} | ||
|
||
// full slice? | ||
if(cmdline.isset("full-slice")) | ||
{ | ||
|
@@ -1433,6 +1423,19 @@ void goto_instrument_parse_optionst::instrument_goto_program() | |
full_slicer(goto_functions, ns); | ||
} | ||
|
||
// reachability slice? | ||
if(cmdline.isset("reachability-slice") || cmdline.isset("full-slice")) | ||
{ | ||
status() << "Performing a reachability slice" << eom; | ||
if(cmdline.isset("property")) | ||
reachability_slicer(goto_functions, cmdline.get_values("property")); | ||
else | ||
reachability_slicer(goto_functions); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why has this been moved? |
||
// label the assertions | ||
label_properties(goto_functions); | ||
|
||
// recalculate numbers, etc. | ||
goto_functions.update(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems rather impossible to infer what the problem here is from the commit message. Please either make the commit message more verbose or add comments to test.desc.