-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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] Solver option #11421
[SMTChecker] Solver option #11421
Conversation
8635bd0
to
ae3d490
Compare
This needs to install latest z3 binaries for CI when running |
004e767
to
740ef2d
Compare
Need to install a newer z3 |
4bfc7ab
to
bc0363f
Compare
Latest development: all the code and tests are ready to be reviewed. The solc-js tests need a newer z3 binary installed to pass, since I changed the circleci script to install it but it's too old on Debian. |
bc0363f
to
e8f4977
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Did solc-js already support this smt2lib callback?
.circleci/config.yml
Outdated
@@ -819,7 +819,7 @@ jobs: | |||
name: Install test dependencies | |||
command: | | |||
apt-get update | |||
apt-get install -qqy --no-install-recommends nodejs npm cvc4 | |||
apt-get install -qqy --no-install-recommends nodejs npm cvc4 z3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you have to add z3 now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the smt queries fixed, we can also run it via the solc-js callback by having a solver installed in the system. However, cvc4 does not have a Horn solver so the test is kinda null at the end. I installed z3 so that the solc-js smt callback tests can also run a Horn solver locally. This is still not enough because this installs z3 4.4 cus... Debian. Still have to find a solution to install the same z3 as our tests here
@hrkrshnn Ah, forgot to answer this. Yea solc-js already supports this, but the queries themselves were broken before the last merged PR. |
f88f703
to
36dcdcc
Compare
I applied the review suggestions. Open problems:
|
0b75703
to
66fa0fe
Compare
|
66fa0fe
to
15e1059
Compare
7bea780
to
fb86d72
Compare
fb86d72
to
3225180
Compare
|
test/cmdlineTests/standard_model_checker_solvers_cvc4/output.json
Outdated
Show resolved
Hide resolved
f2619a3
to
0014237
Compare
The solc-js tests with tests for external calls, invariants and loops look good, takes 4 min which is a good amount. |
0014237
to
1263416
Compare
Can just squash everything at the end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only two remaining issues are the ignored error codes from cmdline tests (which might just be a problem unrelated to this PR) and the error message (which is just a minor thing) so I'm already marking it as approved regardless of how they're eventually resolved.
1263416
to
6c8ecfa
Compare
Changed the error message and squashed. |
Depends on #11289
This PR introduces an option to allow the user to choose the solver they want to run. This is expected to not be used that much, but it's important for SMTChecker runs via the JS callback. That is needed, for example, to run the SMTChecker with other Horn solvers, for example Eldarica which I have been experimenting with.
In the current form, since we have static z3 inside soljson, z3 always runs and the CHC queries are not reported. After this PR, if the chosen solver is
smtlib2
, the queries will be output (for the callback) even if z3 is available statically. This is basically the goal here.The refactoring of the solc-js SMTChecker tests ethereum/solc-js#524 depends on this PR, so we point to that PR here.