formal-foundations

Provides mathematical foundations and formal verification vocabulary for protocol and state machine design.

10|2|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/nrdxp/predicate --skill formal-foundations-nrdxp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: formal-foundations
Source: https://github.com/nrdxp/predicate/tree/main/skills/formal-foundations
Command: npx skills add https://github.com/nrdxp/predicate --skill formal-foundations-nrdxp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Engineers designing protocols, state machines, and data schemas often lack a shared formal vocabulary to reason about correctness, equivalence, and composition, leading to ad-hoc verification and missed structural errors. ## Core Features & Use Cases - Categorical Foundations: Defines symmetric monoidal categories, closed and compact closed structures, and coherence axioms (pentagon, hexagon, zig-zag identities) for reasoning about composition. - Rosetta Stone Correspondences: Maps physics, topology, logic, and computation onto one algebraic structure, including Curry-Howard (types as propositions) and linear type theory for resource discipline. - Algebra vs. Coalgebra Guidance: Explains bisimulation for behavioral equivalence of state machines and protocols, plus database schemas as categories with adjoint data migrations (Kan extensions). - Use Case: When verifying that two protocol implementations are behaviorally equivalent, use this skill to frame the question as a bisimulation check rather than structural comparison. ## Quick Start Ask the agent to load the formal-foundations skill and explain whether two state machines are equivalent using bisimulation.

Frequently Asked Questions about formal-foundations

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

FAQPage Schema
How do I check if two state machines are equivalent?

Use bisimulation, the coalgebraic notion of behavioral equivalence. Two systems are equivalent if no external observer can distinguish their transitions, regardless of internal structure. This is the correct frame for protocol equivalence and API compatibility checks.

What is the Curry-Howard correspondence in software engineering?

Curry-Howard states that types are propositions and programs are proofs. Type checking becomes proof checking, function composition becomes inference, and parametric polymorphism becomes universal quantification, constraining implementations absolutely.

When should I use algebra versus coalgebra for modeling?

Use algebra for finite, inductive data defined by constructors, such as lists and trees, reasoned about by induction. Use coalgebra for potentially infinite systems defined by observers, such as streams, protocols, and state machines, reasoned about by coinduction.

Does this skill replace formal verification tools like TLA+ or Alloy?

No. It provides the mathematical language and foundational vocabulary that tools like TLA+, Alloy, Lean, and Coq operate on. It is a reference corpus consulted by workflows, not an executable model checker or proof assistant.

How are database schema migrations modeled categorically?

A schema is a small category and an instance is a functor into Set. Migration along a functor F is governed by the adjoint triple: pullback for restructuring, left Kan extension for data integration, and right Kan extension for constraint enforcement.