Skip to content

Commit 5ceed6a

Browse files
hyperpolymathclaude
andcommitted
feat(batch_driver): cvc5, vampire, dafny, why3 runners + smart idris2 sourcedir
New runners (shell out to real binaries, parse native output): - cvc5 : same .smt2 corpus as z3, independent implementation - dafny : parses "finished with N verified, 0 errors" from stdout - why3 : runs with -P z3 backend, checks "Prover result is: Valid" - vampire : parses SZS status (already present, now used with real corpus) idris2 runner now auto-discovers the project root by walking up to the nearest .ipkg file and running `idris2 --source-dir <root> --check`. This resolves project-relative imports (e.g. `Ephapax.Formal.Region`) that plain --check can't find. Falls back to the file's own directory. Active targets expanded to 11 (from 8), adding: safety/cvc5 (examples + proofs/z3 smt2 files) safety/vampire (proofs/tptp/*.p — 8 new hand-written problems) First SANCTIFY certificate minted: safety class, 3 proven provers (z3, cvc5, vampire), 119 combined attempts — class-level portfolio attestation activated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8f3b783 commit 5ceed6a

1 file changed

Lines changed: 81 additions & 3 deletions

File tree

bots/echidnabot/scripts/batch_driver.sh

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ REPOS_ROOT="/var/mnt/eclipse/repos"
3838
TARGETS=(
3939
"echidna|safety|z3|examples|smt2"
4040
"echidna|safety|z3|proofs/z3|smt2"
41+
"echidna|safety|cvc5|examples|smt2"
42+
"echidna|safety|cvc5|proofs/z3|smt2"
43+
"echidna|safety|vampire|proofs/tptp|p"
4144
"echidna|equiv|coq|proofs/coq|v"
4245
"echidna|equiv|lean|proofs/lean|lean"
4346
"echidna|equiv|agda|proofs/agda|agda"
@@ -115,6 +118,67 @@ run_z3() {
115118
fi
116119
}
117120

121+
run_cvc5() {
122+
local file="$1"
123+
local t0 t1 output rc
124+
t0=$(date +%s%3N)
125+
output=$(timeout "${TIMEOUT_SEC}s" cvc5 "$file" 2>&1)
126+
rc=$?
127+
t1=$(date +%s%3N)
128+
echo $((t1 - t0))
129+
[ $rc -eq 124 ] && { echo timeout; return; }
130+
# Same interpretation as Z3: "ran and produced a decision" = success.
131+
if echo "$output" | grep -qE "^(sat|unsat|unknown)$"; then
132+
echo success
133+
elif echo "$output" | grep -qiE "error|parse"; then
134+
echo failure
135+
else
136+
echo unknown
137+
fi
138+
}
139+
140+
run_dafny() {
141+
local file="$1"
142+
local t0 t1 output rc
143+
t0=$(date +%s%3N)
144+
output=$(timeout "${TIMEOUT_SEC}s" dafny verify --verification-time-limit=$((TIMEOUT_SEC - 1)) "$file" 2>&1)
145+
rc=$?
146+
t1=$(date +%s%3N)
147+
echo $((t1 - t0))
148+
[ $rc -eq 124 ] && { echo timeout; return; }
149+
# Dafny prints "Dafny program verifier finished with N verified, M errors".
150+
if echo "$output" | grep -qE "finished with [0-9]+ verified, 0 errors"; then
151+
echo success
152+
elif echo "$output" | grep -qE "finished with [0-9]+ verified, [1-9][0-9]* errors"; then
153+
echo failure
154+
else
155+
echo unknown
156+
fi
157+
}
158+
159+
run_why3() {
160+
local file="$1"
161+
local t0 t1 output rc
162+
t0=$(date +%s%3N)
163+
output=$(timeout "${TIMEOUT_SEC}s" why3 prove -P z3 "$file" 2>&1)
164+
rc=$?
165+
t1=$(date +%s%3N)
166+
echo $((t1 - t0))
167+
[ $rc -eq 124 ] && { echo timeout; return; }
168+
# why3 prints "Prover result is: Valid" on success, "Invalid" / "Timeout" /
169+
# "Unknown" / "Failure" otherwise. Multiple goals → multiple lines.
170+
if echo "$output" | grep -q "Prover result is: Valid" && \
171+
! echo "$output" | grep -qE "Invalid|Timeout|Unknown|Failure"; then
172+
echo success
173+
elif echo "$output" | grep -qE "Invalid|Failure"; then
174+
echo failure
175+
elif echo "$output" | grep -q "Timeout"; then
176+
echo timeout
177+
else
178+
echo unknown
179+
fi
180+
}
181+
118182
run_coq() {
119183
local file="$1"
120184
local t0 t1 rc
@@ -155,10 +219,21 @@ run_agda() {
155219
run_idris2() {
156220
local file="$1"
157221
local t0 t1 rc
222+
# Walk up to find the nearest .ipkg → that directory is the source root.
223+
# Fallback to the file's own directory when no ipkg is present.
224+
local dir source_dir rel
225+
dir=$(dirname "$file")
226+
source_dir="$dir"
227+
while [ "$dir" != "/" ] && [ "$dir" != "" ]; do
228+
if ls "$dir"/*.ipkg >/dev/null 2>&1; then
229+
source_dir="$dir"
230+
break
231+
fi
232+
dir=$(dirname "$dir")
233+
done
234+
rel="${file#"$source_dir"/}"
158235
t0=$(date +%s%3N)
159-
# idris2 --check needs the file in its source directory; cd makes it find
160-
# project-relative imports, and the module name must match the filename.
161-
( cd "$(dirname "$file")" && timeout "${TIMEOUT_SEC}s" idris2 --check "$(basename "$file")" >/dev/null 2>&1 )
236+
( cd "$source_dir" && timeout "${TIMEOUT_SEC}s" idris2 --source-dir . --check "$rel" >/dev/null 2>&1 )
162237
rc=$?
163238
t1=$(date +%s%3N)
164239
echo $((t1 - t0))
@@ -207,12 +282,15 @@ run_prover() {
207282
local prover="$1" file="$2"
208283
case "$prover" in
209284
z3) run_z3 "$file" ;;
285+
cvc5) run_cvc5 "$file" ;;
210286
coq) run_coq "$file" ;;
211287
lean) run_lean "$file" ;;
212288
agda) run_agda "$file" ;;
213289
idris2) run_idris2 "$file" ;;
214290
acl2) run_acl2 "$file" ;;
215291
vampire) run_vampire "$file" ;;
292+
dafny) run_dafny "$file" ;;
293+
why3) run_why3 "$file" ;;
216294
*) echo 0; echo unknown ;;
217295
esac
218296
}

0 commit comments

Comments
 (0)