Skip to content

Commit b0cd3b2

Browse files
authored
Merge pull request #689 from diffblue/aig-past
better error reporting when $past is unsupported
2 parents 98bae01 + b7f39c7 commit b0cd3b2

File tree

6 files changed

+44
-3
lines changed

6 files changed

+44
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
past1.sv
3+
--aig
4+
^\[main\.p0\] ##0 \(\$past\(main\.counter, 0\)\) == 0: FAILURE: property not supported by netlist BMC engine$
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
--
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
past1.sv
3+
--bdd
4+
^\[main\.p0\] ##0 \(\$past\(main\.counter, 0\)\) == 0: FAILURE: property not supported by BDD engine$
5+
^EXIT=10$
6+
^SIGNAL=0$
7+
--

regression/verilog/system-functions/past2.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
past2.sv
33
--bdd
4-
^file .* line \d+: error: no support for \$past when using AIG backends$
5-
^EXIT=6$
4+
^\[main\.p0\] always \(main\.counter == 0 \|-> \(\$past\(main\.counter, 1\)\) == 0\): FAILURE: property not supported by BDD engine$
5+
^EXIT=10$
66
^SIGNAL=0$
77
--
88
^warning: ignoring

src/ebmc/bdd_engine.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Author: Daniel Kroening, [email protected]
88

99
#include "bdd_engine.h"
1010

11+
#include <util/expr_util.h>
1112
#include <util/format_expr.h>
1213

1314
#include <solvers/bdd/miniBDD/miniBDD.h>
@@ -175,6 +176,17 @@ property_checker_resultt bdd_enginet::operator()()
175176
{
176177
try
177178
{
179+
for(auto &property : properties.properties)
180+
{
181+
// no support for $past
182+
if(has_subexpr(property.normalized_expr, ID_verilog_past))
183+
property.failure("property not supported by BDD engine");
184+
}
185+
186+
// any properties left?
187+
if(!properties.has_unknown_property())
188+
return property_checker_resultt::VERIFICATION_RESULT;
189+
178190
const auto property_map = properties.make_property_map();
179191

180192
message.status() << "Building netlist" << messaget::eom;
@@ -882,7 +894,8 @@ void bdd_enginet::get_atomic_propositions(const exprt &expr)
882894
expr.id() == ID_implies || is_temporal_operator(expr))
883895
{
884896
for(const auto & op : expr.operands())
885-
get_atomic_propositions(op);
897+
if(op.type().id() == ID_bool)
898+
get_atomic_propositions(op);
886899
}
887900
else
888901
{

src/ebmc/ebmc_properties.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ class ebmc_propertiest
182182
return true;
183183
}
184184

185+
bool has_unknown_property() const
186+
{
187+
for(const auto &p : properties)
188+
if(p.is_unknown())
189+
return true;
190+
191+
return false;
192+
}
193+
185194
bool requires_lasso_constraints() const
186195
{
187196
for(const auto &p : properties)

src/trans-netlist/unwind_netlist.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Author: Daniel Kroening, [email protected]
99
#include "unwind_netlist.h"
1010

1111
#include <util/ebmc_util.h>
12+
#include <util/expr_util.h>
1213

1314
#include <temporal-logic/temporal_expr.h>
1415
#include <temporal-logic/temporal_logic.h>
@@ -170,6 +171,10 @@ Function: netlist_bmc_supports_property
170171

171172
bool netlist_bmc_supports_property(const exprt &expr)
172173
{
174+
// No $past.
175+
if(has_subexpr(expr, ID_verilog_past))
176+
return false;
177+
173178
// We do AG p only.
174179
if(expr.id() == ID_AG)
175180
return !has_temporal_operator(to_AG_expr(expr).op());

0 commit comments

Comments
 (0)