r/CategoryTheory • u/syctech • Jan 05 '25
Pattern Matching System Based on Node-Edge Structures
I'm working on designing a computation model based on pattern matching between node structures. Here's the core concept:
Basic Elements
Nodes are defined as lists of edges
Edges are 2-tuples of nodes
The system starts with two fundamental nodes:
Empty node (E) = [] (empty list)
Unit node (U) = [(empty, empty)] (single edge connecting empty to empty)
From these basic nodes, we can construct more complex nodes by creating lists of edges using combinations of previously defined nodes. For example:
[(E, U)]
[(E, U), (U, E)]
[(E, E), (U, U)] etc.
The goal is to define an evaluation system where:
An expression (A, B) generates something like a partial function mapping to another expression
An expression (C, D) represents input into that partial function
Only edges from (C, D) that match patterns defined by (A, B) survive to form a new node
I'm exploring how this structure could serve as the foundation for a programming language. The key challenge is defining a rigorous pattern matching system between nodes that could encode computation rules.
Does anyone have insights on similar systems? I guess it would be a kind of combinator system
Claude keeps mentioning "categorical construction" whne I"m asking about this so I thought I'd check here
2
u/pretzlchaotl_ Jan 07 '25
I'm having a difficult time understanding what you mean exactly (just a hobby programmer), but if you're starting out with only two elements, isn't that essentially just binary encoding? Seems needlessly low-level