Skip to content

Commit a55d67c

Browse files
committed
SVA->Buechi: implement first_match(...) sequence operator
This adds the translation of the SVA first_match operator to Spot's input language.
1 parent 897cb8c commit a55d67c

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

regression/ebmc-spot/sva-buechi/sequence_first_match1.desc

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
../../verilog/SVA/sequence_first_match1.sv
3+
--buechi --k-induction --bound 1
4+
^\[.*\] first_match\(main\.x == 0\): PROVED$
5+
^\[.*\] first_match\(main\.x == 0, main\.x\+\+\): PROVED$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
10+
--
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
CORE
22
../../verilog/SVA/sequence_first_match2.sv
3-
--buechi --bound 5
4-
^error: failed to convert sva_sequence_first_match$
5-
^EXIT=6$
6-
^SIGNAL=0$
7-
--
3+
--buechi --k-induction --bound 2
84
^\[.*\] \(\(##1 1\) or \(##2 1\)\) \|-> main.x == 1: REFUTED$
9-
^\[.*\] first_match\(\(##1 1\) or \(##2 1\)\) \|-> main\.x == 1: PROVED up to bound 5$
5+
^\[.*\] first_match\(\(##1 1\) or \(##2 1\)\) \|-> main\.x == 1: PROVED$
106
^\[.*\] \(1 or \(##1 1\)\) \|-> main\.x == 0: REFUTED$
11-
^\[.*\] first_match\(1 or \(##1 1\)\) \|-> main\.x == 0: PROVED up to bound 5$
7+
^\[.*\] first_match\(1 or \(##1 1\)\) \|-> main\.x == 0: PROVED$
8+
^EXIT=0$
9+
^SIGNAL=0$
10+
--
1211
^warning: ignoring
1312
--

src/temporal-logic/ltl_sva_to_string.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,13 @@ ltl_sva_to_stringt::rec(const exprt &expr, modet mode)
546546
DATA_INVARIANT(
547547
false, "unexpected sva_sequence_non_consecutive_repetition");
548548
}
549+
else if(expr.id() == ID_sva_sequence_first_match) // first_match(...)
550+
{
551+
PRECONDITION(mode == SVA_SEQUENCE);
552+
auto &sequence = to_sva_sequence_first_match_expr(expr).sequence();
553+
auto op_rec = rec(sequence, SVA_SEQUENCE);
554+
return resultt{precedencet::ATOM, "first_match(" + op_rec.s + ')'};
555+
}
549556
else if(!is_temporal_operator(expr))
550557
{
551558
auto number = atoms.number(expr);

0 commit comments

Comments
 (0)