25
25
#include " aig_prop.h"
26
26
#include " instantiate_netlist.h"
27
27
#include " netlist.h"
28
+ #include " netlist_boolbv.h"
28
29
29
30
#include < algorithm>
30
31
@@ -47,7 +48,8 @@ class convert_trans_to_netlistt:public messaget
47
48
symbol_table (_symbol_table),
48
49
ns(_symbol_table),
49
50
dest(_dest),
50
- aig_prop(dest, _message_handler)
51
+ aig_prop(dest, _message_handler),
52
+ solver(ns, aig_prop, _message_handler, dest.var_map)
51
53
{
52
54
}
53
55
@@ -61,6 +63,7 @@ class convert_trans_to_netlistt:public messaget
61
63
const namespacet ns;
62
64
netlistt &dest;
63
65
aig_prop_constraintt aig_prop;
66
+ netlist_boolbvt solver;
64
67
65
68
literalt new_input ();
66
69
std::size_t input_counter = 0 ;
@@ -320,8 +323,7 @@ void convert_trans_to_netlistt::operator()(
320
323
transition_constraints.end ());
321
324
322
325
// initial state
323
- dest.initial .push_back (instantiate_convert (
324
- aig_prop, dest.var_map , trans.init (), ns, get_message_handler ()));
326
+ dest.initial .push_back (solver.convert (trans.init ()));
325
327
326
328
// properties
327
329
for (const auto &[id, property_expr] : properties)
@@ -380,8 +382,7 @@ void convert_trans_to_netlistt::convert_constraints()
380
382
it!=constraint_list.end ();
381
383
it++)
382
384
{
383
- literalt l = instantiate_convert (
384
- aig_prop, dest.var_map , *it, ns, get_message_handler ());
385
+ literalt l = solver.convert (*it);
385
386
386
387
if (has_subexpr (*it, ID_next_symbol))
387
388
transition_constraints.push_back (l);
@@ -571,13 +572,7 @@ literalt convert_trans_to_netlistt::convert_rhs(const rhst &rhs)
571
572
rhs_entry.converted =true ;
572
573
573
574
// now we can convert
574
- instantiate_convert (
575
- aig_prop,
576
- dest.var_map ,
577
- rhs_entry.expr ,
578
- ns,
579
- get_message_handler (),
580
- rhs_entry.bv );
575
+ rhs_entry.bv = solver.convert_bv (rhs_entry.expr );
581
576
582
577
DATA_INVARIANT (rhs_entry.bv .size () == rhs_entry.width , " bit-width match" );
583
578
}
0 commit comments