@@ -9,6 +9,7 @@ Author: Daniel Kroening, dkr@amazon.com
99#include " bmc.h"
1010
1111#include < solvers/prop/literal_expr.h>
12+ #include < trans-word-level/lasso.h>
1213#include < trans-word-level/trans_trace_word_level.h>
1314#include < trans-word-level/unwind.h>
1415
@@ -191,6 +192,17 @@ void bmc_with_iterative_constraint_strengthening(
191192 }
192193}
193194
195+ // / Extension of solver.handle(...) from expressions to vectors of expressions
196+ static exprt::operandst
197+ handles (const exprt::operandst &exprs, decision_proceduret &solver)
198+ {
199+ exprt::operandst result;
200+ result.reserve (exprs.size ());
201+ for (auto &expr : exprs)
202+ result.push_back (solver.handle (expr));
203+ return result;
204+ }
205+
194206property_checker_resultt bmc (
195207 std::size_t bound,
196208 bool convert_only,
@@ -211,13 +223,21 @@ property_checker_resultt bmc(
211223
212224 auto solver_wrapper = solver_factory (ns, message_handler);
213225 auto &solver = solver_wrapper.decision_procedure ();
226+ auto no_timeframes = bound + 1 ;
214227
215228 ::unwind (
216- transition_system.trans_expr, message_handler, solver, bound + 1 , ns, true );
229+ transition_system.trans_expr,
230+ message_handler,
231+ solver,
232+ no_timeframes,
233+ ns,
234+ true );
217235
218236 // convert the properties
219237 message.status () << " Properties" << messaget::eom;
220238
239+ bool requires_lasso_constraints = false ;
240+
221241 for (auto &property : properties.properties )
222242 {
223243 if (property.is_disabled () || property.is_failure ())
@@ -230,20 +250,25 @@ property_checker_resultt bmc(
230250 continue ;
231251 }
232252
233- property.timeframe_handles = ::property (
234- property.normalized_expr , message_handler, solver, bound + 1 , ns);
253+ auto obligations =
254+ ::property (property.normalized_expr, message_handler, no_timeframes);
255+
256+ if (uses_lasso_symbol (obligations))
257+ requires_lasso_constraints = true ;
258+
259+ property.timeframe_handles = handles (obligations, solver);
235260
236261 // If it's an assumption, then add it as constraint.
237262 if (property.is_assumed ())
238263 solver.set_to_true (conjunction (property.timeframe_handles ));
239264 }
240265
241266 // lasso constraints, if needed
242- if (properties. requires_lasso_constraints () )
267+ if (requires_lasso_constraints)
243268 {
244269 message.status () << " Adding lasso constraints" << messaget::eom;
245270 lasso_constraints (
246- solver, bound + 1 , ns, transition_system.main_symbol ->name );
271+ solver, no_timeframes , ns, transition_system.main_symbol ->name );
247272 }
248273
249274 if (convert_only)
0 commit comments