Skip to content

Print status information upon reaching assume(false) #740

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

Merged
merged 1 commit into from
Apr 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions src/cbmc/symex_bmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Author: Daniel Kroening, [email protected]
#include <limits>

#include <util/source_location.h>
#include <util/simplify_expr.h>

#include "symex_bmc.h"

Expand Down Expand Up @@ -67,6 +68,21 @@ void symex_bmct::symex_step(
!state.guard.is_false())
symex_coverage.covered(state.source.pc);

if(!state.guard.is_false() &&
state.source.pc->is_assume() &&
simplify_expr(state.source.pc->guard, ns).is_false())
{
statistics() << "aborting path on assume(false) at "
<< state.source.pc->source_location
<< " thread " << state.source.thread_nr;

const irep_idt &c=state.source.pc->source_location.get_comment();
if(!c.empty())
statistics() << ": " << c;

statistics() << eom;
}

goto_symext::symex_step(goto_functions, state);
}

Expand Down
21 changes: 20 additions & 1 deletion src/symex/path_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Author: Daniel Kroening, [email protected]
\*******************************************************************/

#include <util/simplify_expr.h>
#include <util/time_stopping.h>

#include <solvers/flattening/bv_pointers.h>
Expand Down Expand Up @@ -315,8 +316,10 @@ Function: path_searcht::drop_state
\*******************************************************************/

bool path_searcht::drop_state(const statet &state) const
bool path_searcht::drop_state(const statet &state)
{
goto_programt::const_targett pc=state.get_instruction();

// depth limit
if(depth_limit_set && state.get_depth()>depth_limit)
return true;
Expand Down Expand Up @@ -345,6 +348,22 @@ bool path_searcht::drop_state(const statet &state) const
return true;
}

if(pc->is_assume() &&
simplify_expr(pc->guard, ns).is_false())
{
debug() << "aborting path on assume(false) at "
<< pc->source_location
<< " thread " << state.get_current_thread();

const irep_idt &c=pc->source_location.get_comment();
if(!c.empty())
debug() << ": " << c;

debug() << eom;

return true;
}

return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/symex/path_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class path_searcht:public safety_checkert
bool is_feasible(statet &state);
void do_show_vcc(statet &state);

bool drop_state(const statet &state) const;
bool drop_state(const statet &state);

void report_statistics();

Expand Down