packages feed

phino-0.0.152: test-resources/evaluate-packs/joins-a-fork-one-branch-of-which-throws.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# EO raises with a copy of an object whose λ function the file leaves out on
# purpose, here 'L_throw', rather than with ⊥. The entry of the fork names it
# among its terminators, so the join takes the branch that comes to such a
# copy for one that raises, the way it takes ⊥, and answers the other branch.
# The morph of that branch stops at the copy and never walks into its message,
# which here would fire 'L_number_plus' for nothing (#1865).
symbolic: |
  - λ: L_number_gt
    dataize:
      𝛿1: $.ρ
      𝛿2: $.x
    𝑛: Φ.bool( φ ↦ ⟦ λ ⤍ 𝜎 ⟧ )
  - λ: L_number_plus
    dataize:
      𝛿1: $.ρ
      𝛿2: $.x
    𝑛: Φ.number( φ ↦ ⟦ λ ⤍ 𝜎 ⟧ )
  - λ: L_fork
    dataize:
      𝛿1: $.ρ
    morph:
      𝑛1: $.then
      𝑛2: $.else
    symbolize:
      𝑛3: 𝑛1
      𝑛4: 𝑛2
    join:
      𝑛5: [𝑛3, 𝑛4]
    terminators: [L_throw]
    𝑛: 𝑛5
location: 'Q.@'
deep: true
input: >
  ⟦ bytes(φ) ↦ ⟦⟧,
    error(message) ↦ ⟦ λ ⤍ L_throw ⟧,
    bool(φ) ↦ ⟦ if ↦ ⟦ ρ ↦ ∅, then ↦ ∅, else ↦ ∅, λ ⤍ L_fork ⟧ ⟧,
    number(φ) ↦ ⟦
      gt(ρ, x) ↦ ⟦ λ ⤍ L_number_gt ⟧,
      plus(ρ, x) ↦ ⟦ λ ⤍ L_number_plus ⟧ ⟧,
    @ ↦ 5.gt( 0 ).if( then ↦ 1.plus( 2 ), else ↦ Φ.error( message ↦ 7.plus( 8 ) ) ).plus( 6 ) ⟧
result: |-
  ⟦ φ ↦ 𝜎3:λ, gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
