packages feed

phino-0.0.152: test-resources/evaluate-packs/fires-a-read-once-in-the-copy-it-stands-in.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The deep walk writes what it morphed back into the copy it stands in, not
# only into the world as written (#1720). Here 'm' lives in the copy
# 'Φ.same( left ↦ … )', and 'φ' reads it twice before the walk reaches 'm'.
# Before, every read fired 'L_bytes_eq' again, and so did the walk at 'm'. Now
# the first read leaves the answer in 'm', so the second read and the walk at
# 'm' fire nothing, and 'L_bytes_eq' fires twice: once for 'm' and once for
# 'm.eq( b ↦ m )'.
symbolic: |
  - λ: L_bytes_eq
    dataize:
      𝛿1: $.ρ
      𝛿2: $.b
    𝑛: Φ.bytes( φ ↦ ⟦ λ ⤍ 𝜎 ⟧ )
location: 'Q.e'
deep: true
partial: true
acyclic: plausible
input: >
  ⟦ bytes(φ) ↦ ⟦ eq(ρ, b) ↦ L_bytes_eq:λ ⟧,
    same(left) ↦ ⟦ φ ↦ m.eq( b ↦ m ), m ↦ left.eq( b ↦ Φ.bytes( φ ↦ 00-:Δ ) ) ⟧,
    e ↦ Φ.same( left ↦ Φ.bytes( φ ↦ 𝜎1:λ ) ) ⟧
result: >
  ⟦ left ↦ Φ.bytes( φ ↦ 𝜎1:λ ),
    φ ↦ ⟦ φ ↦ 𝜎3:λ, eq(b) ↦ L_bytes_eq:λ ⟧,
    m ↦ ⟦ φ ↦ 𝜎2:λ, eq(b) ↦ L_bytes_eq:λ ⟧ ⟧
protocol: |
  𝕄(Φ.e):
    𝑛·0·1 := Φ.same( left ↦ Φ.bytes( φ ↦ 𝜎1:λ ) )
    𝕄(Φ.e.left):
      𝑛·0·2 := Φ.bytes( φ ↦ 𝜎1:λ )
    𝕄(Φ.e.φ):
      𝑛·0·3 := Φ.bytes( φ ↦ 𝜎1:λ )
      𝑛·0·4 := 𝑛·0·3.eq( b ↦ Φ.bytes( φ ↦ 00-:Δ ) )
      𝔼(L_bytes_eq):
        𝔻(Φ.a🌵0):
          𝕄(Φ.a🌵0):
            𝑛·1·1 := Φ.bytes( φ ↦ 𝜎1:λ )
        𝛿1·1 := 𝔻(𝜎1:λ)  # 𝔻(ξ.ρ)
        𝔻(Φ.a🌵1):
          𝕄(Φ.a🌵1):
            𝑛·1·2 := Φ.bytes( φ ↦ 00-:Δ )
          𝛿·1·1 := 00-
        𝛿2·1 := 𝛿·1·1  # 𝔻(ξ.b)
        𝑛·1·3 := Φ.bytes( φ ↦ 𝜎2:λ )  # 𝑛
        𝕄(𝑛·1·3):
          𝑛·1·4 := Φ.bytes( φ ↦ 𝜎2:λ )
        𝑛·1·5 := 𝑛·1·4  # 𝕄(𝑛·1·3)
      𝑛·0·5 := 𝑛·1·4.eq( b ↦ 𝑛·1·4 )
      𝔼(L_bytes_eq):
        𝔻(Φ.a🌵2):
          𝕄(Φ.a🌵2):
            𝑛·2·1 := Φ.bytes( φ ↦ 𝜎2:λ )
        𝛿1·2 := 𝔻(𝜎2:λ)  # 𝔻(ξ.ρ)
        𝛿2·2 := 𝔻(𝜎2:λ)  # 𝔻(ξ.b)
        𝑛·2·2 := Φ.bytes( φ ↦ 𝜎3:λ )  # 𝑛
        𝕄(𝑛·2·2):
          𝑛·2·3 := Φ.bytes( φ ↦ 𝜎3:λ )
        𝑛·2·4 := 𝑛·2·3  # 𝕄(𝑛·2·2)