packages feed

phino-0.0.160: test-resources/evaluate-packs/joins-a-bare-symbol-a-cast-brought-into-the-shape-of-a-decorator.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The right side is a bare symbol, a branch that already reached its data,
# while the left side wraps its data in φ and holds 'k' beside it, a branch
# one step short of its data. As they are, the two differ at .k, the right
# side has Ī», and the join diverges, even under 'otherwise' (#2187). A 'cast'
# block reads its two metas as one pair and casts the bare symbol into a copy
# of the left side with šœŽ3 in place of šœŽ2 at the end of its φ chain, so the
# two sides differ in their symbols alone and the join makes one term of them.
# The cast mints no symbol. The protocol writes the line of 'š‘›20', which took
# the cast, as 'cast š‘›20Ā·1 := …' with the meta it read and the meta whose
# shape it took. The line of 'š‘›19' binds its term as it is and writes
# nothing (#2192).
symbolic: |
  - Ī»: L_fork
    dataize:
      š›æ1: $.on🌵
    morph:
      š‘›13: $.left🌵
      š‘›14: $.right🌵
    cast:
      š‘›19: š‘›13
      š‘›20: š‘›14
    join:
      on: š›æ1
      left: š‘›19
      right: š‘›20
      otherwise: L_fork
location: 'Q.e1'
input: '⟦ e1 ↦ ⟦ Ī» ā¤ L_fork, on🌵 ↦ ⟦ Ī» ā¤ šœŽ1 ⟧, left🌵 ↦ ⟦ k ↦ ⟦⟧, φ ↦ ⟦ Ī» ā¤ šœŽ2 ⟧ ⟧, right🌵 ↦ ⟦ Ī» ā¤ šœŽ3 ⟧ ⟧.φ ⟧'
result: 'šœŽ4:Ī»'
protocol: |
  š•„(Φ.e1):
    š”¼(L_fork):
      š”»(ξ.on🌵):
        š›æĀ·1Ā·1 := š”»(šœŽ1:Ī»)
      š›æ1Ā·1 := š›æĀ·1Ā·1  # š”»(ξ.on🌵)
      š•„(ξ.left🌵):
        morphed š‘›Ā·1Ā·1 := ⟦ k ↦ ⟦⟧, φ ↦ šœŽ2:Ī» ⟧
      š‘›13Ā·1 := š‘›Ā·1Ā·1  # š•„(ξ.left🌵)
      š•„(ξ.right🌵):
        morphed š‘›Ā·1Ā·2 := šœŽ3:Ī»
      š‘›14Ā·1 := š‘›Ā·1Ā·2  # š•„(ξ.right🌵)
      cast š‘›20Ā·1 := ⟦ k ↦ ⟦⟧, φ ↦ šœŽ3:Ī» ⟧  # š‘›14Ā·1 up to š‘›13Ā·1
      joined šœŽ4 := š›æ1Ā·1 ? šœŽ2 : šœŽ3
      š‘›Ā·1Ā·3 := ⟦ k ↦ ⟦⟧, φ ↦ šœŽ4:Ī» ⟧
    morphed š‘›Ā·0Ā·1 := šœŽ4:Ī»