recursive-string-diagrams
Recursive random string diagram generation with white trapezoid as the atomic skill primitive.
| Symbol | Name | Meaning |
|---|---|---|
āāāāā· |
White Trapezoid | Skill = morphism with typed ports |
ā |
Compose | Sequential skill chaining |
ā |
Tensor | Parallel skill execution |
āŗ |
Trace | Feedback loop / recursion |
Each white trapezoid carries a trit:
Conservation: Σ trits ┠0 (mod 3) across diagram
;; Generate random diagram depth 4
(random-diagram 0 4)
;; Render ASCII
(render-ascii diagram 0)
ā tensor
āŗ trace[1]
āāāāā· [3ā2] ergodic
ā compose
āāāāā· [2ā2] minus
āāāāā· [3ā3] plus
| String Diagram | Rama Primitive |
|---|---|
| White Trapezoid | ETL topology |
| Compose (ā) | Depot chain |
| Tensor (ā) | Parallel PStates |
| Trace (āŗ) | Recursive query |
from discopy import Ty, Box, Diagram
# White trapezoid as Box
skill = Box('skill', Ty('in'), Ty('out'))
# Compose
d1 >> d2
# Tensor
d1 @ d2
# Trace
d.trace(n)
[inputs ā outputs]{ā, ā, āŗ} up to depth~/.claude/skills/<name>/SKILL.mddiscopy - String diagram libraryacsets - Algebraic databasesrama-gay-clojure - Rama + GF(3) colorsThis skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):
Concepts: generic arithmetic, coercion, symbolic, numeric
recursive-string-diagrams (ā) + SDF.Ch3 (ā) + [balancer] (+) = 0
Skill Trit: -1 (MINUS - verification)
Generic arithmetic crosses type boundaries. This skill handles heterogeneous data.