protocol: |
  𝕄(Φ.φ):
    𝑛·0·1 := 5
    𝑛·0·2 := 𝑛·0·1.gt( x ↦ 0 )
    𝔼(L_number_gt):
      𝔻(Φ.a🌵0):
        𝕄(Φ.a🌵0):
          𝑛·1·1 := 5
          𝑛·1·2 := Φ.bytes( φ ↦ 40-14-00-00-00-00-00-00:Δ )
        𝛿·1·1 := 40-14-00-00-00-00-00-00  # 5.0
      𝛿1·1 := 𝛿·1·1  # 𝔻(ξ.ρ)
      𝔻(Φ.a🌵1):
        𝕄(Φ.a🌵1):
          𝑛·1·3 := 0
          𝑛·1·4 := Φ.bytes( φ ↦ 00-00-00-00-00-00-00-00:Δ )
        𝛿·1·2 := 00-00-00-00-00-00-00-00  # 0.0
      𝛿2·1 := 𝛿·1·2  # 𝔻(ξ.x)
      𝑛·1·5 := Φ.bool( φ ↦ 𝜎1:λ )  # 𝑛
      𝕄(𝑛·1·5):
        𝑛·1·6 := Φ.bool( φ ↦ 𝜎1:λ )
      𝑛·1·7 := 𝑛·1·6  # 𝕄(𝑛·1·5)
    𝑛·0·3 := 𝑛·1·6.if( then ↦ 1.plus( 2 ) )
    𝑛·0·4 := 𝑛·0·3( else ↦ Φ.error( message ↦ 7.plus( 8 ) ) )
    𝔼(L_fork):
      𝔻(Φ.a🌵2):
        𝕄(Φ.a🌵2):
          𝑛·2·1 := Φ.bool( φ ↦ 𝜎1:λ )
      𝛿1·2 := 𝔻(𝜎1:λ)  # 𝔻(ξ.ρ)
      𝕄(Φ.a🌵3):
        𝑛·2·2 := 1
        𝑛·2·3 := 𝑛·2·2.plus( x ↦ 2 )
        𝕄(Φ.a🌵3.x):
          𝑛·2·4 := Φ.bytes( φ ↦ 40-00-00-00-00-00-00-00:Δ )
          𝑛·2·5 := Φ.number( φ ↦ 𝑛·2·4 )
        𝔼(L_number_plus):
          𝔻(Φ.a🌵4):
            𝕄(Φ.a🌵4):
              𝑛·3·1 := 1
              𝑛·3·2 := Φ.bytes( φ ↦ 3F-F0-00-00-00-00-00-00:Δ )
            𝛿·3·1 := 3F-F0-00-00-00-00-00-00  # 1.0
          𝛿1·3 := 𝛿·3·1  # 𝔻(ξ.ρ)
          𝔻(Φ.a🌵5):
            𝕄(Φ.a🌵5):
              𝑛·3·3 := Φ.number( φ ↦ 𝑛·2·4 )
              𝑛·3·4 := Φ.bytes( φ ↦ 40-00-00-00-00-00-00-00:Δ )
            𝛿·3·2 := 40-00-00-00-00-00-00-00  # 2.0
          𝛿2·3 := 𝛿·3·2  # 𝔻(ξ.x)
          𝑛·3·5 := Φ.number( φ ↦ 𝜎2:λ )  # 𝑛
          𝕄(𝑛·3·5):
            𝑛·3·6 := Φ.number( φ ↦ 𝜎2:λ )
          𝑛·3·7 := 𝑛·3·6  # 𝕄(𝑛·3·5)
      𝑛1·2 := 𝑛·3·7  # 𝕄(ξ.then)
      𝕄(Φ.a🌵6):
        𝑛·2·6 := Φ.error( message ↦ 7.plus( 8 ) )
      𝑛2·2 := 𝑛·2·6  # 𝕄(ξ.else)
      𝑛3·2 := 𝑛1·2  # 𝑛1
      𝑛4·2 := 𝑛·2·6  # 𝑛2
      terminate(𝔻(𝜎1:λ), right)  # 𝑛4
      𝑛5·2 := 𝑛3·2  # [𝑛3, 𝑛4]
      𝑛·2·7 := 𝑛5·2  # 𝑛
      𝑛·2·8 := 𝑛5·2  # 𝕄(𝑛·2·7)
    𝑛·0·5 := 𝑛·3·6.plus( x ↦ 6 )
    𝕄(Φ.φ.x):
      𝑛·0·6 := Φ.bytes( φ ↦ 40-18-00-00-00-00-00-00:Δ )
      𝑛·0·7 := Φ.number( φ ↦ 𝑛·0·6 )
    𝔼(L_number_plus):
      𝔻(Φ.a🌵7):
        𝕄(Φ.a🌵7):
          𝑛·4·1 := Φ.number( φ ↦ 𝜎2:λ )
      𝛿1·4 := 𝔻(𝜎2:λ)  # 𝔻(ξ.ρ)
      𝔻(Φ.a🌵8):
        𝕄(Φ.a🌵8):
          𝑛·4·2 := Φ.number( φ ↦ 𝑛·0·6 )
          𝑛·4·3 := Φ.bytes( φ ↦ 40-18-00-00-00-00-00-00:Δ )
        𝛿·4·1 := 40-18-00-00-00-00-00-00  # 6.0
      𝛿2·4 := 𝛿·4·1  # 𝔻(ξ.x)
      𝑛·4·4 := Φ.number( φ ↦ 𝜎3:λ )  # 𝑛
      𝕄(𝑛·4·4):
        𝑛·4·5 := Φ.number( φ ↦ 𝜎3:λ )
      𝑛·4·6 := 𝑛·4·5  # 𝕄(𝑛·4·4)