Skip to content

BMC: encode properties using timeframe/handle pair #429

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
Mar 25, 2024
Merged

Conversation

kroening
Copy link
Member

The property encoding interface is changed to return a timeframe/handle pair, instead of just a condition per timeframe.

This allows determining the appropriate size of the counterexample trace.

@kroening kroening marked this pull request as ready for review March 25, 2024 00:39
@@ -115,7 +115,45 @@ void property(
instantiate(p, c, no_timeframes, ns);

auto handle = solver.handle(tmp);
prop_handles.push_back(std::move(handle));
obligations[c].push_back(std::move(handle));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this isn't really a hot path, but this could safely be written as

obligations.insert(c, {solver.handle(tmp)});

as each index is unique. I'm actually no longer sure why this needs to be exprt::operandst as value type when it can only ever be a single exprt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give me a sec, there will be more than one expression per index, and they'll come separately.

@@ -87,14 +88,13 @@ void property(
property_expr.id() == ID_sva_nexttime ||
property_expr.id() == ID_sva_s_nexttime)
{
prop_handles.resize(no_timeframes, true_exprt());
if(no_timeframes > 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really for this PR, but still wondering: is no_timeframes == 0 actually a legitimate case at all? Should this perhaps be ruled out via a PRECONDITION?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll make it a PRECONDITION. BMC without any timeframes is not a thing.

The property encoding interface is changed to return a timeframe/handle
pair, instead of just a condition per timeframe.

This allows determining the appropriate size of the counterexample trace.
@kroening kroening merged commit 73938ed into main Mar 25, 2024
@kroening kroening deleted the bmc_obligationst branch March 25, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants