@@ -114,10 +114,29 @@ class liveness_to_safetyt
114114 }
115115};
116116
117+ // / returns true iff the given property is supported
118+ // / by the liveness-to-safety translation
119+ static bool property_supported (const exprt &expr)
120+ {
121+ return expr.id () == ID_sva_always &&
122+ (to_sva_always_expr (expr).op ().id () == ID_sva_eventually ||
123+ to_sva_always_expr (expr).op ().id () == ID_sva_s_eventually);
124+ }
125+
126+ static bool have_supported_property (const ebmc_propertiest &properties)
127+ {
128+ for (auto &property : properties.properties )
129+ if (!property.is_disabled ())
130+ if (property_supported (property.normalized_expr ))
131+ return true ;
132+
133+ return false ;
134+ }
135+
117136void liveness_to_safetyt::operator ()()
118137{
119- // Do we have a liveness property?
120- if (!properties. requires_lasso_constraints ( ))
138+ // Do we have a supported property?
139+ if (!have_supported_property (properties ))
121140 return ; // no
122141
123142 // gather the state variables
@@ -231,15 +250,10 @@ void liveness_to_safetyt::operator()()
231250
232251 for (auto &property : properties.properties )
233252 {
234- if (!property.is_disabled () && property. requires_lasso_constraints () )
253+ if (!property.is_disabled ())
235254 {
236255 // We want GFp.
237- if (
238- property.normalized_expr .id () == ID_sva_always &&
239- (to_sva_always_expr (property.normalized_expr ).op ().id () ==
240- ID_sva_eventually ||
241- to_sva_always_expr (property.normalized_expr ).op ().id () ==
242- ID_sva_s_eventually))
256+ if (property_supported (property.normalized_expr ))
243257 {
244258 translate_GFp (property);
245259 }
0 commit comments