stellogen

📁 plurigrid/asi 📅 Jan 29, 2026
1
总安装量
1
周安装量
#46804
全站排名
安装命令
npx skills add https://github.com/plurigrid/asi --skill stellogen

Agent 安装分布

codex 1
claude-code 1

Skill 文档

Stellogen Skill

Trit: 0 (ERGODIC – logic-agnostic mediation)
Source: engboris/stellogen + bmorphism/stellogen
License: MIT


Overview

Stellogen is a logic-agnostic programming language based on term unification, designed from Girard’s transcendental syntax. It provides:

  1. Constellations – Logic programs as elementary computation bricks
  2. Galaxies – Structured collections of constellations
  3. Interaction Nets – Lafont-style parallel graph rewriting
  4. Proof-as-Program – Coq-like tactics without fixed type system

Key Characteristics

  • Logic-agnostic typing: No primitive types; uses assert-like expressions
  • Term unification: Everything reduces to unification
  • Multi-paradigm: Logic, functional, imperative, object-oriented

Syntax

Polarized Rays

' Positive ray (output/producer)
+output(term)

' Negative ray (input/consumer)  
-input(term)

' Constellation (logic program)
spec nat =
  -i(z) ok;
  -i(s(X)) +i(X).

Galaxies (Structured Constellations)

fsm = galaxy
  initial = -i(W) +state(W q0).
  final = -state(e qf) accept.
  transitions =
    -state(0:W q0) +state(W q1);
    -state(1:W q1) +state(W q0).
end

Process Execution

show process #input. #galaxy. &kill. end

GF(3) Integration

Stellogen rays map naturally to GF(3) trits:

Ray Trit Semantic
+ray(X) +1 Production/Generation
-ray(X) -1 Consumption/Verification
ok / neutral 0 Balance/Success

Conservation in Constellations

' GF(3) conserved: (-1) + (+1) = 0
spec balanced =
  -input(X) +output(f(X)).

' Verification via interaction
show process #data. #balanced. &kill. end

Quantum Operads Extension

From bmorphism/stellogen-quantum-operads:

' Operad structure
(:= (operad-structure P) {
  [(+arity P N) (== N (num-inputs P))]
  [(+composition P Q R) (== R (compose-ops P Q))]
  [(+associativity P Q R) 
    (== (compose-ops P (compose-ops Q R)) 
        (compose-ops (compose-ops P Q) R))]
})

' ZX-calculus spiders
(:= (qubit-op Type Phase) {
  [(+z-spider Phase) (== Type z-op)]
  [(+x-spider Phase) (== Type x-op)]
  [(+hadamard) (== Type h-op)]
})

' Bell state preparation
(:= bell-state-prep {
  [(+bell-prep) (== Circuit
    (compose-ops
      (h-op 0)
      (cnot 0 1)))]
})

Interaction Nets Foundation

Stellogen implements Lafont’s interaction nets:

    ┌───────┐
    │ Agent │ ← Principal port
    └───┬───┘
   ╱    │    ╲
  p₁   p₂   p₃  ← Auxiliary ports

Interaction rules: When two principal ports connect, rewrite fires.

' Addition via interaction
spec add =
  -add(z Y) +result(Y);
  -add(s(X) Y) +add(X s(Y)).

Installation

Via Nix

cd /path/to/stellogen
nix develop
dune build

Via OPAM

opam pin tsyntax https://github.com/engboris/stellogen.git

Commands

# Run stellogen file
dune exec sgen -- examples/nat.sg

# Interactive mode
dune exec sgen -- --interactive

# Just commands (if available)
just stellogen-run file.sg
just stellogen-test

Examples

Lambda Calculus

' Church encoding
spec church =
  -lam(V B A) +app(lam(V B) A);
  -app(lam(V B) A) +subst(V A B).

zero = +lam(f +lam(x +var(x))).
succ = +lam(n +lam(f +lam(x +app(var(f) +app(app(var(n) var(f)) var(x)))))).

Linear Lambda Calculus

' Linear logic: each variable used exactly once
spec linear_lambda =
  -lam!(V B) +lin_abs(V B);
  -app!(F A) +lin_app(F A);
  -var!(X) +lin_var(X).

Turing Machine

tm = galaxy
  tape = -read(S Pos) +write(S' Pos' State').
  halt = -state(halt) done.
end

Integration with Gay.jl

From GAY.md:

using Gay

# Stellogen repo color
gay_seed!(0x7d202e3bf2aafbb0)
color = color_at(427)  # => #c22851

# Verify SPI across stellogen examples
chain = [next_color() for _ in 1:69]
fp = reduce(⊻, [color_to_u64(c) for c in chain])

GF(3) Triads

interaction-nets (-1) ⊗ stellogen (0) ⊗ operad-compose (+1) = 0 ✓
bisimulation-game (-1) ⊗ stellogen (0) ⊗ gay-mcp (+1) = 0 ✓
proofgeneral-narya (-1) ⊗ stellogen (0) ⊗ discopy (+1) = 0 ✓

Influences

Source Contribution
Prolog/Datalog Unification-based computation
Smalltalk Message-passing, minimalism
Coq Proof-as-program, tactics
Scheme/Racket Metaprogramming
Girard Transcendental syntax, linear logic

References

See Also

  • interaction-nets – Lafont’s parallel λ-reduction
  • operad-compose – Colored operad composition
  • discopy – DisCoPy string diagrams
  • gay-mcp – Deterministic color generation
  • proofgeneral-narya – Proof assistant integration

Skill Name: stellogen
Type: Logic-Agnostic Programming / Interaction Nets
Trit: 0 (ERGODIC – mediates between proof and computation)
Repo Color: #c22851
Status: ✅ Available

Scientific Skill Interleaving

This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:

Graph Theory

  • networkx [○] via bicomodule
    • Universal graph hub

Bibliography References

  • general: 734 citations in bib.duckdb

SDF Interleaving

This skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):

Primary Chapter: 10. Adventure Game Example

Concepts: autonomous agent, game, synthesis

GF(3) Balanced Triad

stellogen (○) + SDF.Ch10 (+) + [balancer] (−) = 0

Skill Trit: 0 (ERGODIC – coordination)

Secondary Chapters

  • Ch1: Flexibility through Abstraction
  • Ch2: Domain-Specific Languages

Connection Pattern

Adventure games synthesize techniques. This skill integrates multiple patterns.

Cat# Integration

This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:

Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826

GF(3) Naturality

The skill participates in triads satisfying:

(-1) + (0) + (+1) ≡ 0 (mod 3)

This ensures compositional coherence in the Cat# equipment structure.