Skip to content

Commit

Permalink
BMC now splits up top-level conjunction
Browse files Browse the repository at this point in the history
BMC on a property with a top-level conjunction now splits up conjunctions,
to form separate sets of obligations.
  • Loading branch information
kroening committed Apr 22, 2024
1 parent 5728a30 commit ef84299
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions regression/ebmc/smv/module1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
module1.smv
--bound 10
^EXIT=0$
^SIGNAL=0$
^\[main::spec1\] AG subA.flag & AG subB.flag: PROVED up to bound 10$
--
^warning: ignoring
13 changes: 13 additions & 0 deletions regression/ebmc/smv/module1.smv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
MODULE main

VAR subA : my-module;
subB : my-module;

SPEC AG subA.flag & AG subB.flag

MODULE my-module

VAR flag : boolean;

ASSIGN init(flag) := 1;
ASSIGN next(flag) := 1;
14 changes: 14 additions & 0 deletions src/trans-word-level/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ bool bmc_supports_property(const exprt &expr)
{
if(!has_temporal_operator(expr))
return true; // initial state only
else if(
expr.id() == ID_and || expr.id() == ID_or || expr.id() == ID_implies)
{
for(auto &op : expr.operands())
if(!bmc_supports_property(op))
return false;
return true;
}
else
return false;
}
Expand Down Expand Up @@ -153,6 +161,12 @@ static void property_obligations_rec(
property_obligations_rec(phi, solver, c, no_timeframes, ns, obligations);
}
}
else if(property_expr.id() == ID_and)
{
for(auto &op : to_and_expr(property_expr).operands())
property_obligations_rec(
op, solver, current, no_timeframes, ns, obligations);
}
else
{
// current state property
Expand Down

0 comments on commit ef84299

Please sign in to comment.