Skip to content

Commit d03bc47

Browse files
committed
cvc4 -> cvc5
1 parent 59afe3a commit d03bc47

File tree

8 files changed

+47
-43
lines changed

8 files changed

+47
-43
lines changed

.github/scripts/install-cvc4.sh

-33
This file was deleted.

.github/scripts/install-cvc5.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
4+
set -eux
5+
6+
mkdir -p $HOME/.local/bin;
7+
8+
travis_retry() {
9+
cmd=$*
10+
$cmd || (sleep 2 && $cmd) || (sleep 10 && $cmd)
11+
}
12+
13+
fetch_cvc5_linux() {
14+
VER="$1"
15+
wget "https://github.com/cvc5/cvc5/releases/download/$VER/cvc5-$VER-x86_64-linux-opt"
16+
chmod +x "cvc5-$VER-x86_64-linux-opt"
17+
mv "cvc5-$VER-x86_64-linux-opt" "$HOME/.local/bin/cvc5"
18+
echo "Downloaded cvc5 $VER"
19+
}
20+
21+
fetch_cvc5_macos() {
22+
VER="$1"
23+
wget "https://github.com/cvc5/cvc5/releases/download/$VER/cvc5-$VER-macos-opt"
24+
chmod +x "cvc5-$VER-macos-opt"
25+
mv "cvc5-$VER-macos-opt" "$HOME/.local/bin/cvc5"
26+
echo "Downloaded cvc5 $VER"
27+
}
28+
29+
if [ "$HOST_OS" = "Linux" ]; then
30+
travis_retry fetch_cvc5_linux "1.8"
31+
else
32+
travis_retry fetch_cvc5_macos "1.8"
33+
fi

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: |
5151
.github/scripts/install-solc.sh
5252
.github/scripts/install-z3.sh
53-
.github/scripts/install-cvc4.sh
53+
.github/scripts/install-cvc5.sh
5454
env:
5555
HOST_OS: ${{ runner.os }}
5656

src/dapp-tests/integration/tests.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,16 @@ test_hevm_symbolic() {
190190

191191
solc --bin-runtime -o . --overwrite "$CONTRACTS/factor.sol"
192192
# should find counterexample
193-
hevm symbolic --code "$(<A.bin-runtime)" --sig "factor(uint x, uint y)" --smttimeout 40000 --solver cvc4 && fail || echo "hevm success: found counterexample"
193+
hevm symbolic --code "$(<A.bin-runtime)" --sig "factor(uint x, uint y)" --smttimeout 40000 --solver cvc5 && fail || echo "hevm success: found counterexample"
194194
hevm symbolic --code "$(<"$CONTRACTS/dstoken.bin-runtime")" --sig "transferFrom(address, address, uint)" --get-models &> /dev/null || fail
195195

196196
solc --bin-runtime -o . --overwrite "$CONTRACTS/token.sol"
197-
# This one explores all paths (cvc4 is better at this)
198-
hevm symbolic --code "$(<Token.bin-runtime)" --solver cvc4 || fail
197+
# This one explores all paths (cvc5 is better at this)
198+
hevm symbolic --code "$(<Token.bin-runtime)" --solver cvc5 || fail
199199

200200
# The contracts A and B should be equivalent:
201201
solc --bin-runtime -o . --overwrite "$CONTRACTS/AB.sol"
202-
hevm equivalence --code-a "$(<A.bin-runtime)" --code-b "$(<B.bin-runtime)" --solver cvc4 || fail
202+
hevm equivalence --code-a "$(<A.bin-runtime)" --code-b "$(<B.bin-runtime)" --solver cvc5 || fail
203203
}
204204

205205
test_custom_solc_json() {

src/dapp/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
- `dapp --nix-run` invocations
1818

19+
### Changed
20+
21+
- Switch SMT solver from cvc4 to cvc5
22+
1923
## [0.35.0] - 2021-11-12
2024

2125
### Added

src/dapp/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ variables](../hevm/README.md#environment-variables).
326326
| `DAPP_TEST_DEPTH` | `20` | Number of transactions to sequence per invariant cycle |
327327
| `DAPP_TEST_SMTTIMEOUT` | `60000` | Timeout passed to the smt solver for symbolic tests (in ms, and per smt query) |
328328
| `DAPP_TEST_MAX_ITERATIONS` | n/a | The number of times hevm will revisit a particular branching point when symbolically executing |
329-
| `DAPP_TEST_SOLVER` | `z3` | Solver to use for symbolic execution (`cvc4` or `z3`) |
329+
| `DAPP_TEST_SOLVER` | `z3` | Solver to use for symbolic execution (`cvc5` or `z3`) |
330330
| `DAPP_TEST_MATCH` | n/a | Regex used to determine test methods to run |
331331
| `DAPP_TEST_COV_MATCH` | n/a | Regex used to determine which files to print coverage reports for. Prints all imported files by default (excluding tests and libs). |
332332
| `DAPP_TEST_REPLAY` | n/a | Calldata for a specific property test case to replay in the debugger |
@@ -447,7 +447,7 @@ You can override this with the `DAPP_REMAPPINGS` environment variable.
447447

448448
SMT options:
449449
--smttimeout <number> timeout passed to the smt solver in ms (default 60000)
450-
--solver <string> name of the smt solver to use (either "z3" or "cvc4")
450+
--solver <string> name of the smt solver to use (either "z3" or "cvc5")
451451
--max-iterations <number> number of times we may revisit a particular branching point during symbolic execution
452452

453453
dapp tests are written in Solidity using the `ds-test` module. To install it, run

src/dapp/libexec/dapp/dapp

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
###
3232
### SMT options:
3333
### smttimeout=<number> timeout passed to the smt solver in ms (default 60000)
34-
### solver=<string> name of the smt solver to use (either 'z3' or 'cvc4')
34+
### solver=<string> name of the smt solver to use (either 'z3' or 'cvc5')
3535
### max-iterations=<number> number of times we may revisit a particular branching point
3636
### smtdebug print the SMT queries produced by hevm
3737
###
@@ -80,7 +80,7 @@ rpc-block=<number> block number (latest if not specified)
8080
8181
SMT options:
8282
smttimeout=<number> timeout passed to the smt solver in ms (default 60000)
83-
solver=<string> name of the smt solver to use (either 'z3' or 'cvc4')
83+
solver=<string> name of the smt solver to use (either 'z3' or 'cvc5')
8484
max-iterations=<number> number of times we may revisit a particular branching point
8585
smtdebug print the SMT queries produced by hevm
8686

src/dapp/libexec/dapp/dapp-test

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
###
1919
### SMT options:
2020
### --smttimeout <number> timeout passed to the smt solver in ms (default 600000)
21-
### --solver <string> name of the smt solver to use (either "z3" or "cvc4")
21+
### --solver <string> name of the smt solver to use (either "z3" or "cvc5")
2222
### --max-iterations <number> number of times we may revisit a particular branching point
2323
set -e
2424
have() { command -v "$1" >/dev/null; }

0 commit comments

Comments
 (0)