Skip to content
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

SMTChecker: Fix error that reports invalid number of verified checks #15191

Conversation

pgebal
Copy link
Collaborator

@pgebal pgebal commented Jun 10, 2024

Solves #15188 for BMC egine.

@pgebal pgebal requested a review from blishko June 10, 2024 15:51
@pgebal pgebal force-pushed the smtchecker/fix-invalid-number-of-verified-checks branch 4 times, most recently from dc8fbc3 to af02228 Compare June 11, 2024 16:01
@@ -149,7 +149,10 @@ class BMC: public SMTEncoder

friend bool operator<(BMCVerificationTarget const& _a, BMCVerificationTarget const& _b)
{
return _a.expression->id() < _b.expression->id();
if (_a.expression->id() == _b.expression->id())
Copy link
Collaborator Author

@pgebal pgebal Jun 11, 2024

Choose a reason for hiding this comment

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

Here was the problem. We didn't accumulate more than 1 proved BMC target for a given expression.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, good catch!

Copy link
Contributor

@blishko blishko left a comment

Choose a reason for hiding this comment

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

Let's not make unnecessary copies.
Otherwise, this is good!

libsolidity/formal/BMC.cpp Outdated Show resolved Hide resolved
@@ -149,7 +149,10 @@ class BMC: public SMTEncoder

friend bool operator<(BMCVerificationTarget const& _a, BMCVerificationTarget const& _b)
{
return _a.expression->id() < _b.expression->id();
if (_a.expression->id() == _b.expression->id())
Copy link
Contributor

Choose a reason for hiding this comment

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

Right, good catch!

@pgebal pgebal force-pushed the smtchecker/fix-invalid-number-of-verified-checks branch from 1eb00eb to 48f97a3 Compare June 17, 2024 18:25
@pgebal pgebal requested a review from blishko June 17, 2024 19:27
Copy link
Contributor

@blishko blishko left a comment

Choose a reason for hiding this comment

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

LGTM!

@blishko blishko merged commit d0190e1 into ethereum:develop Jun 17, 2024
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants