discover-formal

Automate discovery of formal methods and verification skills during development tasks.

126|7|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/rand/cc-experiments --skill discover-formal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: discover-formal
Source: https://github.com/rand/cc-experiments/tree/main/skills/discover-formal
Command: npx skills add https://github.com/rand/cc-experiments --skill discover-formal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Applying formal methods and software verification can be daunting due to their mathematical rigor. This skill provides instant access to expertise on theorem proving, SAT/SMT solving (Z3, Lean), constraint satisfaction problems, and proof basics, making complex verification tasks more approachable.

Core Features & Use Cases

  • Formal Verification Expertise: Covers SAT/SMT solving, constraint propagation, CSP modeling, and theorem proving with tools like Lean and Z3.
  • Contextual Activation: Automatically activates when you're engaged in formal development tasks, offering relevant guidance.
  • Use Case: When verifying the correctness of a critical algorithm, this skill can guide you through using SMT solvers or Lean for formal proof construction.

Quick Start

Explain the basics of SAT solving and its applications in software verification.

Frequently Asked Questions about discover-formal

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use SMT solvers like Z3 to verify algorithm correctness?

SMT solvers automate formal verification by encoding algorithm properties as logical constraints, then checking satisfiability to prove correctness or find counterexamples. Z3 handles complex constraint problems across integers, reals, and bit-vectors, reducing manual proof effort in critical systems.

What's the difference between SAT solving and SMT solving in software verification?

SAT solving decides propositional logic satisfiability using Boolean variables; SMT extends this to theories like arithmetic and arrays, enabling direct reasoning about program values and constraints. SMT solvers handle richer verification problems SAT cannot express directly.

When should I use Lean for theorem proving instead of testing?

Lean provides machine-checked proofs for properties that testing cannot guarantee hold universally. Use Lean when you need mathematical certainty for safety-critical algorithms, type system properties, or correctness claims testing alone cannot validate.

How do I model constraint satisfaction problems for formal verification?

Constraint satisfaction models express program invariants and requirements as logical formulas over variables with domains and constraints. Solvers then search systematically for solutions or prove infeasibility, automating detection of design flaws before implementation.

Can formal methods scale to real-world production code?

Formal methods scale through abstraction, modular verification, and SMT solver automation on specific critical components rather than entire systems. Organizations apply them to security kernels, financial engines, and protocol correctness where failure cost justifies proof investment.

What prerequisites do I need before applying formal verification techniques?

Formal verification requires clear specifications of intended behavior, comfort with mathematical logic notation, and knowledge of your target tool's input language (Z3 syntax, Lean tactics, or SMT-LIB). Start with small algorithms before scaling to complex systems.