@@ -17,13 +17,13 @@ Author: Daniel Kroening, kroening@kroening.com
1717#include < util/std_expr.h>
1818
1919#include < solvers/flattening/boolbv_width.h>
20+ #include < solvers/prop/literal_expr.h>
2021#include < temporal-logic/ctl.h>
2122#include < temporal-logic/ltl.h>
2223#include < temporal-logic/temporal_logic.h>
2324#include < verilog/sva_expr.h>
2425
2526#include " aig_prop.h"
26- #include " instantiate_netlist.h"
2727#include " netlist.h"
2828#include " netlist_boolbv.h"
2929
@@ -145,6 +145,8 @@ class convert_trans_to_netlistt:public messaget
145145
146146 void convert_constraints ();
147147
148+ std::optional<exprt> convert_property (const exprt &);
149+
148150 void map_vars (
149151 const irep_idt &module ,
150152 netlistt &dest);
@@ -328,9 +330,7 @@ void convert_trans_to_netlistt::operator()(
328330 // properties
329331 for (const auto &[id, property_expr] : properties)
330332 {
331- auto netlist_expr_opt = netlist_property (
332- aig_prop, dest.var_map , property_expr, ns, get_message_handler ());
333-
333+ auto netlist_expr_opt = convert_property (property_expr);
334334 dest.properties .emplace (id, netlist_expr_opt);
335335 }
336336
@@ -359,6 +359,75 @@ void convert_trans_to_netlistt::operator()(
359359
360360/* ******************************************************************\
361361
362+ Function: convert_trans_to_netlistt::convert_property
363+
364+ Inputs:
365+
366+ Outputs:
367+
368+ Purpose:
369+
370+ \*******************************************************************/
371+
372+ std::optional<exprt>
373+ convert_trans_to_netlistt::convert_property (const exprt &expr)
374+ {
375+ if (is_temporal_operator (expr))
376+ {
377+ if (is_LTL_operator (expr) || is_CTL_operator (expr))
378+ {
379+ exprt copy = expr;
380+ for (auto &op : copy.operands ())
381+ {
382+ auto op_opt = convert_property (op);
383+ if (op_opt.has_value ())
384+ op = op_opt.value ();
385+ else
386+ return {};
387+ }
388+ return copy;
389+ }
390+ else if (is_SVA_operator (expr))
391+ {
392+ // Try to turn into LTL
393+ auto LTL_opt = SVA_to_LTL (expr);
394+ if (LTL_opt.has_value ())
395+ return convert_property (*LTL_opt);
396+ else
397+ return {};
398+ }
399+ else
400+ return {};
401+ }
402+ else if (!has_temporal_operator (expr))
403+ {
404+ auto l = solver.convert (expr);
405+ return literal_exprt{l};
406+ }
407+ else if (
408+ expr.id () == ID_and || expr.id () == ID_or || expr.id () == ID_not ||
409+ expr.id () == ID_implies || expr.id () == ID_xor || expr.id () == ID_xnor)
410+ {
411+ exprt copy = expr;
412+ for (auto &op : copy.operands ())
413+ {
414+ auto op_opt = convert_property (op);
415+ if (op_opt.has_value ())
416+ op = op_opt.value ();
417+ else
418+ return {};
419+ }
420+ return copy;
421+ }
422+ else
423+ {
424+ // contains temporal operator, but not propositional skeleton
425+ return {};
426+ }
427+ }
428+
429+ /* ******************************************************************\
430+
362431Function: convert_trans_to_netlistt::convert_constraints
363432
364433 Inputs:
0 commit comments