Skip to content

Commit

Permalink
ebmc: --ranking-function now honors --property
Browse files Browse the repository at this point in the history
The ranking function facility now allows selecting a specific property using
the --property command-line option.
  • Loading branch information
kroening committed Dec 2, 2023
1 parent e429921 commit d3245d0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
counter_with_reset1.sv
--property main.property.p0 --ranking-function 10-counter
^\[main\.property\.p0\] always \(eventually main.counter == 10\): UNKNOWN$
^EXIT=0$
^SIGNAL=0$
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
counter_with_reset1.sv
--property main.property.p1 --ranking-function 10-counter
^\[main\.property\.p1\] always \(eventually main.reset \|\| main.counter == 10\): SUCCESS$
^EXIT=0$
^SIGNAL=0$
--
21 changes: 21 additions & 0 deletions regression/ebmc/ranking-function/counter_with_reset1.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// count up from 0 to 10

module main(input clk, input reset);

reg [3:0] counter;

initial counter = 0;

always @(posedge clk)
if(reset)
counter = 0;
else if(counter != 10)
counter = counter + 1;

// expected to fail, owing to reset
p0: assert property (eventually counter == 10);

// expected to pass
p1: assert property (eventually (reset || counter == 10));

endmodule
4 changes: 2 additions & 2 deletions src/ebmc/ranking_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ int do_ranking_function(
cmdline.get_value("ranking-function"), transition_system, message_handler);

// find the property
auto properties = ebmc_propertiest::from_transition_system(
transition_system, message_handler);
auto properties = ebmc_propertiest::from_command_line(
cmdline, transition_system, message_handler);

auto &property = find_property(properties);

Expand Down

0 comments on commit d3245d0

Please sign in to comment.