Separate from the Neos application, PNP Compute is a formal framework for composable agentic systems — pre-alpha research into typed primitives, categorical composition, and the Trinity architecture.
Typed Python DSL. Primitives: Neuro, Flow, Plan, Memory, Effect, Budget. Composition operators. Categorically grounded.
A composed network of neuros — authored in NeuroLang, packaged as a runnable, shareable artifact. The thing you ship.
The formal execution environment that hosts NeuroNets. The runtime model, memory graph, and composition semantics live here.
Neos is the practical application built on these ideas. See Neos →
NeuroLang is not a wrapper. It is the systematic exploitation of a sixty-year-old mathematical insight — that grammar, computation, and tensor networks share a common structure — for the design of a programming framework. The categorical research is the language's bones.
Symbolic. Neural. Categorical. Linguistic. Same object, different views — because the higher-categorical formalism and the tensor-network formalism are mathematically identified.
Typed, inspectable, composable, deterministic where it matters. mypy-checked phantom types. Effects in types. Plans as values.
Differentiable, integrable, learnable end-to-end. Where flows are differentiable, JAX wires them through.
Higher-dimensional, structurally sound, composable at every level. Lambek, Curry-Howard-Lambek, Coecke et al. — the formalism is established.
Addressable in natural language (Hindi, English, …) with a cached bidirectional compiler realised as the unit and counit of an adjunction.
Three apparently distinct domains turn out to be the same mathematical structure. Establishing this is the work of sixty years; exploiting it is the work of NeuroLang.
| Natural Language | Category Theory | Computation / Tensor Network |
|---|---|---|
| Noun | Object (dim 0) | Tensor index / vector slot |
| Verb | Morphism (dim 1) | Linear map / tensor contraction |
| Adverb | Natural transformation (dim 2) | Higher-order tensor operation |
| Sentence | Composed arrow / commutative diagram | Computation graph |
| Paragraph | Diagram in a category | Module of computation |
| Translation | Equivalence of categories | Reparameterisation |
| Grammar itself | Category of grammatical types (Lambek) | Type system of the network |
A primitive may not be introduced unless its dimension is justified. The ladder runs from Dim 0 (substrate) to Dim ∞ (reflection).
pure, llm, tool, human, time) — each effect is an arrow in a sub-category.The fundamental lemma — established by Penrose (1971) and formalised by Joyal-Street (1991): a morphism in a monoidal category, drawn as a string diagram, is the same mathematical object as a tensor network.
When you compose neuros into a flow, the diagram you construct is literally a tensor network. When the system trains, gradients flow through that network. When you inspect, the same network is rendered as a categorical diagram.
This is what makes a NeuroLang program a neural network in disguise — but a neural network with typed structure, categorical guarantees, and symbolic inspectability that contemporary ML systems lack.
The natural-language authoring surface is realised mathematically as a pair of functors between two categories. Caching is no longer a performance optimisation — it is the unit and counit data of the adjunction, made into storage.
left-adjoint: L : NL → Formal (compile)
⊣
right-adjoint: R : Formal → NL (summarise)
Every NL prompt round-trips through formal compilation back to a normalised NL summary. The cache stores η per prompt.
Every formal program round-trips through summarisation back to an executable program. The cache stores ε per program.
Compile-then-summarise is identity-up-to-cache. Summarise-then-compile is identity-up-to-cache. Self-consistency is enforceable.
When the LLM model changes, the cache is invalidated — but only the parts whose adjunction-coherence breaks. Verifiable. Far stronger than "rebuild on new model."
Each memory layer is a functor into the substrate. They compose: a single read may pass through compressed → semantic → episodic before yielding a vector. Each transition is a typed arrow with cost and effect annotations.
| Layer | Kind | Properties |
|---|---|---|
| Discrete | Key-value, exact | Determinism, fast lookup, brittle |
| Differentiable | Soft-attention store | Gradient flow through recall |
| Compressed | Sparse / low-rank / quantised | Capacity vs precision trade |
| Hyperdimensional | High-dim vectors with binding/bundling | Compositional, fault-tolerant, semantic |
| Episodic | Time-indexed | Sequence of experiences, retrievable by recency or relevance |
| Semantic | Concept-indexed | Long-term abstracted knowledge |
| Procedural | Skill-as-flow | Memory that executes |
NeuroLang doesn't commit to one logic. It admits a hierarchy. Every logical expression decomposes uniquely (up to canonical isomorphism) into a tree of primitive operators.
| Logic | Truth values | Use |
|---|---|---|
| Boolean | {true, false} | Hard constraints, deterministic flow |
| Fuzzy | [0, 1] | Soft constraints, partial matches |
| Probabilistic | distributions | Bayesian inference, uncertainty propagation |
| Modal | possible-world indexed | Counterfactuals, planning |
| Higher-order | predicates of predicates | Meta-reasoning |
| Linear | resource-aware | Effect tracking, single-use credentials |
A consequence: the symbolic and the neural meet in the logic layer. A fuzzy logical formula is differentiable. A probabilistic formula admits gradient-based posterior inference. A Boolean formula is the deterministic limit of these. The user writes one expression; the runtime chooses the appropriate semantics.
Computing is undergoing a fundamental shift. We are advancing through clearly defined epochs, moving beyond monolithic models into hierarchical intelligence.
Every claim above traces back to established work in category theory, linguistics, type theory, and categorical foundations of machine learning.