phino-0.0.141: resources/normalize/dot.yaml
# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# Dispatch π1 on a formation: contextualize the dispatched body π1 and decorate
# it with the whole formation as Ο. The contextualization context is the
# formation WITHOUT the dispatched binding β β¦π΅1, π΅2β§, not β¦π΅1, π1 β¦ π1, π΅2β§ β
# so a self-referential ΞΎ inside π1 (as in β¦ a β¦ ΞΎ β§.a or β¦ a β¦ ΞΎ.a β§.a) no
# longer sees π1. Such a self-reference then dispatches on a formation that
# lacks π1 and collapses to β₯ via stop/null/dd instead of rebuilding the same
# β¦β¦, π1 β¦ π1, β¦β§.π1 term and looping forever. Ο on line 'result' still binds
# the full formation, so sibling and Ο-decoration references stay intact β only
# the self-ΞΎ path narrows, keeping normalization (near-)total.
# The rule does not dispatch on a formation holding both Ξ» and Ξ: 'dl' says
# such a formation is β₯, and carrying it out into Ο would leave a Ο β¦ β₯ in a
# normal form that 'dl' firing first reduces to β₯ outright, so the answer would
# hang on rule order (#1395).
# The Ο carries the name of the formation where it has one: the whole program
# is 'Ξ¦', and a formation reached as 'Ξ¦.number', or as 'Ξ¦.number( Ο β¦ π )', is
# an object of the immutable world, so the 'named' function writes that name
# back instead of the object, and a dispatch off it does not copy the program
# or every method the object declares into the term (#1318, #1446). The world
# 'named' looks the name up in is phino's to know, not the rule's: the rule is
# about a term alone and never binds the world itself (#1460). Where the
# formation has no name, or no world is known β the 'rewrite' command, and
# 'isNF' asking about a term on its own β 'named' answers with the formation
# itself and the Ο holds it.
name: dot
pattern: β¦π΅1, π1 β¦ π1, π΅2β§.π1
when:
not:
in:
- [Ξ, Ξ»]
- [π΅1, π΅2]
result: π1(Ο β¦ π2)
where:
- meta: π1
function: contextualize
args:
- π1
- β¦π΅1, π΅2β§
- meta: π2
function: named
args:
- β¦π΅1, π1 β¦ π1, π΅2β§