# 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 e meta. The single bytes result is named Ξ΄. A# normal-form-valued result (π 'morph', π© 'normalize') is named π, π1, β¦ in# premise order, skipping the bare π only when 'match' already binds it; an# expression-valued result (π 'contextualize', πΌ 'evaluate') 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', π itself being the universe)# rather than an π name reserved for normal forms.## The clauses are disjoint, so their relative order does not change behavior.# 'norm' matches the bare meta π, which unifies with any expression, so it is# guarded to fire only when π is neither a formation ('not (formation π)',# carving out 'delta', 'box', 'fire' and 'none') nor the termination β₯# ('not (π = β₯)'). π» 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, Ξ β€ Ξ΄, π΅2β§ e-match: π d-result: Ξ΄- name: box match: β¦π΅1, Ο β¦ π1, π΅2β§ e-match: π d-result: Ξ΄ when: disjoint: - [Ξ, Ξ»] - [π΅1, π΅2] premises: - n-result: π2 contextualize: - π1 - β¦π΅1, Ο β¦ π1, π΅2β§ - n-result: π1 normalize: π2 - d-result: Ξ΄ dataize: π1- name: fire match: β¦π΅1, Ξ» β€ π, π΅2β§ e-match: π d-result: Ξ΄ premises: - n-result: π1 evaluate: - β¦π΅1, Ξ» β€ π, π΅2β§ - π - n-result: π1 normalize: π1 - d-result: Ξ΄ dataize: π1- name: none match: β¦π΅β§ e-match: π d-result: Ξ΄ when: disjoint: - [Ξ, Ξ», Ο] - [π΅] premises: - d-result: Ξ΄ dataize: β₯- name: norm match: π e-match: π d-result: Ξ΄ when: and: - not: formation: π - not: eq: - π - β₯ premises: - n-result: π1 morph: π - d-result: Ξ΄ dataize: π1