Skip to content

Commit 9d9dccf

Browse files
authored
Merge pull request #449 from diffblue/netlist-bmc-unsupported-property
netlist-BMC now gives error for unsupported properties
2 parents 78bde26 + 3fa56c6 commit 9d9dccf

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
bmc_unsupported_property3.smv
3+
--aig
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^\[main::spec1\] !G main::var::x = FALSE: FAILURE: property not supported by netlist BMC engine$
7+
^\[main::spec2\] G main::var::x = FALSE: REFUTED$
8+
--
9+
^warning: ignoring
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MODULE main
2+
3+
VAR x : boolean;
4+
5+
ASSIGN init(x) := 1;
6+
7+
LTLSPEC !G x=0
8+
LTLSPEC G x=0

src/ebmc/ebmc_base.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ int ebmc_baset::finish_bit_level_bmc(const bmc_mapt &bmc_map, propt &solver)
7777
if(property.is_disabled())
7878
continue;
7979

80+
if(property.is_failure())
81+
continue;
82+
8083
message.status() << "Checking " << property.name << messaget::eom;
8184

8285
literalt property_literal=!solver.land(property.timeframe_literals);
@@ -199,6 +202,12 @@ int ebmc_baset::do_bit_level_bmc(cnft &solver, bool convert_only)
199202
if(property.is_disabled())
200203
continue;
201204

205+
if(!netlist_bmc_supports_property(property.normalized_expr))
206+
{
207+
property.failure("property not supported by netlist BMC engine");
208+
continue;
209+
}
210+
202211
::unwind_property(
203212
property.normalized_expr,
204213
property.timeframe_literals,

src/trans-netlist/unwind_netlist.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Author: Daniel Kroening, [email protected]
1111
#include <util/ebmc_util.h>
1212

1313
#include <temporal-logic/temporal_expr.h>
14+
#include <temporal-logic/temporal_logic.h>
1415
#include <verilog/sva_expr.h>
1516

1617
#include "instantiate_netlist.h"
@@ -199,3 +200,27 @@ void unwind_property(
199200
}
200201
}
201202

203+
/*******************************************************************\
204+
205+
Function: netlist_bmc_supports_property
206+
207+
Inputs:
208+
209+
Outputs:
210+
211+
Purpose:
212+
213+
\*******************************************************************/
214+
215+
bool netlist_bmc_supports_property(const exprt &expr)
216+
{
217+
// We do AG p only.
218+
if(expr.id() == ID_AG)
219+
return !has_temporal_operator(to_AG_expr(expr).op());
220+
else if(expr.id() == ID_G)
221+
return !has_temporal_operator(to_G_expr(expr).op());
222+
else if(expr.id() == ID_sva_always)
223+
return !has_temporal_operator(to_sva_always_expr(expr).op());
224+
else
225+
return false;
226+
}

src/trans-netlist/unwind_netlist.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ void unwind_property(
4242
const bmc_mapt &,
4343
const namespacet &);
4444

45+
// Is the property supported?
46+
bool netlist_bmc_supports_property(const exprt &);
47+
4548
// unwind a property that is given as netlist node
4649
void unwind_property(
4750
const bmc_mapt &,

0 commit comments

Comments
 (0)