Skip to content

Commit ac9a379

Browse files
hyperpolymathclaude
andcommitted
Add typed-wasm prover backend + property test regressions
- typed_wasm.rs: new prover backend for typed-wasm integration - Property test regression file from validation run - Minor fixes to explanations and prover module registration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6e9ab48 commit ac9a379

6 files changed

Lines changed: 1859 additions & 0 deletions

File tree

src/rust/agent/explanations.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ impl ExplanationGenerator {
348348
ProverKind::MiniZinc => "MiniZinc is a constraint modelling language compiling to multiple backend solvers.",
349349
ProverKind::Chuffed => "Chuffed uses lazy clause generation for constraint propagation with SAT-style learning.",
350350
ProverKind::ORTools => "OR-Tools provides constraint solving, routing, and linear/integer programming.",
351+
ProverKind::TypedWasm => "TypedWasm is an internal oracle validating 10-level type safety for typed WASM memory regions.",
351352
}.to_string()
352353
}
353354

src/rust/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ fn info_command(prover: ProverKind, formatter: &OutputFormatter) -> Result<()> {
557557
ProverKind::MiniZinc => "Constraint modelling language with multiple backend solvers.",
558558
ProverKind::Chuffed => "Lazy clause generation CP solver with SAT-style learning.",
559559
ProverKind::ORTools => "Google OR-Tools. CP-SAT, routing, linear/integer programming.",
560+
ProverKind::TypedWasm => "TypedWasm oracle. 10-level type safety validation for .twasm programs.",
560561
};
561562
formatter.info(&format!(" {}", description))?;
562563
formatter.info("")?;
@@ -592,6 +593,7 @@ fn info_command(prover: ProverKind, formatter: &OutputFormatter) -> Result<()> {
592593
ProverKind::MiniZinc => ".mzn / .dzn",
593594
ProverKind::Chuffed => ".fzn",
594595
ProverKind::ORTools => ".or / .proto",
596+
ProverKind::TypedWasm => ".twasm",
595597
};
596598
formatter.info(&format!(" {}", extension))?;
597599
formatter.info("")?;
@@ -695,6 +697,7 @@ fn get_default_executable(kind: ProverKind) -> PathBuf {
695697
ProverKind::MiniZinc => PathBuf::from("minizinc"),
696698
ProverKind::Chuffed => PathBuf::from("fzn-chuffed"),
697699
ProverKind::ORTools => PathBuf::from("ortools_solve"),
700+
ProverKind::TypedWasm => PathBuf::from("idris2"),
698701
}
699702
}
700703

src/rust/provers/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub mod scip;
4343
pub mod minizinc;
4444
pub mod chuffed;
4545
pub mod ortools;
46+
pub mod typed_wasm;
4647

4748
/// Enumeration of all supported provers
4849
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
@@ -94,6 +95,9 @@ pub enum ProverKind {
9495
MiniZinc,
9596
Chuffed,
9697
ORTools,
98+
99+
// Prover oracles (internal structural validators)
100+
TypedWasm,
97101
}
98102

99103
impl std::str::FromStr for ProverKind {
@@ -131,6 +135,7 @@ impl std::str::FromStr for ProverKind {
131135
"minizinc" | "mzn" => Ok(ProverKind::MiniZinc),
132136
"chuffed" => Ok(ProverKind::Chuffed),
133137
"ortools" | "or-tools" => Ok(ProverKind::ORTools),
138+
"typedwasm" | "typed-wasm" | "typed_wasm" | "twasm" => Ok(ProverKind::TypedWasm),
134139
_ => Err(anyhow::anyhow!("Unknown prover: {}", s)),
135140
}
136141
}
@@ -183,6 +188,7 @@ impl ProverKind {
183188
ProverKind::MiniZinc,
184189
ProverKind::Chuffed,
185190
ProverKind::ORTools,
191+
ProverKind::TypedWasm,
186192
]);
187193
provers
188194
}
@@ -220,6 +226,7 @@ impl ProverKind {
220226
ProverKind::MiniZinc => 2, // Constraint modelling
221227
ProverKind::Chuffed => 2, // CP solver
222228
ProverKind::ORTools => 2, // Constraint/optimization solver
229+
ProverKind::TypedWasm => 3, // Internal oracle, structural analysis
223230
}
224231
}
225232

@@ -262,6 +269,7 @@ impl ProverKind {
262269
ProverKind::MiniZinc => 5,
263270
ProverKind::Chuffed => 5,
264271
ProverKind::ORTools => 5,
272+
ProverKind::TypedWasm => 1, // Internal oracle, tier 1 capability
265273
}
266274
}
267275

@@ -293,6 +301,7 @@ impl ProverKind {
293301
ProverKind::MiniZinc => 1.0, // Constraint modelling
294302
ProverKind::Chuffed => 1.0, // CP solver
295303
ProverKind::ORTools => 1.5, // Constraint/optimization
304+
ProverKind::TypedWasm => 2.0, // Internal oracle
296305
}
297306
}
298307

@@ -329,6 +338,7 @@ impl ProverKind {
329338
ProverKind::MiniZinc => "minizinc",
330339
ProverKind::Chuffed => "fzn-chuffed",
331340
ProverKind::ORTools => "ortools_solve",
341+
ProverKind::TypedWasm => "idris2", // Validates via Idris2 ABI
332342
}
333343
}
334344
}
@@ -460,6 +470,7 @@ impl ProverFactory {
460470
ProverKind::MiniZinc => Ok(Box::new(minizinc::MiniZincBackend::new(config))),
461471
ProverKind::Chuffed => Ok(Box::new(chuffed::ChuffedBackend::new(config))),
462472
ProverKind::ORTools => Ok(Box::new(ortools::ORToolsBackend::new(config))),
473+
ProverKind::TypedWasm => Ok(Box::new(typed_wasm::TypedWasmBackend::new(config))),
463474
}
464475
}
465476

@@ -493,6 +504,7 @@ impl ProverFactory {
493504
"pip" | "zpl" => Some(ProverKind::SCIP), // SCIP/ZIMPL format
494505
"mzn" | "dzn" => Some(ProverKind::MiniZinc), // MiniZinc format
495506
"fzn" => Some(ProverKind::Chuffed), // FlatZinc (Chuffed input)
507+
"twasm" => Some(ProverKind::TypedWasm), // TypedWasm program
496508
_ => None,
497509
})
498510
}

0 commit comments

Comments
 (0)