Skip to content

Commit

Permalink
EBMC: retain assumptions when using --property
Browse files Browse the repository at this point in the history
When using the --property command-line option, do not disable the
assumptions.
  • Loading branch information
kroening committed Oct 18, 2024
1 parent 88a0e54 commit 2dc3c7d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Verilog: allow indexed part select
* word-level BMC: fix for F/s_eventually and U/s_until
* IC3: liveness to safety translation
* Assumptions are not disabled when using --property

# EBMC 5.2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CORE
main.v
assume1.v
--module main --bound 3 --aig --vl2smv-extensions
^\[main\.property\.a1\] assume always 10 <= main\.a && main\.a <= 100: ASSUMED$
^\[main\.property\.p1\] always main\.a != 200: PROVED up to bound 3$
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions regression/ebmc/assumptions/assume2.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
assume2.sv
--bound 0 --property main.p1
^\[main\.a1\] assume always 10 <= main\.a && main\.a <= 100: ASSUMED$
^\[main\.p1\] always main\.a != 200: PROVED up to bound 0$
^EXIT=0$
^SIGNAL=0$
10 changes: 10 additions & 0 deletions regression/ebmc/assumptions/assume2.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module main(input [31:0] a);

a1: assume final (10<=a && a<=100);

p1: assert final (a!=200);

// would fail
p2: assert final (a!=20);

endmodule
4 changes: 3 additions & 1 deletion src/ebmc/ebmc_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ bool ebmc_propertiest::select_property(
{
std::string property = cmdline.get_value("property");

// disable all assertions (not: assumptions)
for(auto &p : properties)
p.status = propertyt::statust::DISABLED;
if(!p.is_assumed())
p.status = propertyt::statust::DISABLED;

bool found = false;

Expand Down

0 comments on commit 2dc3c7d

Please sign in to comment.