packages feed

phino-0.0.152: test-resources/evaluate-packs/defers-a-copy-whose-argument-is-a-bare-symbol.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The loop of #1729: 'joined' folds a tuple whose tail is the bare symbol '𝜎3',
# an object nobody knows. The right branch of the first fork is the copy
# 'step( acc ↦ …, tup ↦ 𝜎3 )', and nothing inside its body can succeed, since
# every round asks '𝜎3' for its 'length'. Before #1729 the walk entered that
# body, got stuck six times, and left it as written, so the join had a symbol
# on the left and a body on the right, and 'e' came to nothing. Now the walk
# does not enter a copy one of whose arguments reads to a bare symbol: it
# answers the copy with a fresh symbol and writes a 'deferred' line naming the
# copy it stands for, the join pairs that symbol with the one the left branch
# ends in, and 'e' comes to a symbol. Since #1732 that line spells the copy as
# a call of 'Ξ¦.joined.step', the object of the world it was made of, rather
# than of 'Ξ¦.e.step', the copy of 'joined' the walk wrote into 'e', since only
# the first one has voids the copy fills. Reading 'items.length' through the
# tuple, itself a copy over bare symbols, still reaches '𝜎1', since a copy with
# no Ο† has no body to defer.
symbolic: |
  - Ξ»: L_bytes_eq
    dataize:
      𝛿1: $.ρ
      𝛿2: $.b
    𝑛: Ξ¦.bool( if ↦ ⟦ Ξ» ‍ L_fork, left ↦ βˆ…, right ↦ βˆ…, Ο† ↦ ⟦ Ξ» ‍ 𝜎 ⟧ ⟧ )
  - Ξ»: L_bytes_concat
    dataize:
      𝛿1: $.ρ
      𝛿2: $.b
    𝑛: Ξ¦.bytes( Ο† ↦ ⟦ Ξ» ‍ 𝜎 ⟧ )
  - Ξ»: L_dataized
    dataize:
      𝛿1: $.target
    𝑛: Ξ¦.bytes( Ο† ↦ ⟦ Ξ» ‍ 𝜎 ⟧ )
  - Ξ»: L_fork
    dataize:
      𝛿1: $.Ο†
    morph:
      𝑛1: $.left
      𝑛2: $.right
    symbolize:
      𝑛3: 𝑛1
      𝑛4: 𝑛2
    join:
      𝑛5: [𝑛3, 𝑛4]
    𝑛: 𝑛5
location: 'Q.e'
deep: true
partial: true
acyclic: plausible
result: '⟦ items ↦ Ξ¦.tuple( length ↦ Ξ¦.bytes( Ο† ↦ 𝜎1:Ξ» ), head ↦ 𝜎2:Ξ», tail ↦ 𝜎3:Ξ» ), Ο† ↦ 𝜎9:Ξ», step(acc, tup) ↦ Ξ¦.dataized( target ↦ tup.length ).eq( b ↦ Ξ¦.bytes( Ο† ↦ 00-:Ξ” ) ).if( acc, ρ.step( acc ↦ acc.concat( b ↦ Ξ¦.dataized( target ↦ tup.head ) ), tup ↦ tup.tail ) ):Ο† ⟧'
input: |
  ⟦
    bool(if) ↦ ⟦ Ο† ↦ if( Ξ¦.bytes( Ο† ↦ FF-:Ξ” ), Ξ¦.bytes( Ο† ↦ 00-:Ξ” ) ) ⟧,
    bytes(Ο†) ↦ ⟦ eq(ρ, b) ↦ L_bytes_eq:Ξ», concat(ρ, b) ↦ L_bytes_concat:Ξ» ⟧,
    dataized(target) ↦ L_dataized:Ξ»,
    tuple(length, head, tail) ↦ ⟦⟧,
    joined(items) ↦ ⟦
      Ο† ↦ Ξ¦.dataized( target ↦ items.length ).eq( b ↦ Ξ¦.bytes( Ο† ↦ 00-:Ξ” ) ).if(
        Ξ¦.bytes( Ο† ↦ --:Ξ” ),
        step( acc ↦ Ξ¦.dataized( target ↦ items.head ), tup ↦ items.tail )
      ),
      step(ρ, acc, tup) ↦ Ξ¦.dataized( target ↦ tup.length ).eq( b ↦ Ξ¦.bytes( Ο† ↦ 00-:Ξ” ) ).if(
        acc,
        ρ.step( acc ↦ acc.concat( b ↦ Ξ¦.dataized( target ↦ tup.head ) ), tup ↦ tup.tail )
      ):Ο†
    ⟧,
    e ↦ Ξ¦.joined(
      items ↦ Ξ¦.tuple( length ↦ Ξ¦.bytes( Ο† ↦ 𝜎1:Ξ» ), head ↦ 𝜎2:Ξ», tail ↦ 𝜎3:Ξ» )
    )
  ⟧
