packages feed

phino-0.0.165: test-resources/evaluate-packs/morphs-two-branches-spelling-one-term-through-one-firing.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The memo of '--acyclic=plausible' serves the operands of a firing as much
# as the walk: the two branches of this fork spell one term, so the sum the
# second one starts from is the formation the first one fired, and the
# second branch reaches the normal form the first reached, symbol and all,
# through a firing that reduces nothing and answers what the first one did.
# The branches are met as 'morph' operands of the fork and not as bindings
# the deep walk went over first, since the fork is fired by the dispatch off
# it (#1476).
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
    𝑛: 𝑛1
location: 'Q.@'
acyclic: plausible
input: >
  ⟦ bytes(φ) ↦ ⟦⟧,
    bool(φ) ↦ ⟦ if ↦ ⟦ ρ ↦ ∅, then ↦ ∅, else ↦ ∅, λ ⤍ L_fork ⟧ ⟧,
    number(φ) ↦ ⟦
      gt(ρ, x) ↦ ⟦ λ ⤍ L_number_gt ⟧,
      plus(ρ, x) ↦ ⟦ λ ⤍ L_number_plus ⟧ ⟧,
    φ ↦ 5.gt( 0 ).if( 1.plus( 2 ).plus( 3 ), 1.plus( 2 ).plus( 3 ) ).plus( 9 ) ⟧
