Skip to content

Commit aeac6e3

Browse files
Claude/fix prover wiring epy ir (#28)
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent f12fc15 commit aeac6e3

9 files changed

Lines changed: 130 additions & 22 deletions

File tree

benches/routing_benchmarks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ fn bench_dispatch_config_construction(c: &mut Criterion) {
305305
track_axioms: true,
306306
generate_certificates: true,
307307
timeout: 60,
308+
diagnostics: false,
308309
})
309310
})
310311
});

src/julia/run_training.jl

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
# data_dir = training_data/
1111
# save_dir = models/neural/
1212
#
13+
# Environment overrides (see below):
14+
# ECHIDNA_MAX_PROOF_STATES — cap on proof states loaded (default 200000 on
15+
# GPU, 50000 on CPU). Set to 0 to disable the cap and consume the entire
16+
# expanded corpus; required when re-baselining after corpus growth.
17+
# ECHIDNA_NUM_EPOCHS — training epochs (default 30).
18+
# ECHIDNA_NUM_NEGATIVES — hard-negative premise samples per example
19+
# (default 20).
20+
#
1321
# This script:
1422
# 1. Loads JSONL training data (proof states + premises)
1523
# 2. Builds vocabulary from the corpus
@@ -74,10 +82,24 @@ println("═══════════════════════
7482
println("Loading training data...")
7583
println("═══════════════════════════════════════════════════════════")
7684

85+
# Default cap: 200k on GPU (enough to exercise the expanded corpus without
86+
# OOM on a 24GB card), 50k on CPU (keeps wall-clock finite). An operator
87+
# re-baselining after corpus growth sets ECHIDNA_MAX_PROOF_STATES=0 to lift
88+
# the cap entirely.
89+
default_cap = has_gpu ? 200_000 : 50_000
90+
cap_env = get(ENV, "ECHIDNA_MAX_PROOF_STATES", "")
91+
max_proof_states = isempty(cap_env) ? default_cap : parse(Int, cap_env)
92+
# `load_training_data` treats any value `<= 0` as "load everything".
93+
cap_label = max_proof_states <= 0 ? "unlimited" : string(max_proof_states)
94+
println(" max_proof_states = $cap_label")
95+
96+
num_negatives = parse(Int, get(ENV, "ECHIDNA_NUM_NEGATIVES", "20"))
97+
println(" num_negatives = $num_negatives")
98+
7799
train_data, val_data, vocab = load_training_data(data_dir;
78100
train_split=0.8f0,
79-
max_proof_states=50000, # Cap for reasonable training time
80-
num_negatives=20
101+
max_proof_states=max_proof_states,
102+
num_negatives=num_negatives,
81103
)
82104

83105
if isempty(train_data.examples)
@@ -101,8 +123,9 @@ println("Model created successfully")
101123
println()
102124

103125
# Configure training
126+
num_epochs = parse(Int, get(ENV, "ECHIDNA_NUM_EPOCHS", "30"))
104127
training_config = TrainingConfig(
105-
num_epochs=30,
128+
num_epochs=num_epochs,
106129
learning_rate=1f-4,
107130
lr_schedule=:cosine,
108131
weight_decay=1f-5,

src/rust/agent/memory.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ use async_trait::async_trait;
1212
use serde::{Deserialize, Serialize};
1313
use std::path::PathBuf;
1414
use tokio::sync::RwLock;
15-
use tracing::{debug, info, warn};
15+
use tracing::{debug, info};
16+
#[cfg(feature = "verisim")]
17+
use tracing::warn;
1618

1719
use super::AgenticGoal;
1820
use crate::core::ProofState;

src/rust/proof_encoding.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ mod tests {
154154
hypotheses: vec![],
155155
};
156156

157-
let id1 = proof_identity("my_theorem", &goal, ProverKind::Lean4);
158-
let id2 = proof_identity("my_theorem", &goal, ProverKind::Lean4);
157+
let id1 = proof_identity("my_theorem", &goal, ProverKind::Lean);
158+
let id2 = proof_identity("my_theorem", &goal, ProverKind::Lean);
159159
assert_eq!(id1, id2, "Same inputs must produce same identity");
160160
}
161161

@@ -167,7 +167,7 @@ mod tests {
167167
hypotheses: vec![],
168168
};
169169

170-
let lean = proof_identity("thm", &goal, ProverKind::Lean4);
170+
let lean = proof_identity("thm", &goal, ProverKind::Lean);
171171
let coq = proof_identity("thm", &goal, ProverKind::Coq);
172172
assert_ne!(
173173
lean, coq,

src/rust/provers/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,9 +1355,13 @@ impl ProverFactory {
13551355
// Note: .lean is shared between Lean 3 and Lean 4; default is Lean 4.
13561356
// Use detect_from_file_content() for Lean 3 vs 4 disambiguation.
13571357
"lean3" => Some(ProverKind::Lean3), // explicit extension
1358-
"thm" => Some(ProverKind::Abella), // Abella .thm files
1359-
"dk" | "lp" => Some(ProverKind::Dedukti), // Dedukti / λΠ
1360-
"bpl" => Some(ProverKind::Boogie), // Boogie intermediate language
1358+
"thm" => Some(ProverKind::Abella), // Abella .thm files
1359+
// Dedukti uses .dk; .lp (lambdapi dialect) is shadowed by GLPK above
1360+
// since LP/MIP files dominate that extension in the wild — a .lp
1361+
// input ambiguous between lambdapi and linear programming is
1362+
// resolved as GLPK. Use detect_from_file_content() to disambiguate.
1363+
"dk" => Some(ProverKind::Dedukti), // Dedukti / λΠ
1364+
"bpl" => Some(ProverKind::Boogie), // Boogie intermediate language
13611365
"ftl" => Some(ProverKind::Naproche), // Naproche controlled-NL
13621366
"ma" => Some(ProverKind::Matita), // Matita proof file
13631367
"ard" => Some(ProverKind::Arend), // Arend cubical HoTT

src/rust/vcl_ut.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
2323
use anyhow::{Context, Result};
2424
use serde::{Deserialize, Serialize};
25-
use tracing::{debug, info, warn};
25+
use tracing::{debug, info};
26+
#[cfg(feature = "verisim")]
27+
use tracing::warn;
2628

2729
use crate::provers::ProverKind;
2830

@@ -493,13 +495,11 @@ impl QueryExecutor {
493495

494496
/// Find a specific proof by theorem name and optional prover.
495497
async fn execute_find_proof(&self, query: &ProofQuery) -> Result<QueryResult> {
496-
type_info: None,
497-
let theorem = query.theorem_name.as_deref().unwrap_or("");
498-
499498
#[cfg(feature = "verisim")]
500499
if let Some(prover) = query.prover {
501500
// Generate the octad key and look it up directly
502501
if let Some(ref goal_display) = query.goal_display {
502+
let theorem = query.theorem_name.as_deref().unwrap_or("");
503503
let goal = Goal {
504504
id: "query".to_string(),
505505
target: crate::core::Term::Var(goal_display.clone()),

src/rust/verification/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ pub mod confidence;
1616
pub mod mutation;
1717
pub mod pareto;
1818
pub mod portfolio;
19+
#[cfg(feature = "verisim")]
20+
pub mod proof;
1921
pub mod statistics;
2022

2123
pub use axiom_tracker::{AxiomPolicy, AxiomTracker, AxiomUsage, DangerLevel};
@@ -24,4 +26,8 @@ pub use confidence::TrustLevel;
2426
pub use mutation::{MutationKind, MutationResult, MutationTester};
2527
pub use pareto::{ParetoFrontier, ProofCandidate, ProofObjective};
2628
pub use portfolio::{PortfolioConfig, PortfolioResult, PortfolioSolver};
29+
#[cfg(feature = "verisim")]
30+
pub use proof::{
31+
theorem_identity, Proof, ProofStateRecord, ProofVersion, TacticApplication, TacticStatus,
32+
};
2733
pub use statistics::StatisticsTracker;

src/rust/verisim_bridge.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ use anyhow::{Context, Result};
2323
use chrono::Utc;
2424
use serde::{Deserialize, Serialize};
2525
use std::collections::HashMap;
26-
use tracing::{debug, info, warn};
26+
use tracing::{debug, warn};
2727

28-
use crate::core::{Goal, ProofState, Tactic};
28+
use crate::core::{Goal, ProofState};
2929
use crate::proof_encoding;
3030
use crate::provers::ProverKind;
3131

@@ -252,7 +252,7 @@ pub struct SpatialPayload {
252252
///
253253
/// Usage:
254254
/// ```ignore
255-
/// let octad = ProofOctadBuilder::new("my_theorem", &goal, ProverKind::Lean4)
255+
/// let octad = ProofOctadBuilder::new("my_theorem", &goal, ProverKind::Lean)
256256
/// .with_proof_state(&proof_state)
257257
/// .with_axioms(vec!["Classical.em".to_string()])
258258
/// .with_aspects(vec!["logic".to_string()])
@@ -879,7 +879,7 @@ fn base64_encode(bytes: &[u8]) -> String {
879879
#[cfg(test)]
880880
mod tests {
881881
use super::*;
882-
use crate::core::{Context, Term};
882+
use crate::core::{Context, Tactic, Term};
883883
use std::collections::HashMap;
884884

885885
fn sample_goal() -> Goal {
@@ -921,7 +921,7 @@ mod tests {
921921
let goal = sample_goal();
922922
let proof = sample_proof_state();
923923

924-
let octad = ProofOctadBuilder::new("nat_add_zero", &goal, ProverKind::Lean4)
924+
let octad = ProofOctadBuilder::new("nat_add_zero", &goal, ProverKind::Lean)
925925
.with_proof_state(&proof)
926926
.with_axioms(vec!["Nat.rec".to_string()])
927927
.with_aspects(vec!["arithmetic".to_string(), "induction".to_string()])
@@ -932,9 +932,10 @@ mod tests {
932932
// Key should be a 64-char hex digest
933933
assert_eq!(octad.key.len(), 64);
934934

935-
// Semantic modality
935+
// Semantic modality (ProverKind::Lean is the Lean 4 variant; Lean 3
936+
// is a sibling ProverKind::Lean3.)
936937
assert_eq!(octad.semantic.status, ProofStatus::Complete);
937-
assert_eq!(octad.semantic.prover, "Lean4");
938+
assert_eq!(octad.semantic.prover, "Lean");
938939
assert!(!octad.semantic.proof_blob_b64.is_empty());
939940
assert_eq!(octad.semantic.axioms_used, vec!["Nat.rec"]);
940941

@@ -964,7 +965,7 @@ mod tests {
964965

965966
// Graph modality
966967
assert_eq!(octad.graph.cross_prover_id.len(), 64);
967-
assert!(octad.graph.prover_id.contains("Lean4"));
968+
assert!(octad.graph.prover_id.contains("Lean"));
968969

969970
// Tensor modality
970971
assert_eq!(*octad.tensor.metrics.get("time_ms").unwrap(), 42.0);

tests/live_prover_suite.rs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ fn kind_label(kind: ProverKind) -> &'static str {
111111
ProverKind::Dafny => "Dafny",
112112
ProverKind::FStar => "F*",
113113
ProverKind::TLAPS => "TLAPS",
114+
ProverKind::Tamarin => "Tamarin",
115+
ProverKind::ProVerif => "ProVerif",
116+
ProverKind::Metamath => "Metamath",
117+
ProverKind::Twelf => "Twelf",
118+
ProverKind::ORTools => "OR-Tools",
119+
ProverKind::HOL4 => "HOL4",
120+
ProverKind::ACL2 => "ACL2",
121+
ProverKind::SCIP => "SCIP",
122+
ProverKind::Imandra => "Imandra",
114123
_ => "<other>",
115124
}
116125
}
@@ -215,3 +224,65 @@ async fn live_tlaps_version() {
215224
// TLA+ Proof System's prover is `tlapm` (per provers/mod.rs).
216225
assert_version_reachable(ProverKind::TLAPS, "tlapm").await;
217226
}
227+
228+
// ==========================================================================
229+
// Tier 3 — weekly. Upstream-tarball or heavier-build provers. Most of
230+
// these SKIP locally and in PR CI; the weekly tier3 matrix in
231+
// live-provers.yml provisions each binary in its own job before running
232+
// `cargo test ... <backend>`, so only the matching test runs per job.
233+
// ==========================================================================
234+
235+
#[tokio::test]
236+
async fn live_tamarin_version() {
237+
assert_version_reachable(ProverKind::Tamarin, "tamarin-prover").await;
238+
}
239+
240+
#[tokio::test]
241+
async fn live_proverif_version() {
242+
assert_version_reachable(ProverKind::ProVerif, "proverif").await;
243+
}
244+
245+
#[tokio::test]
246+
async fn live_metamath_version() {
247+
assert_version_reachable(ProverKind::Metamath, "metamath").await;
248+
}
249+
250+
#[tokio::test]
251+
async fn live_twelf_version() {
252+
// Twelf's CLI entry is `twelf-server` per provers/mod.rs.
253+
assert_version_reachable(ProverKind::Twelf, "twelf-server").await;
254+
}
255+
256+
#[tokio::test]
257+
async fn live_ortools_version() {
258+
// Echidna's ORTools backend invokes `ortools_solve` (wrapper around the
259+
// OR-Tools C++ solve CLI). Provisioned via upstream tarball.
260+
assert_version_reachable(ProverKind::ORTools, "ortools_solve").await;
261+
}
262+
263+
#[tokio::test]
264+
async fn live_hol4_version() {
265+
// HOL4 requires Poly/ML + a tree build; provisioning is deferred to
266+
// Containerfile. Test SKIPs on runners without `hol` on PATH.
267+
assert_version_reachable(ProverKind::HOL4, "hol").await;
268+
}
269+
270+
#[tokio::test]
271+
async fn live_acl2_version() {
272+
// ACL2 requires a Common Lisp image; provisioning deferred to Containerfile.
273+
assert_version_reachable(ProverKind::ACL2, "acl2").await;
274+
}
275+
276+
#[tokio::test]
277+
async fn live_scip_version() {
278+
// SCIP requires a cmake build of SCIP Optimization Suite; deferred to
279+
// Containerfile. Test SKIPs until provisioned.
280+
assert_version_reachable(ProverKind::SCIP, "scip").await;
281+
}
282+
283+
#[tokio::test]
284+
async fn live_imandra_version() {
285+
// Imandra is proprietary; handled via vendor-supplied container where a
286+
// licence is available. Test SKIPs on public CI.
287+
assert_version_reachable(ProverKind::Imandra, "imandra").await;
288+
}

0 commit comments

Comments
 (0)