File tree Expand file tree Collapse file tree 6 files changed +41
-17
lines changed Expand file tree Collapse file tree 6 files changed +41
-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 @@ -557,7 +557,8 @@ static obligationst property_obligations_rec(
557
557
for (auto &match : matches)
558
558
{
559
559
// The sequence must not match.
560
- obligations.add (match.end_time , not_exprt{match.condition });
560
+ if (!match.empty_match ())
561
+ obligations.add (match.end_time , not_exprt{match.condition });
561
562
}
562
563
563
564
return obligations;
@@ -700,8 +701,12 @@ static obligationst property_obligations_rec(
700
701
701
702
for (auto &match : matches)
702
703
{
703
- disjuncts.push_back (match.condition );
704
- max = std::max (max, match.end_time );
704
+ // empty matches are not considered
705
+ if (!match.empty_match ())
706
+ {
707
+ disjuncts.push_back (match.condition );
708
+ max = std::max (max, match.end_time );
709
+ }
705
710
}
706
711
707
712
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,30 @@ 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 ),
23
+ end_time (std::move(__end_time)),
24
+ condition(std::move(__condition))
23
25
{
24
26
}
25
27
28
+ bool empty_match () const
29
+ {
30
+ return _is_empty_match;
31
+ }
32
+
33
+ protected:
34
+ bool _is_empty_match;
35
+
36
+ public:
26
37
mp_integer end_time;
27
38
exprt condition;
39
+
40
+ static sequence_matcht empty_match (mp_integer end_time)
41
+ {
42
+ auto result = sequence_matcht{end_time, true_exprt{}};
43
+ result._is_empty_match = true ;
44
+ return result;
45
+ }
28
46
};
29
47
30
48
// / A set of matches of an SVA sequence.
You can’t perform that action at this time.
0 commit comments