From predicate
Applies Structured Domain Modeling Architecture (SDMA) for formal domain modeling, ologs, schema design, and architectural entropy measurement using category theory, coalgebra, and information theory.
How this skill is triggered — by the user, by Claude, or both
Slash command
/predicate:sdmaThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Reference corpus — `/form`, `/spec`, `boundary`, `engineering`.** This skill survives as the applied-methodology authority for formal domain modeling; the mandate to apply it is ambient, rooted in the workflows that invoke it as a lens. It is the [form](../form/SKILL.md) workflow's mathematical toolkit, the formalism-selection authority for [spec](../spec/SKILL.md)'s verification tier choices...
Reference corpus — /form, /spec, boundary, engineering. This skill survives as the applied-methodology authority for formal domain modeling; the mandate to apply it is ambient, rooted in the workflows that invoke it as a lens. It is the form workflow's mathematical toolkit, the formalism-selection authority for spec's verification tier choices, and the structural vocabulary consulted by boundary and engineering. Where applicable, the formalisms in this atlas close conditions on the symbolic path of the Verification Dual (coalgebraic bisimulation, session-type checking, linear-type discipline) or supply the structural representation that the adversarial path reviews for coherence.
This skill provides the applied methodology for formal domain modeling. The mathematical foundations — SMC, Rosetta Stone, Curry-Howard, algebra/coalgebra duality — live in the formal-foundations skill (skills/formal-foundations/SKILL.md). This skill tells you how to wield them.
The SDMA covers what are arguably the most critical isomorphisms in computer science — the categorical, coalgebraic, linear, and information-theoretic bedrock. But it is a foundation, not a ceiling. The full landscape of mathematical formalism is available. The SDMA provides the root from which to reach for any relevant representation, guided by the principle of minimal representation: choose the simplest formalism that faithfully captures the domain's essential structure.
The formal definitions of schemas-as-categories and adjoint migration functors live in the formal-foundations skill. Here we focus on how to apply them.
Treat every database schema as a small category S. This isn't metaphorical — it's a precise correspondence:
The signature S = (N, E, C) is the finite presentation: nodes (tables), edges (foreign keys), path equations (business rules). The schema S is the category the signature generates.
Abstract categorical IDs are insufficient for real data. Bridge the gap with the Typed Signature (A, i, γ):
A database instance is then a functor I: S → Set in categorical normal form: structural parts (foreign keys, relationships) are compared for isomorphism; attribute parts (data values) are compared for equality.
When you have a functor F: C → D between schemas (a schema mapping), three adjoint functors handle data migration:
| Functor | Operation | Engineering Use | Think Of It As |
|---|---|---|---|
| Δ_F (Pullback) | Pre-composition I ∘ F | Data access, reformatting, view creation | SELECT + reshape |
| Σ_F (Left Pushforward) | Left Kan Extension | Data integration, dataset merging, colimits | UNION + project |
| Π_F (Right Pushforward) | Right Kan Extension | Constraint enforcement, joins, limits | JOIN + filter |
When to use each:
Traditional ETL processes suffer from semantic loss — the meaning of relationships is destroyed during transformation. FDM prevents this because the migration functors are adjoint: they preserve the categorical structure by construction. If your migration doesn't factor through Δ/Σ/Π, you're likely losing semantic information.
Ologs (Ontology Logs) are the SDMA's tool for rigorous knowledge representation. They make implicit domain knowledge explicit and verifiable.
These rules are not suggestions — violating them produces invalid ologs:
Objects (Types): Must be labeled with a singular indefinite noun phrase.
Morphisms (Aspects): Must represent functional relationships — each element of the domain maps to exactly one element of the codomain.
Facts: Represented as commutative diagrams demonstrating path equivalence.
Ologs ensure that semantic models are "equivalent up to object identity." They eliminate the ambiguity of natural language by forcing relationships into categorical structure. When you build an olog, you're not just drawing boxes and arrows — you're constructing a formal category where every path equation is a verifiable business rule.
The progression: unstructured data → relational schema → olog → functorial migration. Each step adds formal structure. An olog-backed data architecture can be migrated, merged, and verified using the adjoint functors from §1 — because the olog is the category that the functors act on.
The formal-foundations skill defines coalgebra and bisimulation formally. Here we cover when and how to apply them.
Use coalgebra when your problem has these characteristics:
If your problem is about constructing finite data (lists, trees, ADTs), use algebra. If it's about observing evolving state, use coalgebra.
Two systems are bisimilar if no external observer can distinguish them. This is the correct frame for:
A coalgebra c: S → F(S) defines:
The final coalgebra is the "most general" system — it contains all possible behaviors. Any concrete system maps into it via a unique morphism, which extracts the system's complete behavioral profile.
Linear logic's constraint — resources cannot be duplicated or discarded — maps directly to engineering concerns:
| Formal Principle | Engineering Application |
|---|---|
| No duplication (A → A ⊗ A forbidden) | Unique tokens, ownership, single-use credentials |
| No discarding (must consume) | Memory management, resource cleanup, connection pools |
| Linear implication (A ⊸ B) | State transitions that consume input |
Where it prevents failures:
Session types represent communication protocols as types. They guarantee:
Use session types when modeling multi-party interactions where protocol correctness is critical — payment flows, consensus protocols, API handshakes.
Traditional metrics (LoC, cyclomatic complexity) are architecturally bankrupt — they measure syntax, not structure. The SDMA uses information-theoretic metrics that capture genuine structural properties.
The Structural Entropy Index of a Community quantifies how decentralized and resilient an architecture is:
SEIC(C) = H_C / log₂ |C|
Where H_C is the Shannon entropy of the degree distribution within the community.
Interpretation:
Practical use:
SEIC enables comparison between microservices and monolithic cores — it's scale-invariant by construction.
Use Maslov-Sneppen rewiring to distinguish between:
If SEIC differs significantly from the null model, the centralization is deliberate (or at least systematic). If it matches the null model, the architecture has no more structure than random wiring.
In HPC and exascale contexts, excessive software entropy is a literal thermodynamic cost. High entropy correlates with increased data movement, which degrades energy efficiency and maintainability. Managing this entropy is a strategic requirement for sustainable system evolution.
This is the meta-model — the prescriptive logic for selecting the correct formalism. Selecting the wrong formalism is the primary driver of architectural debt. The matrix below covers the SDMA's foundational formalisms, but it is a starting point, not a closed set.
| If Problem Domain Involves... | Select Representation | Formal Tool |
|---|---|---|
| Evolving state with hidden variables | Coalgebra | Bisimilarity |
| Non-duplicable resources / security tokens | Linear Logic | Linear Type Systems |
| Cross-database migration / schema merging | Category Theory | Adjoint Functors (Δ, Σ, Π) |
| Protocol-heavy multi-party concurrency | Session Types | Process Calculi |
| Resilience of communicative influence | Information Theory | SEIC / Null-Model Analysis |
Using the matrix: Start here. Identify the dominant characteristic of your problem domain, select the representation, then apply the corresponding tools from this skill. If the domain maps cleanly to a row above, use that formalism. If it doesn't — or if a simpler or more domain-native formalism exists outside this matrix — use that instead. The SDMA provides the mathematical bedrock; the principle of minimal representation governs the final selection: the simplest formalism that faithfully captures the domain's structure wins.
If the domain combines multiple characteristics (e.g., a protocol with hidden state AND resource constraints), layer the formalisms — session types for the protocol structure, linear logic for resource discipline, coalgebra for the state machine underneath.
The architect's role is translational research — linking pure mathematical truth to industrial engineering. This is a three-step pipeline:
Map the engineering problem into the correct formal representation:
Use the Decision Matrix (§6) to guide the mapping.
Apply the selected tools to ensure structural and behavioral integrity:
Deploy metrics to measure resilience against real-world failures:
The pipeline is iterative — validation results feed back into translation when the model doesn't match reality.
These extensions close four gaps in the base Atlas, extending the SDMA from pure digital/discrete modeling into continuous, constrained, uncertain, and verifiable domains.
The base Atlas models computation as functional — unidirectional input-to-output maps. Physical and cyber-physical systems have bidirectional constraints: feedback loops, conservation laws, simultaneous equations. This extension closes that gap.
The shift is from the category Set (functions) to the category REL (relations):
This deviation from discrete software logic allows modeling of physical interfaces as subspaces of interaction rather than sequential execution steps. Relations naturally handle non-deterministic or partial outputs — a physical sensor may produce a range of values, not a single one.
The mathematical basis for unbiased connectivity in signal flow diagrams is the Frobenius property:
Σ_m(m*(n) ∧ k) ≅ n ∧ Σ_m(k)
In engineering terms, this governs the "splitting" and "merging" of signal paths. Treating signal flow as a Frobenius algebra ensures that:
| Feature | Discrete Software Systems (Standard Categories) | Continuous Physical Systems (VectRel / LinRel) |
|---|---|---|
| Composition | Functional (g ∘ f) | Relational (R ⊆ I × J) |
| State Space | Sets / Discrete Types | Vector Spaces over Field K |
| Fibration Type | Subobject Fibration Sub(B) | Vector Space Fibration Vect → Fld |
| Identity/Proj | Cartesian Products I × J | Disjoint Union I + J (Terminal ∅) |
| Connectivity | Sequential / Directed | Frobenius (Unbiased / Bidirectional) |
Use LinRel when modeling systems with:
Ologs capture simple path equalities — "this path equals that path." Real-world systems require quantified logic: "for all employees in department X, there exists a manager who..." This extension layers first-order and higher-order logic over structural data.
Logic is viewed as a fibration p: E → B:
First-order quantifiers are identified as adjoints to the weakening functors induced by projections w: I × J → I:
| Operation | Formal Identity | Engineering Meaning |
|---|---|---|
| Substitution | Reindexing functor u* | Move a predicate into a new context |
| Existential quantification ∃ | Left adjoint Σ_w ⊣ w* | "There exists" — search, existence |
| Universal quantification ∀ | Right adjoint w* ⊣ Π_w | "For all" — invariant, global property |
| Equality | Left adjoint Σ_δ ⊣ δ* | Diagonal contraction — identity check |
This is a progression of expressive power:
Ologs (simple slice categories): Path equalities only (M//I over I). Basic data integrity without quantification. Use for: domain modeling, knowledge representation, simple business rules.
Hyperdoctrines (full slice categories): Enable first-order logic by providing Σ_w and Π_w across fibres. Complex, nested business rules. Use for: enterprise logic, regulatory compliance, constraint-heavy domains.
Triposes: Utilize the "realizability fibration" over the Effective Topos (Eff) to reason about the provability of predicates. Higher-order reasoning. Use for: formal verification, provably correct systems, logic programming.
Select the appropriate level based on the complexity of constraints in your domain. Don't use a tripos when an olog suffices — the additional power comes with additional complexity.
Structure alone is insufficient when the environment is noisy. This extension accommodates graded belief and stochastic transitions.
Extend standard relational models into uncertainty using j-separated families and sheaves:
In the Effective Topos, Markov's Principle holds:
∀β: 2^N, ¬¬(∃n: N. β(n)) ⊃ ∃n: N. β(n)
In engineering terms: if the agent knows it is impossible for a decidable predicate β to fail for all n, then it can computably find a witness. This justifies the use of search-based heuristics in uncertain environments — if you know a solution exists, you can find it.
For incomplete belief states, use lattice-valued logic and Kleene equality (≃):
Practical applications:
The base Atlas provides coalgebra for modeling behavior. This extension provides the dual specification language — what properties a system must satisfy — and the formal bridge between the two.
From the systems architecture perspective:
Dual to behavior is the specification language:
The SDMA uses these isomorphisms to bridge behavior and specification:
| Behavioral Side | ↔ | Specification Side |
|---|---|---|
| System dynamics (coalgebra) | ↔ | Modal operators in the dual logic |
| System state | ↔ | Set of valid formulas in the fibre E_I |
| Terminal coalgebra (carrier Ω) | ↔ | Most refined specification possible |
This duality allows the agent to approach verification from either direction — start with behavior and derive what properties hold, or start with desired properties and verify that the behavior satisfies them.
| Atlas Section | What It Solves | Key Tool |
|---|---|---|
| §1 Functorial Data Migration | Semantic data integration | Adjoint functors (Δ, Σ, Π) |
| §2 Ologs | Knowledge representation | Categorical ontology |
| §3 Coalgebraic Modeling | Behavioral equivalence | Bisimulation |
| §4 Linear Logic / Session Types | Resource discipline, protocol safety | Linear types, session types |
| §5 SEIC / Entropy | Architectural resilience | Information-theoretic metrics |
| §6 Decision Matrix | Formalism selection | Prescriptive logic |
| §7 Implementation Pipeline | Theory-to-practice bridge | Translation → Formal → Validate |
| §8 Control Gap | Continuous / bidirectional systems | LinRel, Frobenius algebras |
| §9 Constraint Gap | Quantified business logic | Hyperdoctrines, triposes |
| §10 Uncertainty Gap | Probabilistic / partial reasoning | Markov kernels, PERs |
| §11 Verification Gap | Behavior-specification correspondence | Stone duality, modal logic |
npx claudepluginhub nrdxp/predicate --plugin predicateProvides mathematical foundations for formal verification, including category theory, type theory, and logic. Useful when working with TLA+, Alloy, Lean, Coq, model checkers, invariants, or temporal logic.
Guides domain modeling with Rich Hickey's data-oriented and Scott Wlaschin's type-driven design principles. Contextualizes models, identifies inconsistencies, builds ubiquitous language, generates Mermaid/Graphviz/ASCII diagrams for types and business domains.
Creates rigorous, validated models of entities, relationships, and constraints for database schemas, knowledge graphs, ontologies, API data models, and taxonomies. Covers relational, document, graph, event/time-series, and dimensional patterns with lifecycle modeling, soft deletes, polymorphic associations, and hierarchies.