-
Notifications
You must be signed in to change notification settings - Fork 44
3902 use smt solver for equations #3904
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
…-for-equations - adapted code to changes in `Booster.SMT.checkPredicates` - will require another adaptation if/when follow-up PR is merged
|
Especially:
|
booster/test/rpc-integration/resources/use-path-condition-in-equations.k
Show resolved
Hide resolved
Regarding |
Something mysterious is happening in the
|
It would appear that the booster is inferring a constraint that is required for applying a simplification using Z3. This is sound and (for me) welcome, but in this particular case, it introduces over-approximation. In my opinion, the solution is to add all constraints inferred using Z3 explicitly to the path constraint. This would:
and symmetrically for |
It seems to me like we are leaning towards getting this merged and then adding lemmas to KEVM to make the proof pass. Perhaps it would make sense to open the PR to KEVM first to make, just to make sure that simply adding these lemmas does not break anything? |
I agree this would be the best way forward at the moment. |
KEVM test using branch with new
|
Test | 3902-use-smt-solver-for-equations time | master-c71e5da10 time | (3902-use-smt-solver-for-equations/master-c71e5da10) time |
---|---|---|---|
benchmarks/address00-spec.k | 34.91 | 96.03 | 0.3635322295116109 |
kontrol/test-allowchangestest-testfailallowcallstoaddress-0-spec.k | 37.51 | 99.84 | 0.37570112179487175 |
benchmarks/ecrecoverloop02-sigs-valid-spec.k | 165.23 | 286.21 | 0.5773033786380629 |
benchmarks/ecrecoverloop02-sig1-invalid-spec.k | 161.79 | 270.45 | 0.5982251802551304 |
erc20/hkg/transferFrom-success-2-spec.k | 43.16 | 68.12 | 0.6335877862595419 |
kontrol/test-allowchangestest-testallow_fail-0-spec.k | 37.66 | 59.36 | 0.6344339622641509 |
benchmarks/ecrecoverloop02-sig0-invalid-spec.k | 98.22 | 151.47 | 0.6484452366805308 |
mcd/flopper-tick-pass-rough-spec.k | 133.35 | 192.52 | 0.6926553085393725 |
mcd/pot-join-pass-rough-spec.k | 148.33 | 212.49 | 0.6980563791237235 |
mcd/flopper-dent-guy-same-pass-rough-spec.k | 452.84 | 600.05 | 0.7546704441296559 |
mcd/flopper-file-pass-rough-spec.k | 290.11 | 353.17 | 0.8214457626638729 |
mcd/flopper-dent-guy-diff-tic-not-0-pass-rough-spec.k | 581.19 | 704.08 | 0.8254601749801159 |
erc20/ds/approve-success-spec.k | 40.13 | 46.95 | 0.8547390841320553 |
benchmarks/bytes00-spec.k | 39.48 | 44.92 | 0.8788958147818343 |
erc20/hkg/transferFrom-success-1-spec.k | 44.5 | 48.27 | 0.9218976590014502 |
erc20/hkg/approve-spec.k | 38.14 | 40.99 | 0.9304708465479384 |
erc20/ds/transfer-success-2-spec.k | 45.78 | 48.78 | 0.93849938499385 |
erc20/ds/transfer-success-1-spec.k | 46.87 | 49.64 | 0.9441982272360998 |
mcd/flipper-addu48u48-fail-rough-spec.k | 39.36 | 41.51 | 0.9482052517465671 |
mcd/functional-spec.k | 380.08 | 397.53 | 0.9561039418408673 |
kontrol/test-allowchangestest-testallow-0-spec.k | 37.36 | 38.9 | 0.9604113110539846 |
erc20/ds/transferFrom-failure-1-d-spec.k | 39.76 | 38.33 | 1.0373075919645187 |
mcd/vow-flog-fail-rough-spec.k | 91.41 | 87.87 | 1.0402867872994195 |
mcd/end-pack-pass-rough-spec.k | 107.08 | 102.87 | 1.040925439875571 |
examples/erc721-spec.md | 117.09 | 112.07 | 1.0447934326760062 |
benchmarks/structarg01-spec.k | 44.27 | 42.36 | 1.0450897072710106 |
mcd/vow-fess-fail-rough-spec.k | 85.51 | 81.78 | 1.045610173636586 |
benchmarks/ecrecoverloop00-sig1-invalid-spec.k | 69.36 | 66.06 | 1.0499545867393278 |
mcd/flopper-cage-pass-spec.k | 40.95 | 38.19 | 1.072270227808327 |
TOTAL | 3491.43 | 4420.81 | 0.7897715577009645 |
This PR adds the SMT solver to the equation application function.
Unclear side conditions for equations (those that could not be simplified to values in isolation) are checked (two-sided) using the SMT solver in context of the known path condition.
This should reduce the amount of unclear conditions, and thereby enable more simplificaitons in boooster.
Fixes #3902