Skip to content

Commit 7c5d09b

Browse files
authored
Merge pull request #1158 from diffblue/followed-by5.bmc-fix
word-level BMC: fix `#-#` and `#=#` for empty matches
2 parents cbb6c03 + 0cd2985 commit 7c5d09b

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Verilog: `elsif preprocessor directive
44
* Verilog: fix for named generate blocks
55
* Verilog: $onehot and $onehot0 are now elaboration-time constant
6+
* SystemVerilog: fix for #-# and #=# for empty matches
67
* LTL/SVA to Buechi with --buechi
78

89
# EBMC 5.6
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
KNOWNBUG
1+
CORE
22
followed-by5.sv
33
--bound 2
4-
^\[main\.p0\] \(1 \[\*0\]\) #=# main\.x == 0: PROVED$
4+
^\[main\.p0\] \(1 \[\*0\]\) #=# main\.x == 0: PROVED up to bound 2$
55
^\[main\.p1\] \(1 \[\*0\]\) #-# 1: REFUTED$
66
^EXIT=10$
77
^SIGNAL=0$
88
--
99
^warning: ignoring
1010
--
11-
Empty LHS sequences are not implemented.

src/trans-word-level/property.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ static obligationst property_obligations_rec(
644644
// the result is a property expression.
645645
auto &followed_by = to_sva_followed_by_expr(property_expr);
646646

647-
// get (proper) match points for LHS sequence
647+
// get match points for LHS sequence
648648
auto matches = instantiate_sequence(
649649
followed_by.antecedent(),
650650
sva_sequence_semanticst::STRONG,
@@ -656,10 +656,20 @@ static obligationst property_obligations_rec(
656656

657657
for(auto &match : matches)
658658
{
659+
bool overlapped = property_expr.id() == ID_sva_overlapped_followed_by;
660+
661+
// empty match?
662+
if(match.empty_match() && overlapped)
663+
{
664+
// won't yield a disjunct
665+
continue;
666+
}
667+
659668
mp_integer property_start = match.end_time;
660669

661-
// #=# advances the clock by one from the sequence match point
662-
if(property_expr.id() == ID_sva_nonoverlapped_followed_by)
670+
// #=# advances the clock by one from the sequence match point,
671+
// unless the LHS is an empty match.
672+
if(!match.empty_match() && !overlapped)
663673
property_start += 1;
664674

665675
// at the end?

0 commit comments

Comments
 (0)