# 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