Skip to content

BMC: reconsider lasso-shaped encodings #1202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* SystemVerilog: fix for |-> and |=> for empty matches
* LTL/SVA to Buechi with --buechi
* SMV: abs, bool, count, max, min, toint, word1
* BMC: new encoding for F, avoiding spurious traces

# EBMC 5.6

Expand Down
9 changes: 4 additions & 5 deletions regression/smv/CTL/smv_ctlspec_AFAG1.bmc.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
KNOWNBUG
smv_ltlspec_AFAG1.smv
--bound 3
^\[spec1\] AF AG !buechi_state: PROVED$
CORE
smv_ctlspec_AFAG1.smv
--bound 10
^\[spec1\] AF AG !buechi_state: PROVED up to bound 10$
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
The BMC engine returns the wrong answer.
5 changes: 2 additions & 3 deletions regression/smv/LTL/smv_ltlspec_F4.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
KNOWNBUG
CORE
smv_ltlspec_F4.smv
--bound 3
--bound 2
^\[spec1\] F \(some_input <-> X some_input\): REFUTED$
^EXIT=10$
^SIGNAL=0$
--
^warning: ignoring
--
The BMC engine gives the wrong answer.
7 changes: 4 additions & 3 deletions regression/smv/LTL/smv_ltlspec_F6.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
KNOWNBUG
CORE
smv_ltlspec_F6.smv
--bound 3 --numbered-trace
--bound 1 --numbered-trace
^\[spec1\] F X some_input: REFUTED$
^some_input@0 = FALSE$
^some_input@1 = FALSE$
^EXIT=10$
^SIGNAL=0$
--
^warning: ignoring
--
The BMC engine gives the wrong answer.
7 changes: 3 additions & 4 deletions regression/smv/LTL/smv_ltlspec_FG1.bmc.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
KNOWNBUG
CORE
smv_ltlspec_FG1.smv
--bound 2
^\[spec1\] F G x!=1: PROVED$
--bound 10
^\[spec1\] F G x != 1: PROVED up to bound 10$
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
The BMC engine returns the wrong answer.
4 changes: 4 additions & 0 deletions regression/smv/LTL/smv_ltlspec_FG1.smv
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ TRANS x=1 -> next(x)=2

TRANS x=2 -> next(x)=2

-- This should pass.
-- There are traces of two kinds:
-- 0, 0, 0, ...
-- 0, ..., 0, 1, 2, 2, ...
LTLSPEC F G x!=1
9 changes: 9 additions & 0 deletions regression/smv/LTL/smv_ltlspec_FX1.bdd.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
smv_ltlspec_FX1.smv
--bdd
^\[spec1\] F X X p: REFUTED$
^EXIT=10$
^SIGNAL=0$
--
^warning: ignoring
--
9 changes: 9 additions & 0 deletions regression/smv/LTL/smv_ltlspec_FX1.bmc.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
smv_ltlspec_FX1.smv
--bound 1
^\[spec1\] F X X p: REFUTED$
^EXIT=10$
^SIGNAL=0$
--
^warning: ignoring
--
7 changes: 7 additions & 0 deletions regression/smv/LTL/smv_ltlspec_FX1.smv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MODULE main

VAR p : boolean;

-- This should fail for any bound >= 1.
-- The shortest lasso is FALSE, FALSE, ...
LTLSPEC F X X p
9 changes: 9 additions & 0 deletions regression/smv/LTL/smv_ltlspec_U3.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
smv_ltlspec_U3.smv
--bound 5
^\[.*\] TRUE U x -> F x: PROVED up to bound 5$
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
6 changes: 6 additions & 0 deletions regression/smv/LTL/smv_ltlspec_U3.smv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MODULE main

VAR x : boolean;

-- should pass
LTLSPEC (TRUE U x) -> F x
1 change: 1 addition & 0 deletions regression/smv/LTL/smv_ltlspec_or1.desc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ smv_ltlspec_or1.smv
^SIGNAL=0$
--
^warning: ignoring
--
9 changes: 9 additions & 0 deletions regression/smv/LTL/smv_ltlspec_or2.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CORE
smv_ltlspec_or2.smv
--bound 10
^\[spec1\] F z \| z V x: REFUTED$
^EXIT=10$
^SIGNAL=0$
--
^warning: ignoring
--
11 changes: 11 additions & 0 deletions regression/smv/LTL/smv_ltlspec_or2.smv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MODULE main

VAR x : boolean;

VAR z : boolean;

ASSIGN init(z) := FALSE;
next(z) := FALSE;

-- should fail
LTLSPEC (F z) | (z V x)
9 changes: 9 additions & 0 deletions regression/verilog/SVA/sva_or1.bmc.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
KNOWNBUG
sva_or1.sv

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
Wrong answer on ##[*]
7 changes: 7 additions & 0 deletions regression/verilog/SVA/sva_or1.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module main(input a);

initial p0: assert property ((s_eventually a) or (always !a));
initial p1: assert property ((s_eventually a) or not ##[*] a);
initial p2: assert property ((##[*] a) or (always !a));

endmodule
8 changes: 6 additions & 2 deletions src/smvlang/smv_typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1940,9 +1940,13 @@ void smv_typecheckt::create_var_symbols(
else
symbol.pretty_name = strip_smv_prefix(symbol.name);

symbol.value = nil_exprt{};
symbol.is_input = true;
if(symbol.type.id() == "submodule")
symbol.is_input = false;
else
symbol.is_input = true;

symbol.is_state_var = false;
symbol.value = nil_exprt{};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line and the one above aren't actually necessary, the symbolt constructor will have set these already. (Though lines 1973 and 1975 should then also be removed.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it helps with clarity. It's quite a bit of mental burden to remember what values are set by the various constructors.

symbol.location = item.expr.source_location();

symbol_table.insert(std::move(symbol));
Expand Down
Loading
Loading