Skip to content

liveness-to-safety: exit if there is no supported property #1200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions src/ebmc/liveness_to_safety.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,29 @@ class liveness_to_safetyt
}
};

/// returns true iff the given property is supported
/// by the liveness-to-safety translation
static bool property_supported(const exprt &expr)
{
return expr.id() == ID_sva_always &&
(to_sva_always_expr(expr).op().id() == ID_sva_eventually ||
to_sva_always_expr(expr).op().id() == ID_sva_s_eventually);
}

static bool have_supported_property(const ebmc_propertiest &properties)
{
for(auto &property : properties.properties)
if(!property.is_disabled())
if(property_supported(property.normalized_expr))
return true;

return false;
}

void liveness_to_safetyt::operator()()
{
// Do we have a liveness property?
if(!properties.requires_lasso_constraints())
// Do we have a supported property?
if(!have_supported_property(properties))
return; // no

// gather the state variables
Expand Down Expand Up @@ -231,15 +250,10 @@ void liveness_to_safetyt::operator()()

for(auto &property : properties.properties)
{
if(!property.is_disabled() && property.requires_lasso_constraints())
if(!property.is_disabled())
{
// We want GFp.
if(
property.normalized_expr.id() == ID_sva_always &&
(to_sva_always_expr(property.normalized_expr).op().id() ==
ID_sva_eventually ||
to_sva_always_expr(property.normalized_expr).op().id() ==
ID_sva_s_eventually))
if(property_supported(property.normalized_expr))
{
translate_GFp(property);
}
Expand Down
Loading