Agent SkillsPrismer-AI/Prismer › formal-methods

formal-methods

GitHub

提供形式化验证工具,用于检查Lean4和Coq证明的正确性,以及使用Z3求解SMT可满足性问题。支持本地安装的工具调用、状态检查及迭代调试。

skills/formal-methods/SKILL.md Prismer-AI/Prismer

Trigger Scenarios

验证数学定理或逻辑证明 检查代码类型是否匹配 求解公式的可满足性

Install

npx skills add Prismer-AI/Prismer --skill formal-methods -g -y
More Options

Use without installing

npx skills use Prismer-AI/Prismer@formal-methods

指定 Agent (Claude Code)

npx skills add Prismer-AI/Prismer --skill formal-methods -a claude-code -g -y

安装 repo 全部 skill

npx skills add Prismer-AI/Prismer --all -g -y

预览 repo 内 skill

npx skills add Prismer-AI/Prismer --list

SKILL.md

Frontmatter
{
    "name": "formal-methods",
    "description": "Verify proofs, check theorem correctness, and solve satisfiability problems using Lean 4, Coq, and Z3 SMT solver. Use when the user asks to prove theorems, verify mathematical proofs, check logical satisfiability, or work with proof assistants."
}

formal-methods

Formal verification tools for the academic workspace. Type-check Lean 4 proofs, verify Coq theories, and solve SMT satisfiability problems with Z3.

Description

This skill wraps locally installed formal verification provers (lean, coqc, z3) via subprocess. No Docker or external services required.

Usage Examples

  • "Check if this Lean 4 proof type-checks"
  • "Verify my Coq induction proof"
  • "Is this SMT formula satisfiable?"
  • "What provers are available?"

Process

  1. Check availability — Use prover_status to see which provers are installed
  2. Write proof — Draft your Lean/Coq code or SMT formula
  3. Verify — Use lean_check, coq_check, or z3_solve to verify
  4. Iterate — Fix errors based on output and re-check. Common patterns: "type mismatch" in Lean means type annotations need fixing; "unsat" from Z3 means no satisfying assignment exists (formula is a tautology when negated); "unknown" means Z3 couldn't determine satisfiability within limits

Tools

lean_check

Type-check Lean 4 code.

Parameters:

  • code (string, required): Lean 4 source code
  • filename (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" }

coq_check

Check a Coq proof for correctness.

Parameters:

  • code (string, required): Coq source code
  • filename (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." }

coq_compile

Compile a Coq file to a .vo object file.

Parameters:

  • code (string, required): Coq source code
  • filename (string, optional): Source filename (default: compile.v)

Returns: { success, compiled, output, errors, returncode }

z3_solve

Solve a satisfiability problem using Z3 with SMT-LIB2 format.

Parameters:

  • formula (string, required): SMT-LIB2 formula

Returns: { success, result, model }

Example:

{ "formula": "(declare-const x Int)\n(assert (> x 5))\n(check-sat)\n(get-model)" }

prover_status

Check which formal provers are available and their versions.

Parameters: None

Returns: { provers: { lean4: { available, version }, coq: { available, version }, z3: { available, version } } }

Notes

  • Requires provers installed locally (lean, coqc, z3)
  • Z3 only accepts SMT-LIB2 format (declarative, no arbitrary code execution)
  • Execution timeout is 60 seconds per invocation

Version History

  • 2dbe71f Current 2026-08-20 10:22

Same Skill Collection

docker/config/workspace/skills/prismer-workspace/SKILL.md
docker/plugin/prismer-workspace/skills/arxiv-reader/SKILL.md
docker/plugin/prismer-workspace/skills/find-skills/SKILL.md
docker/plugin/prismer-workspace/skills/formal-methods/SKILL.md
docker/plugin/prismer-workspace/skills/hf-papers/SKILL.md
docker/plugin/prismer-workspace/skills/latex-compiler/SKILL.md
docker/templates/academic-researcher/skills/data-analysis/SKILL.md
docker/templates/academic-researcher/skills/latex-writing/SKILL.md
docker/templates/academic-researcher/skills/paper-search/SKILL.md
docker/templates/cs-researcher/skills/ml-experiment/SKILL.md
docker/templates/data-scientist/skills/jupyter/SKILL.md
docker/templates/finance-researcher/skills/quant-analysis/SKILL.md
docker/templates/mathematician/skills/theorem-proving/SKILL.md
docker/templates/paper-reviewer/skills/peer-review/SKILL.md
skills/arxiv-reader/SKILL.md
skills/hf-papers/SKILL.md
skills/latex-compiler/SKILL.md

Metadata

Files
0
Version
2dbe71f
Hash
b4064b6b
Indexed
2026-08-20 10:22

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 14:16
浙ICP备14020137号-1 $mapa de visitantes$