Skip to content

Commit 35b430a

Browse files
author
kroening
committed
make_assertions_false
git-svn-id: svn+ssh://svn.cprover.org/srv/svn/cbmc/trunk@1057 6afb6bc1-c8e4-404c-8f48-9ae832c5b171
1 parent 6266efa commit 35b430a

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

src/goto-programs/set_claims.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,37 @@ void set_claims(
120120
if(!claim_set.empty())
121121
throw "claim "+(*claim_set.begin())+" not found";
122122
}
123+
124+
/*******************************************************************\
125+
126+
Function: make_assertions_false
127+
128+
Inputs:
129+
130+
Outputs:
131+
132+
Purpose:
133+
134+
\*******************************************************************/
135+
136+
void make_assertions_false(
137+
goto_functionst &goto_functions)
138+
{
139+
for(goto_functionst::function_mapt::iterator
140+
f_it=goto_functions.function_map.begin();
141+
f_it!=goto_functions.function_map.end();
142+
f_it++)
143+
{
144+
goto_programt &goto_program=f_it->second.body;
145+
146+
for(goto_programt::instructionst::iterator
147+
i_it=goto_program.instructions.begin();
148+
i_it!=goto_program.instructions.end();
149+
i_it++)
150+
{
151+
if(!i_it->is_assert()) continue;
152+
i_it->guard.make_false();
153+
}
154+
}
155+
}
156+

src/goto-programs/set_claims.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ void set_claims(
1818
void set_claims(
1919
goto_programt &goto_program,
2020
const std::list<std::string> &claims);
21+
22+
void make_assertions_false(
23+
goto_functionst &goto_functions);
2124

2225
#endif

0 commit comments

Comments
 (0)