Skip to content

Commit

Permalink
make_assertions_false
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@1057 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
  • Loading branch information
kroening committed Feb 28, 2012
1 parent 6266efa commit 35b430a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/goto-programs/set_claims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,37 @@ void set_claims(
if(!claim_set.empty())
throw "claim "+(*claim_set.begin())+" not found";
}

/*******************************************************************\
Function: make_assertions_false
Inputs:
Outputs:
Purpose:
\*******************************************************************/

void make_assertions_false(
goto_functionst &goto_functions)
{
for(goto_functionst::function_mapt::iterator
f_it=goto_functions.function_map.begin();
f_it!=goto_functions.function_map.end();
f_it++)
{
goto_programt &goto_program=f_it->second.body;

for(goto_programt::instructionst::iterator
i_it=goto_program.instructions.begin();
i_it!=goto_program.instructions.end();
i_it++)
{
if(!i_it->is_assert()) continue;
i_it->guard.make_false();
}
}
}

3 changes: 3 additions & 0 deletions src/goto-programs/set_claims.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ void set_claims(
void set_claims(
goto_programt &goto_program,
const std::list<std::string> &claims);

void make_assertions_false(
goto_functionst &goto_functions);

#endif

0 comments on commit 35b430a

Please sign in to comment.