@@ -6,18 +6,23 @@ Author: Daniel Kroening, kroening@kroening.com
66
77\*******************************************************************/
88
9+ #include " trans_to_netlist.h"
10+
911#include < util/arith_tools.h>
1012#include < util/bitvector_expr.h>
1113#include < util/ebmc_util.h>
1214#include < util/namespace.h>
1315#include < util/std_expr.h>
1416
1517#include < solvers/flattening/boolbv_width.h>
18+ #include < temporal-logic/normalize_property.h>
19+ #include < temporal-logic/temporal_expr.h>
20+ #include < temporal-logic/temporal_logic.h>
21+ #include < verilog/sva_expr.h>
1622
1723#include " aig_prop.h"
18- #include " netlist.h"
19- #include " trans_to_netlist.h"
2024#include " instantiate_netlist.h"
25+ #include " netlist.h"
2126
2227/* ******************************************************************\
2328
@@ -303,6 +308,62 @@ void convert_trans_to_netlistt::operator()(const irep_idt &module)
303308 dest.initial .push_back (instantiate_convert (
304309 aig_prop, dest.var_map , trans.init (), ns, get_message_handler ()));
305310
311+ // properties
312+ for (const auto &[id, symbol] : symbol_table)
313+ {
314+ if (symbol.module == module && symbol.is_property )
315+ {
316+ auto expr = normalize_property (symbol.value );
317+
318+ auto convert = [&aig_prop, this ](const exprt &expr) -> literalt {
319+ return instantiate_convert (
320+ aig_prop, dest.var_map , expr, ns, get_message_handler ());
321+ };
322+
323+ if (expr.id () == ID_AG || expr.id () == ID_G || expr.id () == ID_sva_always)
324+ {
325+ auto get_phi = [](const exprt &expr) {
326+ if (expr.id () == ID_AG)
327+ return to_AG_expr (expr).op ();
328+ else if (expr.id () == ID_G)
329+ return to_G_expr (expr).op ();
330+ else if (expr.id () == ID_sva_always)
331+ return to_sva_always_expr (expr).op ();
332+ else
333+ PRECONDITION (false );
334+ };
335+
336+ auto phi = get_phi (expr);
337+
338+ if (!has_temporal_operator (phi))
339+ {
340+ dest.properties .emplace (id, netlistt::Gpt{convert (phi)});
341+ }
342+ else if (
343+ phi.id () == ID_AF || phi.id () == ID_F ||
344+ phi.id () == ID_sva_s_eventually)
345+ {
346+ auto get_psi = [](const exprt &expr) {
347+ if (expr.id () == ID_AF)
348+ return to_AF_expr (expr).op ();
349+ else if (expr.id () == ID_F)
350+ return to_F_expr (expr).op ();
351+ else if (expr.id () == ID_sva_s_eventually)
352+ return to_sva_s_eventually_expr (expr).op ();
353+ else
354+ PRECONDITION (false );
355+ };
356+
357+ dest.properties .emplace (id, netlistt::GFpt{convert (get_psi (phi))});
358+ }
359+ else
360+ {
361+ // unsupported
362+ }
363+ }
364+ }
365+ }
366+
306367 // find the nondet nodes
307368 for (std::size_t n=0 ; n<dest.nodes .size (); n++)
308369 {
0 commit comments