Skip to content

Commit e35f6b7

Browse files
author
Daniel Kroening
committed
fix for bmc_cover
1 parent 4996502 commit e35f6b7

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

src/cbmc/bmc_cover.cpp

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,9 @@ class bmc_covert:
146146
}
147147
};
148148

149-
inline irep_idt id(
150-
goto_programt::const_targett loc,
151-
const std::string suffix="")
149+
inline irep_idt id(goto_programt::const_targett loc)
152150
{
153-
return id2string(loc->function)+
154-
"#"+i2string(loc->location_number)+
155-
suffix;
151+
return loc->source_location.get_property_id();
156152
}
157153

158154
typedef std::map<irep_idt, goalt> goal_mapt;
@@ -261,20 +257,6 @@ bool bmc_covert::operator()()
261257
// stop the time
262258
absolute_timet sat_start=current_time();
263259

264-
// we don't want the assertions to become constraints
265-
for(symex_target_equationt::SSA_stepst::iterator
266-
it=bmc.equation.SSA_steps.begin();
267-
it!=bmc.equation.SSA_steps.end();
268-
it++)
269-
if(it->type==goto_trace_stept::ASSERT)
270-
it->type=goto_trace_stept::LOCATION;
271-
272-
bmc.do_conversion();
273-
274-
//bmc.equation.output(std::cout);
275-
276-
std::map<goto_programt::const_targett, irep_idt> location_map;
277-
278260
// Collect _all_ goals in `goal_map'.
279261
// This maps property IDs to 'goalt'
280262
forall_goto_functions(f_it, goto_functions)
@@ -291,6 +273,12 @@ bool bmc_covert::operator()()
291273
}
292274
}
293275

276+
// Do conversion to next solver layer
277+
278+
bmc.do_conversion();
279+
280+
//bmc.equation.output(std::cout);
281+
294282
// collects assumptions
295283
and_exprt::operandst assumptions;
296284

@@ -306,9 +294,13 @@ bool bmc_covert::operator()()
306294

307295
if(it->source.pc->is_assert())
308296
{
309-
and_exprt c_expr(conjunction(assumptions), literal_exprt(it->guard_literal));
310-
literalt c=solver.convert(c_expr);
311-
goal_map[id(it->source.pc)].add_instance(it, c);
297+
exprt c=
298+
conjunction({
299+
conjunction(assumptions),
300+
literal_exprt(it->guard_literal),
301+
literal_exprt(it->cond_literal) });
302+
literalt l_c=solver.convert(c);
303+
goal_map[id(it->source.pc)].add_instance(it, l_c);
312304
}
313305
}
314306

0 commit comments

Comments
 (0)