Skip to content

Commit e59bfcb

Browse files
hyperpolymathclaude
andcommitted
fix: Idris2 ABI type-checks clean, ProverFactory auto-resolves executables
Idris2 ABI fixes (all 16 modules now type-check): - VqlUt.idr: extract goalHash as standalone function (where-clause on data constructors is invalid Idris2 syntax), fix Subsumes to use LTE on finToNat instead of weaken (which changes the bound) - FirstOrderAtp.idr: add import Data.List.Elem for Elem/Here/There - AutoActive.idr: same Elem import fix - ConstraintSolvers.idr: define local NonEmpty proof type (not in Idris2 stdlib), add import ProverFactory.create() now auto-fills the executable path from ProverKind.default_executable() when the config has an empty path. This fixes the E2E smoke tests which use ProverConfig::default(). All 248 unit tests + 28 E2E smoke tests pass. Z3 and Lean verified end-to-end through the full trust-hardening dispatch pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 52083c0 commit e59bfcb

5 files changed

Lines changed: 61 additions & 6 deletions

File tree

src/abi/EchidnaABI/Provers/AutoActive.idr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module EchidnaABI.Provers.AutoActive
2323

2424
import EchidnaABI.Types
2525
import Data.Fin
26+
import Data.List.Elem
2627

2728
%default total
2829

src/abi/EchidnaABI/Provers/ConstraintSolvers.idr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ import Data.Fin
2727

2828
%default total
2929

30+
||| Proof that a list is non-empty.
31+
public export
32+
data NonEmpty : List a -> Type where
33+
IsNonEmpty : NonEmpty (x :: xs)
34+
3035
-- ═══════════════════════════════════════════════════════════════════════
3136
-- Constraint Solver Variants
3237
-- ═══════════════════════════════════════════════════════════════════════

src/abi/EchidnaABI/Provers/FirstOrderAtp.idr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module EchidnaABI.Provers.FirstOrderAtp
2222

2323
import EchidnaABI.Types
2424
import Data.Fin
25+
import Data.List.Elem
2526

2627
%default total
2728

src/abi/EchidnaABI/VqlUt.idr

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ L8_Effect = 8
5656
L9_Temporal = 9
5757
L10_Linear = 10
5858

59-
||| Proof that level n subsumes all levels below it.
59+
||| Proof that level n subsumes level m (n >= m as natural numbers).
6060
||| If a query is safe at level n, it is safe at all levels <= n.
6161
public export
6262
data Subsumes : TypeLevel -> TypeLevel -> Type where
6363
SubsumeSelf : Subsumes n n
64-
SubsumeStep : Subsumes (FS n) m -> Subsumes (FS n) (weaken m)
64+
SubsumeStep : Subsumes n m -> LTE (finToNat m) (finToNat n) -> Subsumes n m
6565

6666
-- ═══════════════════════════════════════════════════════════════════════
6767
-- Proof Query Protocol
@@ -168,17 +168,19 @@ data TheoremIdentity : Type where
168168
(theoremName : String) ->
169169
TheoremIdentity
170170

171+
||| Extract the goal hash from a theorem identity (prover-agnostic).
172+
public export
173+
theoremGoalHash : TheoremIdentity -> String
174+
theoremGoalHash (MkTheoremIdentity h _) = h
175+
171176
||| Proof that cross-prover deduplication is safe.
172177
||| If two octads share the same goal hash, they prove the same theorem.
173178
public export
174179
data DeduplicationSafe : TheoremIdentity -> TheoremIdentity -> Type where
175180
SameTheorem :
176181
(t1 : TheoremIdentity) -> (t2 : TheoremIdentity) ->
177-
(goalHash t1 = goalHash t2) ->
182+
(theoremGoalHash t1 = theoremGoalHash t2) ->
178183
DeduplicationSafe t1 t2
179-
where
180-
goalHash : TheoremIdentity -> String
181-
goalHash (MkTheoremIdentity h _) = h
182184

183185
-- ═══════════════════════════════════════════════════════════════════════
184186
-- Effect Tracking (Level 8)

src/rust/provers/mod.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,42 @@ impl ProverKind {
295295
ProverKind::ORTools => 1.5, // Constraint/optimization
296296
}
297297
}
298+
299+
/// Default executable name for this prover (what to look for on PATH)
300+
pub fn default_executable(&self) -> &'static str {
301+
match self {
302+
ProverKind::Agda => "agda",
303+
ProverKind::Coq => "coqc",
304+
ProverKind::Lean => "lean",
305+
ProverKind::Isabelle => "isabelle",
306+
ProverKind::Z3 => "z3",
307+
ProverKind::CVC5 => "cvc5",
308+
ProverKind::Metamath => "metamath",
309+
ProverKind::HOLLight => "ocaml",
310+
ProverKind::Mizar => "mizf",
311+
ProverKind::PVS => "pvs",
312+
ProverKind::ACL2 => "acl2",
313+
ProverKind::HOL4 => "hol",
314+
ProverKind::Idris2 => "idris2",
315+
ProverKind::Vampire => "vampire",
316+
ProverKind::EProver => "eprover",
317+
ProverKind::SPASS => "SPASS",
318+
ProverKind::AltErgo => "alt-ergo",
319+
ProverKind::FStar => "fstar.exe",
320+
ProverKind::Dafny => "dafny",
321+
ProverKind::Why3 => "why3",
322+
ProverKind::TLAPS => "tlapm",
323+
ProverKind::Twelf => "twelf-server",
324+
ProverKind::Nuprl => "nuprl",
325+
ProverKind::Minlog => "minlog",
326+
ProverKind::Imandra => "imandra",
327+
ProverKind::GLPK => "glpsol",
328+
ProverKind::SCIP => "scip",
329+
ProverKind::MiniZinc => "minizinc",
330+
ProverKind::Chuffed => "fzn-chuffed",
331+
ProverKind::ORTools => "ortools_solve",
332+
}
333+
}
298334
}
299335

300336
/// Configuration for a prover backend
@@ -383,6 +419,16 @@ pub struct ProverFactory;
383419

384420
impl ProverFactory {
385421
pub fn create(kind: ProverKind, config: ProverConfig) -> anyhow::Result<Box<dyn ProverBackend>> {
422+
// Fill in default executable if not specified
423+
let config = if config.executable.as_os_str().is_empty() {
424+
ProverConfig {
425+
executable: PathBuf::from(kind.default_executable()),
426+
..config
427+
}
428+
} else {
429+
config
430+
};
431+
386432
match kind {
387433
ProverKind::Agda => Ok(Box::new(agda::AgdaBackend::new(config))),
388434
ProverKind::Coq => Ok(Box::new(coq::CoqBackend::new(config))),

0 commit comments

Comments
 (0)