packages feed

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⟧