File tree Expand file tree Collapse file tree 6 files changed +36
-17
lines changed Expand file tree Collapse file tree 6 files changed +36
-17
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
empty_sequence1.sv
3
3
--bound 5
4
+ ^\[main\.p0\] 1 \[\*0\]: REFUTED$
5
+ ^\[main\.p1\] 1 \[\*0\] ##1 main\.x == 0: REFUTED$
4
6
^EXIT=10$
5
7
^SIGNAL=0$
6
8
--
7
9
^warning: ignoring
8
10
--
9
- Repetition with zero is not implemented.
Original file line number Diff line number Diff line change 2
2
sequence_repetition2.sv
3
3
--bound 10
4
4
^\[main\.p0\] main\.x == 0 \[\*\]: PROVED up to bound 10$
5
- ^\[main\.p1\] main\.x == 1 \[\*\] : PROVED up to bound 10$
6
- ^\[main\.p2\] \( main\.x == 0 \[\+\]\) #=# main\.x == 1 : PROVED up to bound 10$
7
- ^\[main\.p3\] main\.x == 0 \[\+ \]: PROVED up to bound 10$
8
- ^\[main\.p4\] main\.half_x == 0 \[\*\]: PROVED up to bound 10 $
9
- ^\[main\.p5\] 0 \[\*\]: PROVED up to bound 10 $
5
+ ^\[main\.p1\] \( main\.x == 0 \[\+\]\) #=# main\.x == 1 : PROVED up to bound 10$
6
+ ^\[main\.p2\] main\.x == 0 \[\+\]: PROVED up to bound 10$
7
+ ^\[main\.p3\] main\.half_x == 0 \[\* \]: PROVED up to bound 10$
8
+ ^\[main\.p4\] main\.x == 1 \[\*\]: REFUTED $
9
+ ^\[main\.p5\] 0 \[\*\]: REFUTED $
10
10
^\[main\.p6\] main\.x == 1 \[\+\]: REFUTED$
11
11
^\[main\.p7\] \(main\.x == 0 \[\+\]\) #-# main\.x == 1: REFUTED$
12
12
^\[main\.p8\] 0 \[\+\]: REFUTED$
Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ module main(input clk);
11
11
12
12
// should pass
13
13
initial p0 : assert property (x== 0 [* ]);
14
- initial p1 : assert property (x== 1 [* ]);
15
- initial p2 : assert property (x== 0 [+ ] # = # x== 1 );
16
- initial p3 : assert property (x== 0 [+ ]);
17
- initial p4 : assert property (half_x== 0 [* ]);
18
- initial p5 : assert property (0 [* ]); // empty match
14
+ initial p1 : assert property (x== 0 [+ ] # = # x== 1 );
15
+ initial p2 : assert property (x== 0 [+ ]);
16
+ initial p3 : assert property (half_x== 0 [* ]);
19
17
20
18
// should fail
19
+ initial p4 : assert property (x== 1 [* ]);
20
+ initial p5 : assert property (0 [* ]); // empty match
21
21
initial p6 : assert property (x== 1 [+ ]);
22
22
initial p7 : assert property (x== 0 [+ ] # - # x== 1 );
23
23
initial p8 : assert property (0 [+ ]);
Original file line number Diff line number Diff line change @@ -563,7 +563,8 @@ static obligationst property_obligations_rec(
563
563
for (auto &match : matches)
564
564
{
565
565
// The sequence must not match.
566
- obligations.add (match.end_time , not_exprt{match.condition });
566
+ if (!match.empty_match ())
567
+ obligations.add (match.end_time , not_exprt{match.condition });
567
568
}
568
569
569
570
return obligations;
@@ -706,8 +707,12 @@ static obligationst property_obligations_rec(
706
707
707
708
for (auto &match : matches)
708
709
{
709
- disjuncts.push_back (match.condition );
710
- max = std::max (max, match.end_time );
710
+ // empty matches are not considered
711
+ if (!match.empty_match ())
712
+ {
713
+ disjuncts.push_back (match.condition );
714
+ max = std::max (max, match.end_time );
715
+ }
711
716
}
712
717
713
718
return obligationst{max, disjunction (disjuncts)};
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ sequence_matchest instantiate_sequence(
368
368
if (repetition.is_empty_match ())
369
369
{
370
370
// [*0] denotes the empty match
371
- return {{t, true_exprt{}} };
371
+ return {sequence_matcht::empty_match (t) };
372
372
}
373
373
else if (repetition.is_unbounded () && repetition.repetitions_given ())
374
374
{
Original file line number Diff line number Diff line change @@ -19,12 +19,25 @@ class sequence_matcht
19
19
{
20
20
public:
21
21
sequence_matcht (mp_integer __end_time, exprt __condition)
22
- : end_time(std::move(__end_time)), condition(std::move(__condition))
22
+ : _is_empty_match( false ), end_time(std::move(__end_time)), condition(std::move(__condition))
23
23
{
24
24
}
25
25
26
+ bool empty_match () const
27
+ {
28
+ return _is_empty_match;
29
+ }
30
+
31
+ bool _is_empty_match;
26
32
mp_integer end_time;
27
33
exprt condition;
34
+
35
+ static sequence_matcht empty_match (mp_integer end_time)
36
+ {
37
+ auto result = sequence_matcht{end_time, true_exprt{}};
38
+ result._is_empty_match = true ;
39
+ return result;
40
+ }
28
41
};
29
42
30
43
// / A set of matches of an SVA sequence.
You can’t perform that action at this time.
0 commit comments