Skip to content

Commit

Permalink
SVA: until_with
Browse files Browse the repository at this point in the history
This adds SVA's until_with to the word-level BMC backend.
  • Loading branch information
kroening committed Sep 24, 2024
1 parent 8d678b6 commit 249575b
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/trans-word-level/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,12 @@ static obligationst property_obligations_rec(
DATA_INVARIANT(no_timeframes != 0, "must have timeframe");
return obligationst{no_timeframes - 1, or_exprt{tmp_q, expansion}};
}
else if(property_expr.id() == ID_R)
else if(
property_expr.id() == ID_R || property_expr.id() == ID_sva_until_with ||
property_expr.id() == ID_sva_s_until_with)
{
// we expand: p R q <=> q ∧ (p ∨ X(p R q))
auto &R_expr = to_R_expr(property_expr);
auto &R_expr = to_binary_expr(property_expr);
auto tmp_q =
property_obligations_rec(R_expr.rhs(), solver, current, no_timeframes, ns)
.conjunction()
Expand All @@ -436,23 +438,6 @@ static obligationst property_obligations_rec(
DATA_INVARIANT(no_timeframes != 0, "must have timeframe");
return obligationst{no_timeframes - 1, and_exprt{tmp_q, expansion}};
}
else if(
property_expr.id() == ID_sva_until_with ||
property_expr.id() == ID_sva_s_until_with)
{
// overlapping until

// we rewrite using 'next'
binary_exprt tmp = to_binary_expr(property_expr);
if(property_expr.id() == ID_sva_until_with)
tmp.id(ID_sva_until);
else
tmp.id(ID_sva_s_until);

tmp.op1() = X_exprt{tmp.op1()};

return property_obligations_rec(tmp, solver, current, no_timeframes, ns);
}
else if(property_expr.id() == ID_and)
{
// Generate seperate sets of obligations for each conjunct,
Expand Down Expand Up @@ -602,6 +587,20 @@ static obligationst property_obligations_rec(
return property_obligations_rec(
to_not_expr(op).op(), solver, current, no_timeframes, ns);
}
else if(op.id() == ID_sva_until || op.id() == ID_sva_s_until)
{
// ¬(φ U ψ) ≡ (¬φ R ¬ψ)
auto &U = to_binary_expr(op);
auto R = sva_until_with_exprt{not_exprt{U.lhs()}, not_exprt{U.rhs()}};
return property_obligations_rec(R, solver, current, no_timeframes, ns);
}
else if(op.id() == ID_sva_until_with || op.id() == ID_sva_s_until_with)
{
// ¬(φ R ψ) ≡ (¬φ U ¬ψ)
auto &R = to_binary_expr(op);
auto U = sva_until_exprt{not_exprt{R.lhs()}, not_exprt{R.rhs()}};
return property_obligations_rec(U, solver, current, no_timeframes, ns);
}
else
return obligationst{
instantiate_property(property_expr, current, no_timeframes, ns)};
Expand Down

0 comments on commit 249575b

Please sign in to comment.