本文へ移動
cccskills
無料GitHub で公開

cat-tripartite

Category Theory Tripartite: SICP generic dispatch, CTP Racket categories, CatColab double theories across 3 parallel worldlines with GF(3) conservation

インストール方法を見る

含まれるファイル(3)

  • SKILL.md7.0 KB
  • CONCOMITANT_SKILLS.md1.6 KB
  • SKILL.md.bak6.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

CAT# - Category Theory Tripartite Skill

Three worldlines, one universal property

Core Triad

SICP (-1) ⊕ CTP (0) ⊕ CatColab (+1) = 0 mod 3 ✓
WorldlineLanguageDispatchOrder ProblemResolution
-1 SICPScheme(put 'op '(t1 t2) proc)Coercion tower fixedExplicit hierarchy
0 CTPRacket(category-compose C f g)Functors associativeNatural transformations
+1 CatColabJulia/Rustelaborate_model(theory)Concurrent editsAutomerge CRDT

Worldline -1: SICP Generic Operations

From SICP §2.5 + SDF §3.1:

;; Data-directed dispatch table
(put 'add '(complex complex)
  (lambda (z1 z2) (tag 'complex (add-complex z1 z2))))

;; Coercion tower (ORDER MATTERS)
(put-coercion 'scheme-number 'complex scheme-number->complex)

;; SDF extension pattern
(define (extend-generic-arithmetic! generic-arithmetic extender)
  (add-to-generic-arithmetic! generic-arithmetic
    (extender generic-arithmetic)))

;; The problem: "construction is by assignment"
(extend-generic-arithmetic! g symbolic-extender)
(extend-generic-arithmetic! g function-extender)  ; ORDER DEPENDENT

Key insight: set! introduces temporal ordering into what should be compositional.

Worldline 0: CTP Racket Categories

From NoahStoryM/ctp:

#lang racket
(require ctp)

;; Category as first-class value
(define-category Nat
  #:objects natural?
  #:morphisms (λ (a b) (and (natural? a) (natural? b) (<= a b)))
  #:identity (λ (a) a)
  #:compose (λ (f g) g))  ; transitivity

;; Functor: structure-preserving map
(define-functor F
  #:from Nat
  #:to Set
  #:object-map (λ (n) (range n))
  #:morphism-map (λ (f) (λ (s) (take s (length s)))))

;; Natural transformation: morphism of functors
(define-natural-transformation η
  #:from F
  #:to G
  #:component (λ (a) (λ (x) (list x))))

Key insight: Composition is associative by axiom—order independence built in.

Worldline +1: CatColab Double Theories

From CatColab catlog (Rust):

// Double theory: 2-categorical structure
pub trait DblTheory: VDblCategory {
    type ObType;   // Object generators
    type MorType;  // Morphism generators
    type ObOp;     // Object operations  
    type MorOp;    // Morphism operations
}

// Stock-Flow theory for epidemiology
pub fn th_stock_flow() -> DiscreteDblTheory {
    let mut cat = FpCategory::new();
    cat.add_ob_generator(name("Stock"));
    cat.add_mor_generator(name("Flow"), name("Stock"), name("Stock"));
    cat.add_mor_generator(name("Link"), name("Stock"), name("Stock"));
    cat.into()
}

// Extension via DPO rewriting (order-independent)
let extended = compose_theories(th_stock_flow(), th_vaccination());

Key insight: Automerge CRDT resolves concurrent extensions without ordering.

The Universal Property

All three worldlines converge on the same universal construction:

         extend
Base ──────────→ Extended
  │                 │
  │ U               │ U'
  ↓                 ↓
 Set ───────────→ Set
         F

The extension is universal iff the square commutes AND the extension is minimal.

Interleaving SDF + CTP

SDF §3.2 Predicate Dispatch → CTP Functor

;; SDF: predicate dispatch eliminates order dependence
(define (make-generic-operation name arity default-operation)
  (let ((rules '()))
    (define (add-rule! predicate handler priority)
      (set! rules (insert-by-priority rules predicate handler priority)))
    ...))

;; CTP equivalent: rules as morphisms in a category
(define-category DispatchRules
  #:objects type-predicate?
  #:morphisms (λ (p1 p2) (implies? p1 p2))  ; subsumption
  #:identity identity-predicate
  #:compose predicate-conjunction)

SDF §7 Propagators → CTP Limits

;; SDF: propagator as cell network
(define (make-propagator neighbors output-proc)
  ...)

;; CTP: propagator network as diagram, solution as limit
(define-diagram PropNet
  #:shape (category-of-graph propagator-graph)
  #:functor (λ (node) (cell-value node)))

(define solution (limit PropNet))  ; universal property!

AFL Parallel

Coverage-guided fuzzing shares structure with generic dispatch:

AFL                          Generic Arithmetic
────────────────────────────────────────────────
seed corpus            ↔     base arithmetic
mutation operators     ↔     extenders
coverage bitmap        ↔     dispatch store
path discovery         ↔     type combinations
mutation ORDER         ↔     extension ORDER
priority schedules     ↔     predicate priorities

UV One-Liner Bridge

# Python bridge to all three
uv run --no-project --with requests --with networkx python3 << 'EOF'
import networkx as nx

# Model the tripartite as a graph
G = nx.DiGraph()
G.add_edge("SICP", "CTP", weight=-1, label="lift dispatch to functor")
G.add_edge("CTP", "CatColab", weight=0, label="double theory")
G.add_edge("CatColab", "SICP", weight=+1, label="CRDT resolves order")

# GF(3) check
total = sum(d['weight'] for _, _, d in G.edges(data=True))
print(f"GF(3) sum: {total} mod 3 = {total % 3}")
assert total % 3 == 0, "Conservation violated!"
EOF

End-of-Skill Interface

Commands

# Clone CTP
git clone https://github.com/noahstorym/ctp ~/worlds/ctp
cd ~/worlds/ctp && raco pkg install

# Run CTP examples
racket -l ctp -e '(require ctp/examples/nat)'

# Interleave with SDF
just cat-tripartite-sicp    # Extract SICP §2.5
just cat-tripartite-ctp     # Run CTP category examples
just cat-tripartite-catcolab # Start CatColab dev server

# Verify GF(3) conservation
just cat-tripartite-verify

References

SICP (-1)

CTP (0)

CatColab (+1)


Skill: cat-tripartite
Trit: Balanced (contains all three)
GF(3): (-1) + (0) + (+1) = 0 ✓


Autopoietic Marginalia

The interaction IS the skill improving itself.

Every use of this skill is an opportunity for worlding:

  • MEMORY (-1): Record what was learned
  • REMEMBERING (0): Connect patterns to other skills
  • WORLDING (+1): Evolve the skill based on use

Add Interaction Exemplars here as the skill is used.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Model ElevenLabs voice synthesis as an ACSet schema with Unison ability handlers for typed voice operations. Use when integrating ElevenLabs TTS into category-theoretic pipelines, building typed voice synthesis workflows, or managing multi-voice narration with GF(3) conservation.

日本語の概要は準備中です。原文の説明を表示しています。

plurigrid/asi672026年7月10日 更新

Systematic process for analyzing and modernizing legacy applications to comply with the 12-Factor App methodology. Covers code analysis, configuration externalization, dependency management, and container/Kubernetes best practices.

日本語の概要は準備中です。原文の説明を表示しています。

plurigrid/asi672026年7月10日 更新

13c0e3

無料

Gay MCP skill at invocation 26

日本語の概要は準備中です。原文の説明を表示しています。

plurigrid/asi672026年7月10日 更新

19d57d

無料

Gay MCP skill at invocation 5

日本語の概要は準備中です。原文の説明を表示しています。

plurigrid/asi672026年7月10日 更新

1ea91a

無料

Gay MCP skill at invocation 27

日本語の概要は準備中です。原文の説明を表示しています。

plurigrid/asi672026年7月10日 更新

1eab21

無料

Gay MCP skill at invocation 3

日本語の概要は準備中です。原文の説明を表示しています。

plurigrid/asi672026年7月10日 更新

plurigrid のスキルをすべて見る

このスキルの問題を報告する