Skip to content

BMC: reconsider encoding of F #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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions regression/smv/LTL/smv_ltlspec_F5.desc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
KNOWNBUG
CORE
smv_ltlspec_F5.smv
--bound 3 --numbered-trace
--bound 1 --numbered-trace
^\[spec1\] F \(!some_input \& X !some_input\): REFUTED$
^Counterexample with 2 states:$
^EXIT=10$
^SIGNAL=0$
--
^warning: ignoring
--
The BMC engine gives the wrong answer.
2 changes: 1 addition & 1 deletion regression/smv/LTL/smv_ltlspec_F5.smv
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ MODULE main
VAR some_input : boolean;

-- Expected to fail
-- The shortest loop is FALSE, FALSE
-- The shortest loop is FALSE, FALSE or TRUE, TRUE
LTLSPEC F (!some_input & X !some_input)
8 changes: 8 additions & 0 deletions regression/smv/LTL/smv_ltlspec_F7.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
smv_ltlspec_F7.smv
--bound 1 --show-formula
^\(1\) lasso::1-back-to-0 ⇔ \(smv::main::var::some_input@1 = smv::main::var::some_input@0\)$
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
6 changes: 6 additions & 0 deletions regression/smv/LTL/smv_ltlspec_F7.smv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MODULE main

VAR some_input : 1..3;

-- Expected to fail
LTLSPEC F (some_input >= 2)
4 changes: 2 additions & 2 deletions regression/smv/LTL/smv_ltlspec_FG1.bmc.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
KNOWNBUG
smv_ltlspec_FG1.smv
--bound 2
^\[spec1\] F G x!=1: PROVED$
--bound 3
^\[spec1\] F G x != 1: PROVED up to bound 3$
^EXIT=0$
^SIGNAL=0$
--
Expand Down
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
4 changes: 3 additions & 1 deletion regression/smv/LTL/smv_ltlspec_or1.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
CORE
KNOWNBUG
smv_ltlspec_or1.smv
--bound 10
^\[spec1\] F !x \| G x: PROVED up to bound 10$
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
The BMC engine gives the wrong answer.
2 changes: 1 addition & 1 deletion regression/smv/expressions/smv_union1.desc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CORE broken-smt-backend
smv_union1.smv

^\[spec1\] x != 3: PROVED \(CT=1\)$
^\[spec1\] x != 3: PROVED \(CT=0\)$
^\[spec2\] x != 2: REFUTED$
^EXIT=10$
^SIGNAL=0$
Expand Down
21 changes: 3 additions & 18 deletions src/trans-word-level/lasso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void lasso_constraints(

std::vector<symbol_exprt> variables_to_compare;

// Gather the state variables.
// Gather the state variables, and the inputs.
const symbol_tablet &symbol_table = ns.get_symbol_table();
auto lower = symbol_table.symbol_module_map.lower_bound(module_identifier);
auto upper = symbol_table.symbol_module_map.upper_bound(module_identifier);
Expand All @@ -104,26 +104,11 @@ void lasso_constraints(
{
const symbolt &symbol = ns.lookup(it->second);

if(symbol.is_state_var)
if(symbol.is_state_var || symbol.is_input)
variables_to_compare.push_back(symbol.symbol_expr());
}

// gather the top-level inputs
const auto &module_symbol = ns.lookup(module_identifier);
DATA_INVARIANT(module_symbol.type.id() == ID_module, "expected a module");
const auto &ports = module_symbol.type.find(ID_ports);

for(auto &port : static_cast<const exprt &>(ports).operands())
{
DATA_INVARIANT(port.id() == ID_symbol, "port must be a symbol");
if(port.get_bool(ID_input) && !port.get_bool(ID_output))
{
symbol_exprt input_symbol(port.get(ID_identifier), port.type());
input_symbol.add_source_location() = port.source_location();
variables_to_compare.push_back(std::move(input_symbol));
}
}

// Create the constraint
for(mp_integer i = 1; i < no_timeframes; ++i)
{
for(mp_integer k = 0; k < i; ++k)
Expand Down
Loading
Loading