packages feed

phino-0.0.125 / resources / dataization.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com# SPDX-License-Identifier: MIT---# Dataization 𝔻 β€” applied top-to-bottom, first matching clause wins. It is# ternary, 𝔻(n, e, s): the second argument e is the global universe, the same# expression that 𝕄 takes as its second argument (𝔻 forwards it to 𝕄), and the# third argument s is the mutable state, threaded through and returned possibly# changed. Only the 'fire' rule changes it, by firing an atom through 𝔼. The# first argument is always a normal form: a non-NF expression matches no clause.## Each rule is an inference rule: when 'match' matches the term and 'e-match'# matches the universe (binding the meta e), the rule yields the conclusion# 'd-result' (a premise bytes meta or a literal), provided 'when' holds and the# ordered 'premises' reduce as stated. A premise binds its 'n-result'/'d-result'# to one judgment β€” 𝔻 ('dataize'), 𝕄 ('morph'), 𝒩 ('normalize'), 𝔼 ('evaluate')# or π’ž ('contextualize'). 'e-match' is the universe-argument matcher of# 𝔻(n, e); it is always the 𝑒0 meta. The single bytes result is named Ξ΄0. A# normal-form-valued result (𝕄 'morph', 𝒩 'normalize', 𝔼 'evaluate') is named# 𝑛1, 𝑛2, … in premise order; the term 𝔻 is handed is 𝑛0, leaving that# numbering to the premises alone. An expression-valued result (π’ž# 'contextualize') is not a normal form β€” that is why a 'normalize' premise# follows it β€” so it takes an 𝑒-family name (𝑒1, 𝑒2, …, the next index free of# 'match', 𝑒0 itself being the universe) rather than an 𝑛 name reserved for# normal forms. A meta the rule never reads back is written bare: it matches# whatever stands in its place, binds nothing and cannot be referenced.## The clauses are disjoint, so their relative order does not change behavior.# 'norm' matches the lone meta 𝑛0, which unifies with any expression, so it is# guarded to fire only when 𝑛0 is neither a formation ('not (formation 𝑛0)',# carving out 'delta', 'box', 'fire' and 'none') nor the termination βŠ₯# ('not (𝑛0 = βŠ₯)'). 𝔻 is partial: βŠ₯ (the terminator T) signals an error and# lies outside its domain, so it deliberately matches no clause and dataization# stops there β€” there is no 'end' rule mapping βŠ₯ to empty bytes (see #955).# Without the guard 'norm' would behave correctly only by being declared last;# with it the clauses no longer rely on their order.- name: delta  label: \Delta  match: ⟦𝐡1, Ξ” ‍ Ξ΄0, 𝐡2⟧  e-match: 𝑒0  d-result: Ξ΄0- name: box  match: ⟦𝐡1, Ο† ↦ 𝑒1, 𝐡2⟧  e-match: 𝑒0  d-result: Ξ΄0  when:    disjoint:      - [Ξ”, Ξ»]      - [𝐡1, 𝐡2]  premises:    - n-result: 𝑒2      contextualize:        - 𝑒1        - ⟦𝐡1, Ο† ↦ 𝑒1, 𝐡2⟧    - n-result: 𝑛1      normalize: 𝑒2    - d-result: Ξ΄0      dataize: 𝑛1- name: fire  match: ⟦𝐡1, Ξ» ‍ 𝑓0, 𝐡2⟧  e-match: 𝑒0  d-result: Ξ΄0  premises:    - n-result: 𝑛1      evaluate:        - ⟦𝐡1, Ξ» ‍ 𝑓0, 𝐡2⟧        - 𝑒0    - d-result: Ξ΄0      dataize: 𝑛1- name: none  match: ⟦𝐡0⟧  e-match: 𝑒0  d-result: Ξ΄0  when:    disjoint:      - [Ξ”, Ξ», Ο†]      - [𝐡0]  premises:    - d-result: Ξ΄0      dataize: βŠ₯- name: norm  match: 𝑛0  e-match: 𝑒0  d-result: Ξ΄0  when:    and:      - not:          formation: 𝑛0      - not:          eq:            - 𝑛0            - βŠ₯  premises:    - n-result: 𝑛1      morph: 𝑛0    - d-result: Ξ΄0      dataize: 𝑛1