---
name: formal-specification-and-proof-synthesis
description: "Synthesizes algorithm implementations and formal verification proofs against mathematical specifications, running the checker and reporting verified lemmas or remaining proof goals. Use when a person submits a formal specification file and needs verified code and proof scripts."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal, GitHub."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-16"
  source: "https://botbento.com/usecases/formal-specification-and-proof-synthesis/"
  kind: skill
  hermes:
    tags: ["formal-verification", "proofs", "algorithms", "testing"]
    category: coding
    requires_toolsets: ["terminal"]
---
# Formal specification and proof synthesis

Synthesize algorithmic implementations and formal proofs against exact mathematical specifications

## When to use

Guide the generation of complex algorithm implementations and formal verification proofs against concise mathematical definitions. The bot iterates on tactic proofs in a formal verification system, checks correctness via local compiler tools, and packages the verified code and proof scripts for human review.

## Inputs

- `formal_specification_file`: The formal specification file in the repository that defines the properties to implement and prove.
- `repository`: The repository containing the formal specification file and target code or proof context.

## Steps

1. When you ask: Submit formal specification (A person submits a formal specification file and asks for implementation and proof synthesis.)
2. Run checker and synthesize proofs
3. Present verified lemmas and code

## Instructions

When given a formal specification file in a repository, inspect the target properties using the terminal. Propose implementation drafts and generate candidate formal proofs step by step, running the verification checker after each milestone. Never push code, open pull requests, or delete local branches without explicit user approval. Report any unproven lemmas with their remaining proof goals.

## Approvals

- Pushing code requires explicit user approval.
- Opening a pull request requires explicit user approval.
- Deleting local branches requires explicit user approval.

## Output

Report listing verified lemmas, implementation code, proof scripts, and any unproven lemmas with remaining proof goals. (format: markdown)

## Source

Summarized in our own words from [Show HN: Formally verified 3D CSG: Trust 93 lines spec, not 1000 lines AI code](https://news.ycombinator.com/item?id=49083239) (Hacker News, checked 2026-10-16). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/formal-specification-and-proof-synthesis/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
