Install
openclaw skills install formal-proversFormal verification with Lean 4, Coq, and Z3 SMT solver
openclaw skills install formal-proversFormal verification tools for the academic workspace. Type-check Lean 4 proofs, verify Coq theories, and solve SMT satisfiability problems with Z3.
This skill requires the following binaries installed locally (declared in metadata.openclaw.requires.bins):
| Binary | Install |
|---|---|
lean | Lean 4 via elan |
coqc | Coq via opam install coq |
z3 | Z3 via package manager or GitHub releases |
Use prover_status to check which provers are available before use. The skill gracefully handles missing binaries — only installed provers will work.
Source: github.com/Prismer-AI/Prismer (Apache-2.0)
This skill invokes locally installed formal verification provers via subprocess. No Docker, containers, or external services required.
Execution model: Each invocation writes source code to a temporary directory (os.tmpdir()/formal-methods-<hash>/), runs the prover binary with cwd set to that directory, captures stdout/stderr, and applies a 60-second timeout. The exact commands are:
lean <filepath> — may read Lean 4 stdlib and elan-managed toolchains from ~/.elan/coqc <filepath> — may read Coq stdlib and opam-managed packages from the opam switchz3 <filepath> — self-contained, only reads the input file. Accepts declarative SMT-LIB2 format only.Filesystem access: The skill itself only writes to the temp directory. However, Lean and Coq read their installed standard libraries and search paths (managed by elan/opam) as part of normal operation. The skill does not explicitly constrain --include paths or environment variables.
Network access: The skill does not make network requests. However, if Lean source contains import of unresolved packages, lake tooling could theoretically attempt a fetch — this is a Lean runtime behavior, not initiated by the skill. To prevent this, avoid lakefile.lean or lake-manifest.json in the temp directory (which the skill does not create).
prover_status to see which provers are installedlean_check, coq_check, or z3_solve to verifyType-check Lean 4 code.
Parameters:
code (string, required): Lean 4 source codefilename (string, optional): Source filename (default: check.lean)Returns: { success, output, errors, returncode }
Example:
{ "code": "theorem add_comm (a b : Nat) : a + b = b + a := Nat.add_comm a b" }
Check a Coq proof for correctness.
Parameters:
code (string, required): Coq source codefilename (string, optional): Source filename (default: check.v)Returns: { success, compiled, output, errors, returncode }
Example:
{ "code": "Theorem plus_comm : forall n m : nat, n + m = m + n.\nProof. intros. lia. Qed." }
Compile a Coq file to a .vo object file.
Parameters:
code (string, required): Coq source codefilename (string, optional): Source filename (default: compile.v)Returns: { success, compiled, output, errors, returncode }
Solve a satisfiability problem using Z3 with SMT-LIB2 format.
Parameters:
formula (string, required): SMT-LIB2 formulaReturns: { success, result, model }
Example:
{ "formula": "(declare-const x Int)\n(assert (> x 5))\n(check-sat)\n(get-model)" }
Check which formal provers are available and their versions.
Parameters: None
Returns: { provers: { lean4: { available, version }, coq: { available, version }, z3: { available, version } } }
metadata.openclaw.requires.bins: lean, coqc, z3execSync with timeout: 60000)os.tmpdir()/formal-methods-<hash>/