Skip to content

Commit 8f3b783

Browse files
hyperpolymathclaude
andcommitted
feat(batch_driver): add agda, idris2, acl2, vampire runners
Expand direct-prover invocation set from 3 to 7. Each runner shells out to the real binary and interprets exit status (or SZS output in Vampire's case) into success/failure/timeout/unknown. run_agda : cd + agda <file> (module name = filename) run_idris2 : cd + idris2 --check (module resolution) run_acl2 : printf :q\\n(exit)\\n | cat file - | acl2 run_vampire : parses "% SZS status Theorem|Unsatisfiable" from output Active targets in this pass: z3, coq, lean, agda, idris2 (5 provers). Deferred (runners present, env missing): acl2 — /usr/local/bin/acl2 is a podman wrapper that hangs pulling rubengamboa/acl2:latest; needs native install vampire — installed, but our repos have no clean TPTP corpus (.p files under external_corpora/tptp/ are HTML dumps) Agda + Idris2 targets mostly fail because their source files assume project/stdlib context not present at file-level invocation — agda-stdlib symbols (ℕ, _≡_) unavailable, Idris2 project-relative imports unresolved. Failures are legitimate: CI without those setups would also fail. First real PROVEN certificate minted with expanded runner set: safety/z3: status=proven, rate=0.952 (20/21), meeting τ≥0.80 ∧ n≥20. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d72883f commit 8f3b783

1 file changed

Lines changed: 91 additions & 4 deletions

File tree

bots/echidnabot/scripts/batch_driver.sh

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,28 @@ TARGETS=(
4040
"echidna|safety|z3|proofs/z3|smt2"
4141
"echidna|equiv|coq|proofs/coq|v"
4242
"echidna|equiv|lean|proofs/lean|lean"
43+
"echidna|equiv|agda|proofs/agda|agda"
44+
"echidna|totality|idris2|verification/proofs/idris2|idr"
4345
"ephapax|equiv|coq|formal|v"
46+
"ephapax|linearity|idris2|src/formal/Ephapax/Formal|idr"
4447
)
48+
#
49+
# Deferred targets (runners exist but need environment setup):
50+
# acl2 — /usr/local/bin/acl2 is a podman wrapper that pulls
51+
# rubengamboa/acl2:latest on every invocation (hangs on pull).
52+
# Needs a native ACL2 install + properly-certified book dir.
53+
# vampire — /usr/local/bin/vampire installed, but we have no clean TPTP
54+
# corpus in any of our repos (/external_corpora/tptp/*.p files
55+
# are HTML dumps, not problems).
56+
#
57+
# The agda + idris2 targets above will mostly fail because they depend on
58+
# project/standard-library context not present at file-level invocation:
59+
# • agda files use ℕ / std-lib symbols without explicit import paths set
60+
# — needs agda-stdlib registered in ~/.agda/libraries
61+
# • idris2 files expect project-relative module imports (e.g. module
62+
# Echidna.Verification.*) — need a pack.toml or ipkg build root.
63+
# Their failures are therefore "real" in the sense that CI without those
64+
# setups would also fail; treat accordingly.
4565

4666
# --- helpers ----------------------------------------------------------------
4767

@@ -119,14 +139,81 @@ run_lean() {
119139
[ $rc -eq 0 ] && echo success || echo failure
120140
}
121141

142+
run_agda() {
143+
local file="$1"
144+
local t0 t1 rc
145+
t0=$(date +%s%3N)
146+
# Must cd into file's directory so Agda resolves module name from filename.
147+
( cd "$(dirname "$file")" && timeout "${TIMEOUT_SEC}s" agda "$(basename "$file")" >/dev/null 2>&1 )
148+
rc=$?
149+
t1=$(date +%s%3N)
150+
echo $((t1 - t0))
151+
[ $rc -eq 124 ] && { echo timeout; return; }
152+
[ $rc -eq 0 ] && echo success || echo failure
153+
}
154+
155+
run_idris2() {
156+
local file="$1"
157+
local t0 t1 rc
158+
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 )
162+
rc=$?
163+
t1=$(date +%s%3N)
164+
echo $((t1 - t0))
165+
[ $rc -eq 124 ] && { echo timeout; return; }
166+
[ $rc -eq 0 ] && echo success || echo failure
167+
}
168+
169+
run_acl2() {
170+
local file="$1"
171+
local t0 t1 rc
172+
t0=$(date +%s%3N)
173+
# ACL2 reads events from stdin; pipe the file in with a (exit) sentinel.
174+
# Non-zero exit on certification failure. :q exits the logic mode cleanly.
175+
( printf ':q\n(exit)\n' | cat "$file" - | timeout "${TIMEOUT_SEC}s" acl2 >/dev/null 2>&1 )
176+
rc=$?
177+
t1=$(date +%s%3N)
178+
echo $((t1 - t0))
179+
[ $rc -eq 124 ] && { echo timeout; return; }
180+
[ $rc -eq 0 ] && echo success || echo failure
181+
}
182+
183+
run_vampire() {
184+
local file="$1"
185+
local t0 t1 output rc
186+
t0=$(date +%s%3N)
187+
output=$(timeout "${TIMEOUT_SEC}s" vampire --mode casc -t "${TIMEOUT_SEC}s" "$file" 2>&1)
188+
rc=$?
189+
t1=$(date +%s%3N)
190+
echo $((t1 - t0))
191+
[ $rc -eq 124 ] && { echo timeout; return; }
192+
# Vampire prints "% SZS status Theorem" on success, "% SZS status CounterSatisfiable"
193+
# or "Unsatisfiable" etc. on other outcomes. Exit code isn't reliable; parse SZS.
194+
if echo "$output" | grep -qE "^% SZS status (Theorem|Unsatisfiable)"; then
195+
echo success
196+
elif echo "$output" | grep -qE "^% SZS status (CounterSatisfiable|Satisfiable)"; then
197+
echo failure
198+
elif echo "$output" | grep -qE "SZS status (Timeout|GaveUp)"; then
199+
echo timeout
200+
else
201+
echo unknown
202+
fi
203+
}
204+
122205
# Dispatch to the right runner by prover name.
123206
run_prover() {
124207
local prover="$1" file="$2"
125208
case "$prover" in
126-
z3) run_z3 "$file" ;;
127-
coq) run_coq "$file" ;;
128-
lean) run_lean "$file" ;;
129-
*) echo 0; echo unknown ;;
209+
z3) run_z3 "$file" ;;
210+
coq) run_coq "$file" ;;
211+
lean) run_lean "$file" ;;
212+
agda) run_agda "$file" ;;
213+
idris2) run_idris2 "$file" ;;
214+
acl2) run_acl2 "$file" ;;
215+
vampire) run_vampire "$file" ;;
216+
*) echo 0; echo unknown ;;
130217
esac
131218
}
132219

0 commit comments

Comments
 (0)