@@ -84,18 +84,62 @@ static inline sva_disable_iff_exprt &to_sva_disable_iff_expr(exprt &expr)
8484 return static_cast <sva_disable_iff_exprt &>(expr);
8585}
8686
87- class sva_nexttime_exprt : public binary_predicate_exprt
87+ // / nonindexed variant
88+ class sva_nexttime_exprt : public unary_predicate_exprt
8889{
8990public:
90- // nonindexed variant
9191 explicit sva_nexttime_exprt (exprt op)
92- : binary_predicate_exprt(nil_exprt(), ID_sva_nexttime, std::move(op))
92+ : unary_predicate_exprt( ID_sva_nexttime, std::move(op))
9393 {
9494 }
95+ };
96+
97+ static inline const sva_nexttime_exprt &to_sva_nexttime_expr (const exprt &expr)
98+ {
99+ PRECONDITION (expr.id () == ID_sva_nexttime);
100+ sva_nexttime_exprt::check (expr, validation_modet::INVARIANT);
101+ return static_cast <const sva_nexttime_exprt &>(expr);
102+ }
103+
104+ static inline sva_nexttime_exprt &to_sva_nexttime_expr (exprt &expr)
105+ {
106+ PRECONDITION (expr.id () == ID_sva_nexttime);
107+ sva_nexttime_exprt::check (expr, validation_modet::INVARIANT);
108+ return static_cast <sva_nexttime_exprt &>(expr);
109+ }
110+
111+ // / nonindexed variant
112+ class sva_s_nexttime_exprt : public unary_predicate_exprt
113+ {
114+ public:
115+ explicit sva_s_nexttime_exprt (exprt op)
116+ : unary_predicate_exprt(ID_sva_s_nexttime, std::move(op))
117+ {
118+ }
119+ };
120+
121+ static inline const sva_s_nexttime_exprt &
122+ to_sva_s_nexttime_expr (const exprt &expr)
123+ {
124+ PRECONDITION (expr.id () == ID_sva_s_nexttime);
125+ sva_s_nexttime_exprt::check (expr, validation_modet::INVARIANT);
126+ return static_cast <const sva_s_nexttime_exprt &>(expr);
127+ }
128+
129+ static inline sva_s_nexttime_exprt &to_sva_s_nexttime_expr (exprt &expr)
130+ {
131+ PRECONDITION (expr.id () == ID_sva_s_nexttime);
132+ sva_s_nexttime_exprt::check (expr, validation_modet::INVARIANT);
133+ return static_cast <sva_s_nexttime_exprt &>(expr);
134+ }
95135
96- bool is_indexed () const
136+ // / indexed variant of sva_nexttime_exprt
137+ class sva_indexed_nexttime_exprt : public binary_predicate_exprt
138+ {
139+ public:
140+ sva_indexed_nexttime_exprt (exprt index, exprt op)
141+ : binary_predicate_exprt(std::move(index), ID_sva_nexttime, std::move(op))
97142 {
98- return index ().is_not_nil ();
99143 }
100144
101145 const exprt &index () const
@@ -123,32 +167,32 @@ class sva_nexttime_exprt : public binary_predicate_exprt
123167 using binary_predicate_exprt::op1;
124168};
125169
126- static inline const sva_nexttime_exprt &to_sva_nexttime_expr (const exprt &expr)
170+ static inline const sva_indexed_nexttime_exprt &
171+ to_sva_indexed_nexttime_expr (const exprt &expr)
127172{
128- PRECONDITION (expr.id () == ID_sva_nexttime );
129- sva_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
130- return static_cast <const sva_nexttime_exprt &>(expr);
173+ PRECONDITION (expr.id () == ID_sva_indexed_nexttime );
174+ sva_indexed_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
175+ return static_cast <const sva_indexed_nexttime_exprt &>(expr);
131176}
132177
133- static inline sva_nexttime_exprt &to_sva_nexttime_expr (exprt &expr)
178+ static inline sva_indexed_nexttime_exprt &
179+ to_sva_indexed_nexttime_expr (exprt &expr)
134180{
135- PRECONDITION (expr.id () == ID_sva_nexttime );
136- sva_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
137- return static_cast <sva_nexttime_exprt &>(expr);
181+ PRECONDITION (expr.id () == ID_sva_indexed_nexttime );
182+ sva_indexed_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
183+ return static_cast <sva_indexed_nexttime_exprt &>(expr);
138184}
139185
140- class sva_s_nexttime_exprt : public binary_predicate_exprt
186+ // / indexed variant of sva_s_nexttime_exprt
187+ class sva_indexed_s_nexttime_exprt : public binary_predicate_exprt
141188{
142189public:
143- // nonindexed variant
144- explicit sva_s_nexttime_exprt (exprt op)
145- : binary_predicate_exprt(nil_exprt(), ID_sva_s_nexttime, std::move(op))
146- {
147- }
148-
149- bool is_indexed () const
190+ sva_indexed_s_nexttime_exprt (exprt index, exprt op)
191+ : binary_predicate_exprt(
192+ std::move (index),
193+ ID_sva_indexed_s_nexttime,
194+ std::move(op))
150195 {
151- return index ().is_not_nil ();
152196 }
153197
154198 const exprt &index () const
@@ -176,19 +220,20 @@ class sva_s_nexttime_exprt : public binary_predicate_exprt
176220 using binary_predicate_exprt::op1;
177221};
178222
179- static inline const sva_s_nexttime_exprt &
180- to_sva_s_nexttime_expr (const exprt &expr)
223+ static inline const sva_indexed_s_nexttime_exprt &
224+ to_sva_indexed_s_nexttime_expr (const exprt &expr)
181225{
182- PRECONDITION (expr.id () == ID_sva_s_nexttime );
183- sva_s_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
184- return static_cast <const sva_s_nexttime_exprt &>(expr);
226+ PRECONDITION (expr.id () == ID_sva_indexed_s_nexttime );
227+ sva_indexed_s_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
228+ return static_cast <const sva_indexed_s_nexttime_exprt &>(expr);
185229}
186230
187- static inline sva_s_nexttime_exprt &to_sva_s_nexttime_expr (exprt &expr)
231+ static inline sva_indexed_s_nexttime_exprt &
232+ to_sva_indexed_s_nexttime_expr (exprt &expr)
188233{
189- PRECONDITION (expr.id () == ID_sva_s_nexttime );
190- sva_s_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
191- return static_cast <sva_s_nexttime_exprt &>(expr);
234+ PRECONDITION (expr.id () == ID_sva_indexed_s_nexttime );
235+ sva_indexed_s_nexttime_exprt ::check (expr, validation_modet::INVARIANT);
236+ return static_cast <sva_indexed_s_nexttime_exprt &>(expr);
192237}
193238
194239class sva_ranged_predicate_exprt : public ternary_exprt
0 commit comments