packages feed

phino-0.0.156: test-resources/evaluate-packs/keeps-a-bare-symbol-no-path-casts-for-a-lenient-join.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# An 'upcast' block casts the bare symbol of its pair only when a path reaches
# every symbol of the other term (#1921). The one symbol of the branch 'b' sits
# under the dispatch '.not', which no path walks into, so both lines bind their
# terms as they are and nothing is written for the cast. The 'join' line of the
# lenient entry then pairs the bare symbol with that one symbol, the way a
# lenient join always did (#1817).
symbolic: |
  - Ξ»: L_fork
    morph:
      𝑛1: $.a
      𝑛2: $.b
    upcast:
      𝑛3: 𝑛1
      𝑛4: 𝑛2
    join:
      𝑛5: [𝑛3, 𝑛4]
    lenient: []
    𝑛: 𝑛5
location: 'Q.y'
input: |
  ⟦
    bool(if) ↦ ⟦ Ο† ↦ ΞΎ.if( Ξ±0 ↦ ⟦ Ξ” ‍ FF- ⟧, Ξ±1 ↦ ⟦ Ξ” ‍ 00- ⟧ ) ⟧,
    y ↦ ⟦
      a ↦ ⟦ Ξ» ‍ 𝜎1 ⟧,
      b ↦ ⟦ Ο† ↦ Ξ¦.bool( if ↦ ⟦ Ξ» ‍ L_fork, left ↦ βˆ…, right ↦ βˆ…, Ο† ↦ ⟦ Ξ» ‍ 𝜎2 ⟧.not ⟧ ) ⟧,
      λ ‍ L_fork
    ⟧.Ο†
  ⟧
result: '⟦ if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎3:Ξ».not ⟧, Ο† ↦ if( FF-:Ξ”, 00-:Ξ” ) ⟧'
protocol: |
  𝕄(Ξ¦.y):
    𝔼(L_fork):
      𝑛1Β·1 := 𝜎1:Ξ»  # 𝕄(ΞΎ.a)
      𝑛2Β·1 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎2:Ξ».not ⟧ ):Ο†  # 𝕄(ΞΎ.b)
      𝑛3Β·1 := 𝑛1Β·1  # 𝑛1
      𝑛4Β·1 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎2:Ξ».not ⟧ ):Ο†  # 𝑛2
      𝔻(𝜎3:Ξ») ∈ { 𝔻(𝜎1:Ξ»), 𝔻(𝜎2:Ξ») }
      𝑛5Β·1 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎3:Ξ».not ⟧ ):Ο†  # [𝑛3, 𝑛4]
      𝑛·1Β·1 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎3:Ξ».not ⟧ ):Ο†  # 𝑛
      𝑛·1Β·2 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎3:Ξ».not ⟧ ):Ο†  # 𝕄(𝑛·1Β·1)
    𝑛·0Β·1 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎3:Ξ».not ⟧ )