result: '⟦ x ↦ 9, λ ⤍ L_number_plus ⟧'
protocol: |
  𝕄(Φ.φ):
    normalized 𝑛·0·1 := ⟦ φ ↦ ∅, gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧  # Φ.number
    𝑛·0·2 := 5.0
    𝑛·0·3 := ⟦ φ ↦ Φ.bytes( φ ↦ 40-14-00-00-00-00-00-00:Δ ), gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
    normalized 𝑛·0·4 := ⟦ x ↦ ∅, λ ⤍ L_number_gt ⟧  # 𝑛·0·3.gt
    𝑛·0·5 := 𝑛·0·2.gt( x ↦ 0.0 )
    𝑛·0·6 := ⟦ x ↦ 0.0, λ ⤍ L_number_gt ⟧
    𝔼(L_number_gt):
      𝔻(ξ.ρ):
        𝕄(ξ.ρ):
          𝑛·1·1 := 5.0
          𝑛·1·2 := ⟦ φ ↦ Φ.bytes( φ ↦ 40-14-00-00-00-00-00-00:Δ ), gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
          morphed 𝑛·1·3 := 𝑛·1·2
        boxed 𝑛·1·4 := 𝑛·1·3.φ
        normalized 𝑛·1·5 := Φ.bytes( φ ↦ 40-14-00-00-00-00-00-00:Δ )  # 𝑛·1·4
        𝕄(𝑛·1·4):
          normalized 𝑛·1·6 := ∅:φ  # Φ.bytes
          𝑛·1·7 := Φ.bytes( φ ↦ 40-14-00-00-00-00-00-00:Δ )
          𝑛·1·8 := 40-14-00-00-00-00-00-00:Δ:φ
          morphed 𝑛·1·9 := 𝑛·1·8
        boxed 𝑛·1·10 := 𝑛·1·9.φ
        normalized 𝑛·1·11 := 40-14-00-00-00-00-00-00:Δ  # 𝑛·1·10
        𝛿·1·1 := 40-14-00-00-00-00-00-00  # 5.0
      𝛿1·1 := 𝛿·1·1  # 𝔻(ξ.ρ)
      𝔻(ξ.x):
        𝕄(ξ.x):
          𝑛·1·12 := 0.0
          𝑛·1·13 := ⟦ φ ↦ Φ.bytes( φ ↦ 00-00-00-00-00-00-00-00:Δ ), gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
          morphed 𝑛·1·14 := 𝑛·1·13
        boxed 𝑛·1·15 := 𝑛·1·14.φ
        normalized 𝑛·1·16 := Φ.bytes( φ ↦ 00-00-00-00-00-00-00-00:Δ )  # 𝑛·1·15
        𝕄(𝑛·1·15):
          𝑛·1·17 := Φ.bytes( φ ↦ 00-00-00-00-00-00-00-00:Δ )
          𝑛·1·18 := 00-00-00-00-00-00-00-00:Δ:φ
          morphed 𝑛·1·19 := 𝑛·1·18
        boxed 𝑛·1·20 := 𝑛·1·19.φ
        normalized 𝑛·1·21 := 00-00-00-00-00-00-00-00:Δ  # 𝑛·1·20
        𝛿·1·2 := 00-00-00-00-00-00-00-00  # 0.0
      𝛿2·1 := 𝛿·1·2  # 𝔻(ξ.x)
      𝑛·1·22 := Φ.bool( φ ↦ 𝜎1:λ )  # 𝑛
      𝕄(𝑛·1·22):
        normalized 𝑛·1·23 := ⟦ φ ↦ ∅, if(then, else) ↦ L_fork:λ ⟧  # Φ.bool
        𝑛·1·24 := Φ.bool( φ ↦ 𝜎1:λ )
        𝑛·1·25 := ⟦ φ ↦ 𝜎1:λ, if(then, else) ↦ L_fork:λ ⟧
        morphed 𝑛·1·26 := 𝑛·1·25
      𝑛·1·27 := 𝑛·1·26  # 𝕄(𝑛·1·22)
      memoized 𝑛·0·6 ⇛ 𝑛·1·27
    normalized 𝑛·0·7 := ⟦ then ↦ ∅, else ↦ ∅, λ ⤍ L_fork ⟧  # 𝑛·1·27.if
    𝑛·0·8 := 𝑛·1·24.if( then ↦ 1.0.plus( 2.0 ).plus( 3.0 ) )
    𝑛·0·9 := ⟦ then ↦ 1.0.plus( 2.0 ).plus( 3.0 ), else ↦ ∅, λ ⤍ L_fork ⟧
    𝑛·0·10 := 𝑛·0·8( else ↦ 1.0.plus( 2.0 ).plus( 3.0 ) )
    𝑛·0·11 := ⟦ then ↦ 1.0.plus( 2.0 ).plus( 3.0 ), else ↦ 1.0.plus( 2.0 ).plus( 3.0 ), λ ⤍ L_fork ⟧
    𝔼(L_fork):
      𝔻(ξ.ρ):
        𝕄(ξ.ρ):
          𝑛·2·1 := Φ.bool( φ ↦ 𝜎1:λ )
          𝑛·2·2 := ⟦ φ ↦ 𝜎1:λ, if(then, else) ↦ L_fork:λ ⟧
          morphed 𝑛·2·3 := 𝑛·1·27
        boxed 𝑛·2·4 := 𝑛·2·3.φ
        normalized 𝑛·2·5 := 𝜎1:λ  # 𝑛·2·4
        𝛿·2·1 := 𝔻(𝜎1:λ)
      𝛿1·2 := 𝛿·2·1  # 𝔻(ξ.ρ)
      𝕄(ξ.then):
        𝑛·2·6 := 1.0
        𝑛·2·7 := ⟦ φ ↦ Φ.bytes( φ ↦ 3F-F0-00-00-00-00-00-00:Δ ), gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
        normalized 𝑛·2·8 := ⟦ x ↦ ∅, λ ⤍ L_number_plus ⟧  # 𝑛·2·7.plus
        𝑛·2·9 := 𝑛·2·6.plus( x ↦ 2.0 )
        𝑛·2·10 := ⟦ x ↦ 2.0, λ ⤍ L_number_plus ⟧
        𝔼(L_number_plus):
          𝔻(ξ.ρ):
            𝕄(ξ.ρ):
              𝑛·3·1 := 1.0
              𝑛·3·2 := ⟦ φ ↦ Φ.bytes( φ ↦ 3F-F0-00-00-00-00-00-00:Δ ), gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
              morphed 𝑛·3·3 := 𝑛·3·2
            boxed 𝑛·3·4 := 𝑛·3·3.φ
            normalized 𝑛·3·5 := Φ.bytes( φ ↦ 3F-F0-00-00-00-00-00-00:Δ )  # 𝑛·3·4
            𝕄(𝑛·3·4):
              𝑛·3·6 := Φ.bytes( φ ↦ 3F-F0-00-00-00-00-00-00:Δ )
              𝑛·3·7 := 3F-F0-00-00-00-00-00-00:Δ:φ
              morphed 𝑛·3·8 := 𝑛·3·7
            boxed 𝑛·3·9 := 𝑛·3·8.φ
            normalized 𝑛·3·10 := 3F-F0-00-00-00-00-00-00:Δ  # 𝑛·3·9
            𝛿·3·1 := 3F-F0-00-00-00-00-00-00  # 1.0
          𝛿1·3 := 𝛿·3·1  # 𝔻(ξ.ρ)
          𝔻(ξ.x):
            𝕄(ξ.x):
              𝑛·3·11 := 2.0
              𝑛·3·12 := ⟦ φ ↦ Φ.bytes( φ ↦ 40-00-00-00-00-00-00-00:Δ ), gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
              morphed 𝑛·3·13 := 𝑛·3·12
            boxed 𝑛·3·14 := 𝑛·3·13.φ
            normalized 𝑛·3·15 := Φ.bytes( φ ↦ 40-00-00-00-00-00-00-00:Δ )  # 𝑛·3·14
            𝕄(𝑛·3·14):
              𝑛·3·16 := Φ.bytes( φ ↦ 40-00-00-00-00-00-00-00:Δ )
              𝑛·3·17 := 40-00-00-00-00-00-00-00:Δ:φ
              morphed 𝑛·3·18 := 𝑛·3·17
            boxed 𝑛·3·19 := 𝑛·3·18.φ
            normalized 𝑛·3·20 := 40-00-00-00-00-00-00-00:Δ  # 𝑛·3·19
            𝛿·3·2 := 40-00-00-00-00-00-00-00  # 2.0
          𝛿2·3 := 𝛿·3·2  # 𝔻(ξ.x)
          𝑛·3·21 := Φ.number( φ ↦ 𝜎2:λ )  # 𝑛
          𝕄(𝑛·3·21):
            𝑛·3·22 := Φ.number( φ ↦ 𝜎2:λ )
            𝑛·3·23 := ⟦ φ ↦ 𝜎2:λ, gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
            morphed 𝑛·3·24 := 𝑛·3·23
          𝑛·3·25 := 𝑛·3·24  # 𝕄(𝑛·3·21)
          memoized 𝑛·2·10 ⇛ 𝑛·3·25
        normalized 𝑛·2·11 := ⟦ x ↦ ∅, λ ⤍ L_number_plus ⟧  # 𝑛·3·25.plus
        𝑛·2·12 := 𝑛·3·22.plus( x ↦ 3.0 )
        𝑛·2·13 := ⟦ x ↦ 3.0, λ ⤍ L_number_plus ⟧
        morphed 𝑛·2·14 := 𝑛·2·13
      𝑛1·2 := 𝑛·2·13  # 𝕄(ξ.then)
      𝕄(ξ.else):
        𝑛·2·15 := Φ.number( φ ↦ 𝑛·3·6 )
        𝑛·2·16 := ⟦ φ ↦ 𝑛·3·6, gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
        normalized 𝑛·2·17 := ⟦ x ↦ ∅, λ ⤍ L_number_plus ⟧  # 𝑛·2·16.plus
        𝑛·2·18 := 𝑛·2·15.plus( x ↦ 𝑛·3·11 )
        𝑛·2·19 := ⟦ x ↦ 𝑛·3·11, λ ⤍ L_number_plus ⟧
        𝔼(L_number_plus):
          recalled 𝑛·2·10 ⇒ 𝑛·3·25
          𝑛·4·1 := 𝑛·3·22  # 𝑛
          𝑛·4·2 := 𝑛·3·25  # 𝕄(𝑛·4·1)
        normalized 𝑛·2·20 := ⟦ x ↦ ∅, λ ⤍ L_number_plus ⟧  # 𝑛·4·2.plus
        𝑛·2·21 := 𝑛·3·22.plus( x ↦ 3.0 )
        𝑛·2·22 := ⟦ x ↦ 3.0, λ ⤍ L_number_plus ⟧
        morphed 𝑛·2·23 := 𝑛·2·22
      𝑛2·2 := 𝑛·2·22  # 𝕄(ξ.else)
      𝑛·2·24 := 𝑛·2·22  # 𝑛
      𝕄(𝑛·2·24):
        morphed 𝑛·2·25 := 𝑛·2·22
      𝑛·2·26 := 𝑛·2·22  # 𝕄(𝑛·2·24)
      memoized 𝑛·0·11 ⇛ 𝑛·2·22
    𝔼(L_number_plus):
      𝔻(ξ.ρ):
        𝕄(ξ.ρ):
          𝑛·5·1 := Φ.number( φ ↦ 𝜎2:λ )
          𝑛·5·2 := ⟦ φ ↦ 𝜎2:λ, gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
          morphed 𝑛·5·3 := 𝑛·4·2
        boxed 𝑛·5·4 := 𝑛·5·3.φ
        normalized 𝑛·5·5 := 𝜎2:λ  # 𝑛·5·4
        𝛿·5·1 := 𝔻(𝜎2:λ)
      𝛿1·5 := 𝛿·5·1  # 𝔻(ξ.ρ)
      𝔻(ξ.x):
        𝕄(ξ.x):
          𝑛·5·6 := 3.0
          𝑛·5·7 := ⟦ φ ↦ Φ.bytes( φ ↦ 40-08-00-00-00-00-00-00:Δ ), gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
          morphed 𝑛·5·8 := 𝑛·5·7
        boxed 𝑛·5·9 := 𝑛·5·8.φ
        normalized 𝑛·5·10 := Φ.bytes( φ ↦ 40-08-00-00-00-00-00-00:Δ )  # 𝑛·5·9
        𝕄(𝑛·5·9):
          𝑛·5·11 := Φ.bytes( φ ↦ 40-08-00-00-00-00-00-00:Δ )
          𝑛·5·12 := 40-08-00-00-00-00-00-00:Δ:φ
          morphed 𝑛·5·13 := 𝑛·5·12
        boxed 𝑛·5·14 := 𝑛·5·13.φ
        normalized 𝑛·5·15 := 40-08-00-00-00-00-00-00:Δ  # 𝑛·5·14
        𝛿·5·2 := 40-08-00-00-00-00-00-00  # 3.0
      𝛿2·5 := 𝛿·5·2  # 𝔻(ξ.x)
      𝑛·5·16 := Φ.number( φ ↦ 𝜎3:λ )  # 𝑛
      𝕄(𝑛·5·16):
        𝑛·5·17 := Φ.number( φ ↦ 𝜎3:λ )
        𝑛·5·18 := ⟦ φ ↦ 𝜎3:λ, gt(x) ↦ L_number_gt:λ, plus(x) ↦ L_number_plus:λ ⟧
        morphed 𝑛·5·19 := 𝑛·5·18
      𝑛·5·20 := 𝑛·5·19  # 𝕄(𝑛·5·16)
      memoized 𝑛·2·22 ⇛ 𝑛·5·20
    normalized 𝑛·0·12 := ⟦ x ↦ ∅, λ ⤍ L_number_plus ⟧  # 𝑛·5·20.plus
    𝑛·0·13 := 𝑛·5·17.plus( x ↦ 9.0 )
    𝑛·0·14 := ⟦ x ↦ 9.0, λ ⤍ L_number_plus ⟧
    morphed 𝑛·0·15 := 𝑛·0·14