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

feat: --solver-command lets user replace z3 invocations #272

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

karmacoma-eth
Copy link
Collaborator

This removes:

  • --solver-subprocess
  • --solver-subprocess-command
  • --solver-fresh (was unused AFAICT)

This adds:

  • --solver-command with no default (meaning we run z3 in-process)
  • some prints about where SMT files are generated
  • auto-dumping of SMT files when invoking an external solver
  • a very crude way to determine if the external solver generated a valid model (instead of assuming it is valid, so that we still benefit from refinement)

Before:

$ halmos --root examples/simple --contract VaultTest --function check_mint -vvv --statistics
[...]
[FAIL] check_mint(uint256) (paths: 8, time: 282.15s (paths: 0.45s, models: 281.70s), bounds: [])

After:

$ halmos --root examples/simple --contract VaultTest --function check_mint -vvv --statistics --solver-command="bitwuzla -m"
[...]
[FAIL] check_mint(uint256) (paths: 8, time: 19.69s (paths: 0.46s, models: 19.22s), bounds: [])

This removes:

- `--solver-subprocess`
- `--solver-subprocess-command`
- `--solver-fresh` (was unused AFAICT)

This adds:

- `--solver-command` with no default (meaning we run z3 in-process)
- some prints about where SMT files are generated
- auto-dumping of SMT files when invoking an external solver
- a very crude way to determine if the external solver generated a valid model (instead of assuming it is valid, so that we still benefit from refinement)

Before:

```sh
$ halmos --root examples/simple --contract VaultTest --function check_mint -vvv --statistics
[...]
[FAIL] check_mint(uint256) (paths: 8, time: 282.15s (paths: 0.45s, models: 281.70s), bounds: [])
```

After:

```sh
$ halmos --root examples/simple --contract VaultTest --function check_mint -vvv --statistics --solver-command="bitwuzla -m"
[...]
[FAIL] check_mint(uint256) (paths: 8, time: 19.69s (paths: 0.46s, models: 19.22s), bounds: [])
```
@karmacoma-eth karmacoma-eth enabled auto-merge (rebase) April 10, 2024 18:02
@karmacoma-eth karmacoma-eth merged commit 3e160f5 into main Apr 11, 2024
50 checks passed
@karmacoma-eth karmacoma-eth deleted the rework-solver-subcommand branch April 11, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants