Skip to content

Commit 6d6ca0c

Browse files
committed
implement #-# and #=# in SVA-to-Buechi
This adds the two followed-by SVA operators to the SVA-to-Buechi translation.
1 parent b97a3e7 commit 6d6ca0c

File tree

8 files changed

+98
-4
lines changed

8 files changed

+98
-4
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
../../verilog/SVA/followed-by1.sv
3+
--buechi --bdd
4+
^\[main\.p0\] main\.x == 0 #=# \(main\.x == 1 #=# main\.x == 2\): PROVED$
5+
^\[main\.p1\] main\.x == 0 #-# \(\(##1 main\.x == 1\) #-# \(##1 main\.x == 2\)\): PROVED$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
10+
--
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
../../verilog/SVA/followed-by1.sv
3+
--buechi --bound 20 --numbered-trace
4+
^\[main\.p0\] main\.x == 0 #=# \(main\.x == 1 #=# main\.x == 2\): PROVED up to bound 20$
5+
^\[main\.p1\] main\.x == 0 #-# \(\(##1 main\.x == 1\) #-# \(##1 main\.x == 2\)\): PROVED up to bound 20$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
10+
--
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
../../verilog/SVA/followed-by2.sv
3+
--buechi --bdd
4+
^\[main\.p0\] always \(\(main\.a #-# main\.b\) iff \(not \(main\.a |-> \(not main\.b\)\)\)\): PROVED$
5+
^\[main\.p1\] always \(\(main\.a #=# main\.b\) iff \(not \(main\.a |=> \(not main\.b\)\)\)\): PROVED$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
10+
--
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
../../verilog/SVA/followed-by2.sv
3+
--buechi --bound 20
4+
^\[main\.p0\] always \(\(main\.a #-# main\.b\) iff \(not \(main\.a |-> \(not main\.b\)\)\)\): PROVED up to bound 20$
5+
^\[main\.p1\] always \(\(main\.a #=# main\.b\) iff \(not \(main\.a |=> \(not main\.b\)\)\)\): PROVED up to bound 20$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
10+
--
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
../../verilog/SVA/followed-by3.sv
3+
--buechi --bound 20
4+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #-# \(s_eventually main\.x == 10\): PROVED up to bound 20$
5+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #=# \(s_eventually main\.x == 10\): PROVED up to bound 20$
6+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #-# \(s_eventually main\.x == 2\): PROVED up to bound 20$
7+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #-# \(s_eventually main\.x == 11\): REFUTED$
8+
^\[.*\] \(main\.x == 0 ##1 main\.x == 1\) #=# \(s_eventually main\.x == 1\): REFUTED$
9+
^\[.*\] \(main\.x == 0 ##1 main\.x == 2\) #-# 1: REFUTED$
10+
^EXIT=10$
11+
^SIGNAL=0$
12+
--
13+
^warning: ignoring
14+
--
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
../../verilog/SVA/followed-by4.sv
3+
--buechi --bdd
4+
^\[main\.p1\] always \(main\.x == 0 #-# 1\): REFUTED$
5+
^\[main\.p2\] \(1 or \(##2 1\)\) #-# main\.x == 2: PROVED$
6+
^\[main\.p3\] \(1 or \(##2 1\)\) #-# main\.x == 0: PROVED$
7+
^EXIT=10$
8+
^SIGNAL=0$
9+
--
10+
^warning: ignoring
11+
--
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
KNOWNBUG
2+
../../verilog/SVA/followed-by4.sv
3+
--buechi --bound 3
4+
^\[main\.p1\] always \(main\.x == 0 #-# 1\): REFUTED$
5+
^\[main\.p2\] \(1 or \(##2 1\)\) #-# main\.x == 2: PROVED up to bound 3$
6+
^\[main\.p3\] \(1 or \(##2 1\)\) #-# main\.x == 0: PROVED up to bound 3$
7+
^EXIT=10$
8+
^SIGNAL=0$
9+
--
10+
^warning: ignoring
11+
--
12+
p1 is not refuted.

src/temporal-logic/ltl_sva_to_string.cpp

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,29 @@ ltl_sva_to_stringt::rec(const exprt &expr, modet mode)
232232
ID_sva_implicit_weak, new_expr.sequence()};
233233
return infix("|=>", new_expr, mode);
234234
}
235-
else if(
236-
expr.id() == ID_sva_nonoverlapped_followed_by ||
237-
expr.id() == ID_sva_overlapped_followed_by)
235+
else if(expr.id() == ID_sva_overlapped_followed_by)
238236
{
239237
PRECONDITION(mode == PROPERTY);
240-
throw ebmc_errort{} << "cannot convert " << expr.id() << " to Buechi";
238+
// 1800 2017 16.12.9
239+
// (a #-# b) ---> !(a |-> !b)
240+
auto &followed_by = to_sva_followed_by_expr(expr);
241+
auto not_b = not_exprt{followed_by.consequent()};
242+
return rec(
243+
not_exprt{
244+
sva_overlapped_implication_exprt{followed_by.antecedent(), not_b}},
245+
mode);
246+
}
247+
else if(expr.id() == ID_sva_nonoverlapped_followed_by)
248+
{
249+
PRECONDITION(mode == PROPERTY);
250+
// 1800 2017 16.12.9
251+
// (a #=# b) ---> !(a |=> !b)
252+
auto &followed_by = to_sva_followed_by_expr(expr);
253+
auto not_b = not_exprt{followed_by.consequent()};
254+
return rec(
255+
not_exprt{
256+
sva_non_overlapped_implication_exprt{followed_by.antecedent(), not_b}},
257+
mode);
241258
}
242259
else if(expr.id() == ID_sva_sequence_property)
243260
{

0 commit comments

Comments
 (0)