Skip to content

Commit 68409ac

Browse files
authored
Merge pull request #467 from diffblue/netlist-unwind-property
ebmc: netlist unwinding now uses netlist property node
2 parents 4008a86 + b4dc6aa commit 68409ac

File tree

10 files changed

+42
-465
lines changed

10 files changed

+42
-465
lines changed

src/ebmc/bdd_engine.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ void bdd_enginet::compute_counterexample(
364364
propertyt &property,
365365
unsigned number_of_timeframes)
366366
{
367+
// Supported by BMC engine?
368+
if(!netlist_bmc_supports_property(property.normalized_expr))
369+
return;
370+
367371
message.status() << "Computing counterexample with " << number_of_timeframes
368372
<< " timeframe(s)" << messaget::eom;
369373

@@ -372,16 +376,14 @@ void bdd_enginet::compute_counterexample(
372376
satcheckt solver{message.get_message_handler()};
373377
bmc_map.map_timeframes(netlist, number_of_timeframes, solver);
374378

375-
const namespacet ns(transition_system.symbol_table);
376-
377379
::unwind(netlist, bmc_map, message, solver);
380+
381+
// find the netlist property
382+
auto netlist_property = netlist.properties.find(property.identifier);
383+
CHECK_RETURN(netlist_property != netlist.properties.end());
384+
378385
::unwind_property(
379-
property.normalized_expr,
380-
property.timeframe_literals,
381-
message.get_message_handler(),
382-
solver,
383-
bmc_map,
384-
ns);
386+
netlist_property->second, bmc_map, property.timeframe_literals);
385387

386388
// we need the propertyt to fail in one of the timeframes
387389
bvt clause=property.timeframe_literals;
@@ -402,6 +404,8 @@ void bdd_enginet::compute_counterexample(
402404
throw "unexpected result from SAT solver";
403405
}
404406

407+
const namespacet ns(transition_system.symbol_table);
408+
405409
property.witness_trace =
406410
compute_trans_trace(property.timeframe_literals, bmc_map, solver, ns);
407411
}

src/ebmc/ebmc_base.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,12 @@ int ebmc_baset::do_bit_level_bmc(cnft &solver, bool convert_only)
208208
continue;
209209
}
210210

211+
// look up the property in the netlist
212+
auto netlist_property = netlist.properties.find(property.identifier);
213+
CHECK_RETURN(netlist_property != netlist.properties.end());
214+
211215
::unwind_property(
212-
property.normalized_expr,
213-
property.timeframe_literals,
214-
message.get_message_handler(),
215-
solver,
216-
bmc_map,
217-
ns);
216+
netlist_property->second, bmc_map, property.timeframe_literals);
218217

219218
// freeze for incremental usage
220219
for(auto l : property.timeframe_literals)

src/ebmc/ebmc_properties.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ ebmc_propertiest ebmc_propertiest::from_transition_system(
6767

6868
properties.properties.push_back(propertyt());
6969
properties.properties.back().number = properties.properties.size() - 1;
70-
71-
if(symbol.pretty_name.empty())
72-
properties.properties.back().name = symbol.name;
73-
else
74-
properties.properties.back().name = symbol.pretty_name;
75-
70+
properties.properties.back().identifier = symbol.name;
71+
properties.properties.back().name = symbol.display_name();
7672
properties.properties.back().original_expr = symbol.value;
7773
properties.properties.back().normalized_expr =
7874
normalize_property(symbol.value);

src/ebmc/ebmc_properties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ebmc_propertiest
2626
{
2727
public:
2828
std::size_t number = 0;
29-
irep_idt name;
29+
irep_idt identifier, name;
3030
source_locationt location;
3131
std::string expr_string;
3232
irep_idt mode;

src/ebmc/report_results.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ void report_results(
5555
continue;
5656

5757
json_objectt json_property;
58-
json_property["identifier"] = json_stringt(id2string(property.name));
58+
json_property["identifier"] =
59+
json_stringt(id2string(property.identifier));
5960
json_property["status"] = json_stringt(property.status_as_string());
6061

6162
if(property.has_witness_trace())
@@ -77,7 +78,7 @@ void report_results(
7778
continue;
7879

7980
xmlt xml_result("result");
80-
xml_result.set_attribute("property", id2string(property.name));
81+
xml_result.set_attribute("property", id2string(property.identifier));
8182
xml_result.set_attribute("status", property.status_as_string());
8283

8384
if(property.has_witness_trace())

0 commit comments

Comments
 (0)