@@ -137,72 +137,82 @@ std::optional<exprt> SVA_to_LTL(exprt expr)
137137 expr.id () == ID_sva_non_overlapped_implication)
138138 {
139139 auto &implication = to_sva_implication_base_expr (expr);
140- auto matches = LTL_sequence_matches (implication.sequence ());
141140
142- if (matches.empty ())
143- return {};
141+ try
142+ {
143+ auto matches = LTL_sequence_matches (implication.sequence ());
144144
145- // All matches must be followed
146- // by the property being true
147- exprt::operandst conjuncts;
145+ // All matches must be followed
146+ // by the property being true
147+ exprt::operandst conjuncts;
148148
149- auto property_rec = SVA_to_LTL (implication.property ());
149+ auto property_rec = SVA_to_LTL (implication.property ());
150150
151- if (!property_rec.has_value ())
152- return {};
151+ if (!property_rec.has_value ())
152+ return {};
153153
154- for (auto &match : matches)
155- {
156- const auto overlapped = expr.id () == ID_sva_overlapped_implication;
157- if (match.empty_match () && overlapped)
158- {
159- // ignore the empty match
160- }
161- else
154+ for (auto &match : matches)
162155 {
163- auto delay = match.length () + (overlapped ? 0 : 1 ) - 1 ;
164- auto delayed_property = n_Xes (delay, property_rec.value ());
165- conjuncts.push_back (implies_exprt{ltl (match), delayed_property});
156+ const auto overlapped = expr.id () == ID_sva_overlapped_implication;
157+ if (match.empty_match () && overlapped)
158+ {
159+ // ignore the empty match
160+ }
161+ else
162+ {
163+ auto delay = match.length () + (overlapped ? 0 : 1 ) - 1 ;
164+ auto delayed_property = n_Xes (delay, property_rec.value ());
165+ conjuncts.push_back (implies_exprt{ltl (match), delayed_property});
166+ }
166167 }
167- }
168168
169- return conjunction (conjuncts);
169+ return conjunction (conjuncts);
170+ }
171+ catch (sva_sequence_match_unsupportedt)
172+ {
173+ return {};
174+ }
170175 }
171176 else if (
172177 expr.id () == ID_sva_nonoverlapped_followed_by ||
173178 expr.id () == ID_sva_overlapped_followed_by)
174179 {
175180 auto &followed_by = to_sva_followed_by_expr (expr);
176- auto matches = LTL_sequence_matches (followed_by.sequence ());
177181
178- if (matches.empty ())
179- return {};
182+ try
183+ {
184+ auto matches = LTL_sequence_matches (followed_by.sequence ());
180185
181- // There must be at least one match that is followed
182- // by the property being true
183- exprt::operandst disjuncts;
186+ // There must be at least one match that is followed
187+ // by the property being true
188+ exprt::operandst disjuncts;
184189
185- auto property_rec = SVA_to_LTL (followed_by.property ());
190+ auto property_rec = SVA_to_LTL (followed_by.property ());
186191
187- if (!property_rec.has_value ())
188- return {};
192+ if (!property_rec.has_value ())
193+ return {};
189194
190- for (auto &match : matches)
191- {
192- const auto overlapped = expr.id () == ID_sva_overlapped_followed_by;
193- if (match.empty_match () && overlapped)
194- {
195- // ignore the empty match
196- }
197- else
195+ for (auto &match : matches)
198196 {
199- auto delay = match.length () + (overlapped ? 0 : 1 ) - 1 ;
200- auto delayed_property = n_Xes (delay, property_rec.value ());
201- disjuncts.push_back (and_exprt{ltl (match), delayed_property});
197+ const auto overlapped = expr.id () == ID_sva_overlapped_followed_by;
198+ if (match.empty_match () && overlapped)
199+ {
200+ // ignore the empty match
201+ }
202+ else
203+ {
204+ auto delay = match.length () + (overlapped ? 0 : 1 ) - 1 ;
205+ auto delayed_property = n_Xes (delay, property_rec.value ());
206+ disjuncts.push_back (and_exprt{ltl (match), delayed_property});
207+ }
202208 }
203- }
204209
205- return disjunction (disjuncts);
210+ return disjunction (disjuncts);
211+ }
212+ catch (sva_sequence_match_unsupportedt)
213+ {
214+ return {};
215+ }
206216 }
207217 else if (expr.id () == ID_sva_sequence_property)
208218 {
@@ -215,21 +225,25 @@ std::optional<exprt> SVA_to_LTL(exprt expr)
215225 {
216226 auto &sequence = to_sva_sequence_property_expr_base (expr).sequence ();
217227
218- // evaluates to true if there's at least one non-empty match of the sequence
219- auto matches = LTL_sequence_matches (sequence);
228+ try
229+ {
230+ // evaluates to true if there's at least one non-empty match of the sequence
231+ auto matches = LTL_sequence_matches (sequence);
220232
221- if (matches.empty ())
222- return {};
233+ exprt::operandst disjuncts;
223234
224- exprt::operandst disjuncts;
235+ for (auto &match : matches)
236+ {
237+ if (!match.empty_match ())
238+ disjuncts.push_back (ltl (match));
239+ }
225240
226- for (auto &match : matches)
241+ return disjunction (disjuncts);
242+ }
243+ catch (sva_sequence_match_unsupportedt)
227244 {
228- if (!match.empty_match ())
229- disjuncts.push_back (ltl (match));
245+ return {};
230246 }
231-
232- return disjunction (disjuncts);
233247 }
234248 else if (expr.id () == ID_sva_s_until)
235249 {
0 commit comments