proof-carrying-code-generator

Generate executable code with formal proofs in Isabelle/HOL or Coq.

142|14|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill proof-carrying-code-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: proof-carrying-code-generator
Source: https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-carrying-code-generator
Command: npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill proof-carrying-code-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of building software that requires guaranteed safety and correctness, particularly in critical systems where formal verification is essential.

Core Features & Use Cases

  • Formal Specification: Define precise mathematical specifications for software components.
  • Verified Implementation: Generate executable code that is proven to adhere to its specification.
  • Safety & Correctness Proofs: Produce formal proofs for properties like memory safety, functional correctness, and termination.
  • Code Extraction: Extract verified code into production-ready languages like OCaml, Haskell, or SML.
  • Use Case: Developing a safety-critical embedded system for an aircraft, where every component must be mathematically proven to be free of bugs and vulnerabilities.

Quick Start

Use the proof-carrying-code-generator skill to generate verified OCaml code for a binary search function with accompanying safety proofs.

Frequently Asked Questions about proof-carrying-code-generator

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

FAQPage Schema
How do I generate formally verified code with mathematical proofs of safety and correctness?

Proof-carrying code generation bundles executable code with formal proofs certifying safety and correctness properties. It produces verified software with accompanying proofs for memory safety, bounds checking, invariant preservation, and termination using Isabelle/HOL or Coq.

What is proof-carrying code and when do I need it for software verification?

Proof-carrying code is executable software bundled with formal mathematical proofs certifying its safety properties. You need it for safety-critical systems, such as aircraft embedded components, where formal guarantees against bugs and vulnerabilities are absolutely required.

Can I extract verified code to OCaml, Haskell, or SML from Coq or Isabelle/HOL?

Yes, you can extract verified code into production-ready OCaml, Haskell, or SML. The extraction process takes the executable code proven correct in Coq or Isabelle/HOL and translates it into these target languages for deployment.

How do I prove functional correctness and termination for a binary search function in Coq?

To prove functional correctness and termination for a binary search function, write a formal specification matching the intended behavior, then generate the implementation with an accompanying safety proof certifying bounds checking, invariant preservation, and termination properties.

Does formal verification with Isabelle/HOL support invariant preservation and bounds checking?

Yes, formal verification with Isabelle/HOL supports proving invariant preservation and bounds checking. The generated code includes formal proofs certifying these specific safety properties alongside functional correctness and termination guarantees.

What are the limitations of using formal proofs for building safety-critical systems?

Limitations of using formal proofs include the need for precise mathematical specifications and significant verification overhead. This approach is specialized for safety-critical systems requiring guaranteed correctness, rather than general-purpose rapid application development.