# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com# SPDX-License-Identifier: MIT---# Contextualization π β applied top-to-bottom, first matching clause wins. It is# binary, π(n, c): n is the term being contextualized and c is the context (the# expression that every free ΞΎ inside n stands for). π walks the term# structurally, replacing each ΞΎ with the context c, descending through# dispatches and applications and stopping at formations β which introduce their# own scope and are returned untouched β and at the global Ξ¦ and termination β₯.# The context c is supplied by the caller: DOT dispatching π on a formation# passes that formation WITHOUT the dispatched binding (β¦π΅1, π΅2β§), so a# self-referential ΞΎ resolves to an object that lacks π and collapses to β₯# rather than re-deriving the dispatch and diverging.## Each rule is an inference rule: when 'match' matches the term and 'c-match'# matches the context (binding the meta c), the rule yields the conclusion# 'c-result' (a premise meta or a literal), provided the ordered 'premises'# reduce as stated. A premise binds its 'n-result' to one π ('contextualize')# judgment. 'c-match' is the context-argument matcher of π(n, c); it is always# the π0 meta. Derived terms are named π1, π2, β¦ in premise order; the term π is# handed is π0, leaving that numbering to the premises alone. A meta the rule# never reads back is written bare: it matches whatever stands in its place,# binds nothing and cannot be referenced.- name: cg match: Ξ¦ c-match: π0 c-result: Ξ¦- name: cxi match: ΞΎ c-match: π0 c-result: π0- name: ct match: β₯ c-match: π0 c-result: β₯- name: cf match: β¦π΅0β§ c-match: π0 c-result: β¦π΅0β§- name: cd match: 'π0.π0' c-match: π0 c-result: 'π1.π0' premises: - n-result: π1 contextualize: - π0 - π0- name: ca match: 'π0(π0 β¦ π1)' c-match: π0 c-result: 'π1(π0 β¦ π2)' premises: - n-result: π1 contextualize: - π0 - π0 - n-result: π2 contextualize: - π1 - π0- name: caa match: 'π0(Ξ±π0 β¦ π1)' c-match: π0 c-result: 'π1(Ξ±π0 β¦ π2)' premises: - n-result: π1 contextualize: - π0 - π0 - n-result: π2 contextualize: - π1 - π0