protocol: |
  𝕄(Ξ¦.e):
    𝑛·0Β·1 := Ξ¦.joined( items ↦ Ξ¦.tuple( length ↦ Ξ¦.bytes( Ο† ↦ 𝜎1:Ξ» ), head ↦ 𝜎2:Ξ», tail ↦ 𝜎3:Ξ» ) )
    𝕄(Ξ¦.e.items):
      𝑛·0Β·2 := Ξ¦.bytes( Ο† ↦ 𝜎1:Ξ» )
      𝑛·0Β·3 := Ξ¦.tuple( length ↦ 𝑛·0Β·2 )
      𝑛·0Β·4 := Ξ¦.tuple( length ↦ 𝑛·0Β·2 )
      𝑛·0Β·5 := 𝑛·0Β·4( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·6 := Ξ¦.tuple( length ↦ 𝑛·0Β·2 )
      𝑛·0Β·7 := 𝑛·0Β·6( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·8 := 𝑛·0Β·7( tail ↦ 𝜎3:Ξ» )
    𝕄(Ξ¦.e.Ο†):
      𝑛·0Β·9 := Ξ¦.tuple( length ↦ 𝑛·0Β·2 )
      𝑛·0Β·10 := 𝑛·0Β·9( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·11 := 𝑛·0Β·10( tail ↦ 𝜎3:Ξ» )
      𝑛·0Β·12 := Ξ¦.tuple( length ↦ 𝑛·0Β·2 )
      𝑛·0Β·13 := 𝑛·0Β·12( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·14 := 𝑛·0Β·13( tail ↦ 𝜎3:Ξ» )
      𝑛·0Β·15 := Ξ¦.bytes( Ο† ↦ 𝜎1:Ξ» )
      𝑛·0Β·16 := Ξ¦.dataized( target ↦ 𝑛·0Β·14.length )
      𝔼(L_dataized):
        𝔻(Ξ¦.a🌡0):
          𝕄(Ξ¦.a🌡0):
            𝑛·1Β·1 := Ξ¦.tuple( length ↦ 𝑛·0Β·15 )
            𝑛·1Β·2 := 𝑛·1Β·1( head ↦ 𝜎2:Ξ» )
            𝑛·1Β·3 := 𝑛·1Β·2( tail ↦ 𝜎3:Ξ» )
            𝑛·1Β·4 := Ξ¦.bytes( Ο† ↦ 𝜎1:Ξ» )
        𝛿1Β·1 := 𝔻(𝜎1:Ξ»)  # 𝔻(ΞΎ.target)
        𝑛·1Β·5 := Ξ¦.bytes( Ο† ↦ 𝜎4:Ξ» )  # 𝑛
        𝕄(𝑛·1Β·5):
          𝑛·1Β·6 := Ξ¦.bytes( Ο† ↦ 𝜎4:Ξ» )
        𝑛·1Β·7 := 𝑛·1Β·6  # 𝕄(𝑛·1Β·5)
      𝑛·0Β·17 := Ξ¦.bytes( Ο† ↦ 00-:Ξ” )
      𝑛·0Β·18 := 𝑛·1Β·6.eq( b ↦ 𝑛·0Β·17 )
      𝔼(L_bytes_eq):
        𝔻(Ξ¦.a🌡1):
          𝕄(Ξ¦.a🌡1):
            𝑛·2Β·1 := Ξ¦.bytes( Ο† ↦ 𝜎4:Ξ» )
        𝛿1Β·2 := 𝔻(𝜎4:Ξ»)  # 𝔻(ΞΎ.ρ)
        𝔻(Ξ¦.a🌡2):
          𝕄(Ξ¦.a🌡2):
            𝑛·2Β·2 := Ξ¦.bytes( Ο† ↦ 00-:Ξ” )
          𝛿·2Β·1 := 00-
        𝛿2Β·2 := 𝛿·2Β·1  # 𝔻(ΞΎ.b)
        𝑛·2Β·3 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎5:Ξ» ⟧ )  # 𝑛
        𝕄(𝑛·2Β·3):
          𝑛·2Β·4 := Ξ¦.bool( if(left, right) ↦ ⟦ Ξ» ‍ L_fork, Ο† ↦ 𝜎5:Ξ» ⟧ )
        𝑛·2Β·5 := 𝑛·2Β·4  # 𝕄(𝑛·2Β·3)
      𝑛·0Β·19 := Ξ¦.bytes( Ο† ↦ --:Ξ” )
      𝑛·0Β·20 := ⟦ Ξ» ‍ L_fork, left ↦ βˆ…, right ↦ βˆ…, Ο† ↦ 𝜎5:Ξ» ⟧( left ↦ 𝑛·0Β·19 )
      𝑛·0Β·21 := Ξ¦.tuple( length ↦ 𝑛·1Β·4 )
      𝑛·0Β·22 := 𝑛·0Β·21( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·23 := 𝑛·0Β·22( tail ↦ 𝜎3:Ξ» )
      𝑛·0Β·24 := Ξ¦.tuple( length ↦ 𝑛·1Β·4 )
      𝑛·0Β·25 := 𝑛·0Β·24( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·26 := 𝑛·0Β·25( tail ↦ 𝜎3:Ξ» )
      𝑛·0Β·27 := Ξ¦.dataized( target ↦ 𝑛·0Β·26.head )
      𝔼(L_dataized):
        𝔻(Ξ¦.a🌡3):
          𝕄(Ξ¦.a🌡3):
            𝑛·3Β·1 := Ξ¦.tuple( length ↦ 𝑛·1Β·4 )
            𝑛·3Β·2 := 𝑛·3Β·1( head ↦ 𝜎2:Ξ» )
            𝑛·3Β·3 := 𝑛·3Β·2( tail ↦ 𝜎3:Ξ» )
        𝛿1Β·3 := 𝔻(𝜎2:Ξ»)  # 𝔻(ΞΎ.target)
        𝑛·3Β·4 := Ξ¦.bytes( Ο† ↦ 𝜎6:Ξ» )  # 𝑛
        𝕄(𝑛·3Β·4):
          𝑛·3Β·5 := Ξ¦.bytes( Ο† ↦ 𝜎6:Ξ» )
        𝑛·3Β·6 := 𝑛·3Β·5  # 𝕄(𝑛·3Β·4)
      𝑛·0Β·28 := ⟦ acc ↦ βˆ…, tup ↦ βˆ…, Ο† ↦ Ξ¦.dataized( target ↦ tup.length ).eq( b ↦ 𝑛·2Β·2 ).if( acc, ρ.step( acc ↦ acc.concat( b ↦ Ξ¦.dataized( target ↦ tup.head ) ), tup ↦ tup.tail ) ) ⟧( acc ↦ 𝑛·3Β·5 )
      𝑛·0Β·29 := Ξ¦.tuple( length ↦ 𝑛·1Β·4 )
      𝑛·0Β·30 := 𝑛·0Β·29( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·31 := 𝑛·0Β·30( tail ↦ 𝜎3:Ξ» )
      𝑛·0Β·32 := Ξ¦.tuple( length ↦ 𝑛·1Β·4 )
      𝑛·0Β·33 := 𝑛·0Β·32( head ↦ 𝜎2:Ξ» )
      𝑛·0Β·34 := 𝑛·0Β·33( tail ↦ 𝜎3:Ξ» )
      𝑛·0Β·35 := ⟦ acc ↦ βˆ…, tup ↦ βˆ…, Ο† ↦ Ξ¦.dataized( target ↦ tup.length ).eq( b ↦ 𝑛·2Β·2 ).if( acc, ρ.step( acc ↦ acc.concat( b ↦ Ξ¦.dataized( target ↦ tup.head ) ), tup ↦ tup.tail ) ) ⟧( acc ↦ 𝑛·3Β·5 )
      𝑛·0Β·36 := 𝑛·0Β·35( tup ↦ 𝑛·0Β·34.tail )
      𝑛·0Β·37 := ⟦ Ξ» ‍ L_fork, left ↦ βˆ…, right ↦ βˆ…, Ο† ↦ 𝜎5:Ξ» ⟧( left ↦ 𝑛·0Β·19 )
      𝑛·0Β·38 := ⟦ acc ↦ βˆ…, tup ↦ βˆ…, Ο† ↦ Ξ¦.dataized( target ↦ tup.length ).eq( b ↦ 𝑛·2Β·2 ).if( acc, ρ.step( acc ↦ acc.concat( b ↦ Ξ¦.dataized( target ↦ tup.head ) ), tup ↦ tup.tail ) ) ⟧( acc ↦ 𝑛·3Β·5 )
      𝑛·0Β·39 := 𝑛·0Β·38( tup ↦ 𝑛·0Β·34.tail )
      𝑛·0Β·40 := 𝑛·0Β·37( right ↦ 𝑛·0Β·39 )
      𝔼(L_fork):
        𝛿1Β·4 := 𝔻(𝜎5:Ξ»)  # 𝔻(ΞΎ.Ο†)
        𝕄(Ξ¦.a🌡5):
          𝑛·4Β·1 := Ξ¦.bytes( Ο† ↦ --:Ξ” )
        𝑛1Β·4 := 𝑛·4Β·1  # 𝕄(ΞΎ.left)
        𝕄(Ξ¦.a🌡6):
          deferred(𝜎7) := Ξ¦.joined.step( acc ↦ 𝑛·3Β·5, tup ↦ 𝜎3:Ξ» )
        𝑛2Β·4 := 𝜎7:Ξ»  # 𝕄(ΞΎ.right)
        𝔻(𝜎8:Ξ») == --
        𝑛3Β·4 := ⟦ Ο† ↦ 𝜎8:Ξ», eq(b) ↦ L_bytes_eq:Ξ», concat(b) ↦ L_bytes_concat:Ξ» ⟧  # 𝑛1
        𝑛4Β·4 := 𝑛2Β·4  # 𝑛2
        𝔻(𝜎9:Ξ») ∈ { 𝔻(𝜎8:Ξ»), 𝔻(𝜎7:Ξ») }
        𝑛5Β·4 := 𝜎9:Ξ»  # [𝑛3, 𝑛4]
        𝑛·4Β·2 := 𝑛5Β·4  # 𝑛
        𝑛·4Β·3 := 𝑛5Β·4  # 𝕄(𝑛·4Β·2)