Skip to content

Commit c588d24

Browse files
committed
liveness-to-safety: exit if there is no supported property
The liveness-to-safety translation now exists early if there is no property it supports.
1 parent 955c752 commit c588d24

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

src/ebmc/liveness_to_safety.cpp

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
117136
void 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

Comments
 (0)