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

Change SMTChecker default settings #14053

Closed
wants to merge 2 commits into from
Closed

Conversation

leonardoalt
Copy link
Member

Fixes #13943

We're doing a few things here regarding the default values for the model checker settings:

  • Timeout has a default value of 1 second now. The SMTCheckerTests still need to use the old rlimit for reproducibility, which is done by overriding the timeout value in the settings
  • Only assertions are checked by default. The others need to be enabled explicitly, as already was the case for overflow and underflow.
  • If Eldarica is the chosen solver and the user has not explicitly set a value for divModNoSlacks we automatically make it true because that works better for Eldarica.

@@ -1 +1 @@
--model-checker-engine all
--model-checker-engine all --model-checker-targets divByZero
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to add this now for this test and the ones below because divByZero is not checked by default anymore. That's the only extra target these tests need.

@@ -1,18 +1,3 @@
Warning: CHC: Division by zero happens here.
Copy link
Member Author

Choose a reason for hiding this comment

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

These chunks were deleted from this test and the ones below because these properties are not checked by default anymore. This is fine for the tests because we have the same tests with targets = all which tests the whole set.

@@ -1 +1 @@
--model-checker-engine all --model-checker-timeout 1000
--model-checker-engine all --model-checker-timeout 1000 --model-checker-targets all
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to add this here because more properties are checked besides assertions. Same for the tests below.

@@ -16,6 +16,7 @@
{
"modelChecker":
{
"targets": ["divByZero"],
Copy link
Member Author

Choose a reason for hiding this comment

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

Same case from the CLI tests.

@@ -1,44 +1,6 @@
{
"errors":
[
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Same case from the CLI tests.

@@ -3,7 +3,8 @@
{
"smtlib2queries":
{
"0x75b95497d56c30e254a59358d72ddd4e78f9e90db621cfe677e85d05b2252411": "(set-option :produce-models true)
"0x1709577b0e186388ed08c2cf085f20c115c4c94745fb102c5be552ff2e4c7028": "(set-option :produce-models true)
Copy link
Member Author

Choose a reason for hiding this comment

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

The hashes changed because the timeout is now added by default, which in smtlib have their own specific command (set-timeout).

@@ -11,6 +11,7 @@
{
"modelChecker":
{
"targets": ["assert", "divByZero"],
Copy link
Member Author

Choose a reason for hiding this comment

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

Same case from the CLI tests.

@@ -34,16 +33,27 @@ The other verification targets that the SMTChecker checks at compile time are:
- Out of bounds index access.
- Insufficient funds for a transfer.

All the targets above are automatically checked by default if all engines are
enabled, except underflow and overflow for Solidity >=0.8.7.
By default, for Solidity >=0.8.20 only assertions are checked. For Solidity
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
By default, for Solidity >=0.8.20 only assertions are checked. For Solidity
By default, for Solidity >=0.8.20 only assertions are checked. For Solidity

enabled, except underflow and overflow for Solidity >=0.8.7.
By default, for Solidity >=0.8.20 only assertions are checked. For Solidity
>=0.8.7 all the targets above are checked by default except for underflow and
overflow. Underflow and overflow are also in the default set for Solidity
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
overflow. Underflow and overflow are also in the default set for Solidity
overflow. Underflow and overflow are also in the default set for Solidity

By default, for Solidity >=0.8.20 only assertions are checked. For Solidity
>=0.8.7 all the targets above are checked by default except for underflow and
overflow. Underflow and overflow are also in the default set for Solidity
<0.8.7. The above only applies for the default targets which can be
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<0.8.7. The above only applies for the default targets which can be
<0.8.7. The above only applies for the default targets, which can be

Now I'm kinda curious. Are you using double whitespaces on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I just use vim's automated gq which aligns the lines and ends up adding extra whitespaces sometimes

libsolidity/formal/ModelCheckerSettings.h Show resolved Hide resolved
test/libsolidity/SMTCheckerTest.cpp Show resolved Hide resolved
libsolidity/interface/CompilerStack.cpp Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Apr 2, 2023

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Apr 2, 2023
@nikola-matic nikola-matic removed the stale The issue/PR was marked as stale because it has been open for too long. label Apr 2, 2023
@cameel cameel added the smt label Apr 24, 2023
@github-actions
Copy link

github-actions bot commented May 8, 2023

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label May 8, 2023
@leonardoalt leonardoalt removed the stale The issue/PR was marked as stale because it has been open for too long. label May 8, 2023
@github-actions
Copy link

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label May 23, 2023
@leonardoalt leonardoalt removed the stale The issue/PR was marked as stale because it has been open for too long. label May 24, 2023
@github-actions
Copy link

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Jun 19, 2023
@github-actions
Copy link

This pull request was closed due to a lack of activity for 7 days after it was stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-due-inactivity smt stale The issue/PR was marked as stale because it has been open for too long.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[SMTChecker] New default settings
3 participants