Labeling & Semantic Energy Accounting in Focus‑Flow Computation
**purpose ** Provide a concise, self‑contained reference on (1) the minimal node/edge labeling scheme (atom / pair / function + 5 rewrite ops + 3 edge types) and (2) how those edge labels connect to the four free‑energy terms (spring, diffusion, context, entropy).
1 Node kinds (universality primitives)
| kind | payload | why it’s enough |
|---|---|---|
| atom | integer / byte‑string | base data, constants |
| pair | two edge slots left,right | builds lists, trees, maps |
| function | pointer to body sub‑graph + argument port | encodes λ‑terms / SK combinators |
1.1 Graph rewrite ops (5)
- construct (atom/pair/function) 2. destruct (left/right access) 3. apply (connect function→arg) 4. rewrite (beta‑substitute, returns new node) 5. delete (remove unreachable)
These five ops give full Turing power while remaining local & deterministic.
2 Edge types – the semantic layer
Only three labels are needed to map structural links onto energy terms:
| label | semantic intuition | goes into energy |
|---|---|---|
| h‑edge | “is‑a / part‑of” taxonomic constraint | spring (E_{spring}) (hierarchy smoothing) |
| d‑edge | reference / citation / transport path | diffusion (E_{diff}) (mass transport cost) |
| c‑edge | transient vote / query / context injection | context term (C_i) |
(All other relations — causal, vote, ref, meta, etc.— are aliases that map onto one of these three for energy accounting. You can refine later by splitting labels.)
3 Semantic energy accounting
Goal. Attach a physical‑style “cost” to each edge so probabilistic focus flow has meaningful gradients.
3.1 Spring energy (hierarchy)
For node i:
N_h(i) = neighbours via h‑edges; k_h = stiffness constant.
3.2 Diffusion energy (transport)
N_d(i) over d‑edges; weight inverse to edge distance.
3.3 Context potential
E_c = c‑edges connected to i. Higher votes/queries push probability up.
3.4 Entropy term
Standard Gibbs entropy over node probabilities keeps exploration.
Semantic energy accounting = mapping edge labels → coefficients (k_h,k_d,c_i) so each local update only needs neighbour information.**
4 Putting it together – local update
Conservation enforced every k ticks ⇒ (∑ p_i = 1).
5 Why only three edge types?
Separating concerns:
- Structure/execution handled by node kinds + 5 ops.
- Semantics/energy handled by edge label → coefficient.
This keeps the core rewrite engine minimal while still letting us expand semantics later: splith‑edgeintoisavspartord‑edgeintorefvstransby assigning different constants without touching algorithms.
6 Example
- Add node “Cat” atom.
- Add h‑edge Cat→Animal (weight 1).
- Add d‑edge Cat→Wikipedia‑Cat (weight 0.5).
- User asks “What is a Cat?” → adds a c‑edge (query) into Cat.
Focus flow pushes mass to Cat and its neighbourhood; spring keeps Cat near Animal; diffusion pulls in pages; entropy prevents collapse.
7 Take‑aways
- Minimal labeling = comprehension + scalability.
- Semantic energy accounting links edge labels to physical‑style costs.
- Together with node primitives, the system is both Turing‑complete and meaning‑aware without bloating the protocol.