with one click
algebraic-rewriting
Category-theoretic graph rewriting with DPO, SPO, and SqPO pushouts for C-Sets. Declarative transformation of acset data structures.
Menu
Category-theoretic graph rewriting with DPO, SPO, and SqPO pushouts for C-Sets. Declarative transformation of acset data structures.
Based on SOC occupation classification
| name | algebraic-rewriting |
| description | Category-theoretic graph rewriting with DPO, SPO, and SqPO pushouts for C-Sets. Declarative transformation of acset data structures. |
| metadata | {"trit":-1,"color":"#0BAD20"} |
AlgebraicRewriting.jl is a Julia library for performing category-theoretic rewrites over C-Sets and other Catlab.jl data structures.
| Type | Description | Use Case |
|---|---|---|
| DPO | Double Pushout | Safe deletion (no dangling edges) |
| SPO | Single Pushout | Greedy deletion |
| SqPO | Sesqui-Pushout | Cloning + deletion |
A rewrite rule consists of:
using AlgebraicRewriting
# Define a rule: merge two vertices
L = @acset Graph begin V=2; E=1; src=[1]; tgt=[2] end
K = @acset Graph begin V=1 end
R = @acset Graph begin V=1 end
rule = Rule(L, K, R)
G = @acset Graph begin
V = 4
E = 3
src = [1, 2, 3]
tgt = [2, 3, 4]
end
# Find matches and rewrite
matches = homomorphisms(L, G)
G′ = rewrite(rule, G, matches[1])
L ←─ K ─→ R
↓ ↓ ↓
G ←─ D ─→ H
The context D ensures no "dangling edges" after deletion.
Supports cloning via the final pullback complement:
# Clone a vertex
L = @acset Graph begin V=1 end
K = @acset Graph begin V=1 end
R = @acset Graph begin V=2 end
clone_rule = Rule(L, K, R; type=:SqPO)
# sRGB boundary learning with rewriting seed
gay_seed!(0xabfca37b6b4bc699)
# Forward mode autodiff
∂params = Enzyme.gradient(Forward, loss, params, seed)
0xabfca37b6b4bc699algebraic-rewriting (-1) ⊗ acsets-hatchery (0) ⊗ gay-monte-carlo (+1) = 0 ✓
acsets-hatchery - ACSet data structurestopos-adhesive-rewriting - Adhesive categoriesdpo-rewriting - Graph transformationworld-a - AlgebraicJulia ecosystemPart of: para-mensch-commons.
Query and explore the 2600: The Hacker Quarterly magazine archive (1984-present) via DuckDB. Provides structured access to 168+ issues covering hacker culture, security, privacy, telephony, and digital rights without loading full content into context.
ACSets (Attributed C-Sets): Algebraic databases with Specter-style bidirectional navigation. Category-theoretic formalism for relational databases.
Attributed C-Sets as algebraic databases. Category-theoretic data structures generalizing graphs and dataframes with Gay.jl color integration.
ACSets (Attributed C-Sets): Algebraic databases with Specter-style bidirectional
Bridge active inference theory with robot control using K-Scale's JAX/MuJoCo stack. Use when connecting predictive coding to locomotion policies, mapping KL divergence minimization to RL training, applying mean field approximation to robotics state estimation, or implementing sim2real as inference about future observations.
Implement affective valence as directional derivative of interoceptive energy landscapes for AI alignment. Use when building alignment-aware RL agents, validating GF(3) conservation in reward signals, training Langevin-based policies, or analyzing fold-change detection signals in POMDP environments.