packages feed

phino-0.0.156: test-resources/evaluate-packs/remints-a-copy-whose-argument-is-a-copy-as-two-deferred-symbols.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The tail of the pair below is a copy of 'Ξ¦.pair' whose own tail is a copy of
# 'Ξ¦.l/.throw', the way the tail of a tuple of EO ends in the empty tuple,
# whose tail throws. A 'remint' step works every argument of a copy out as it
# works out the term itself, so the inner copy is deferred first, as '𝜎4', and
# the outer one names it as its argument, as '𝜎5' (#1923).
symbolic: |
  - Ξ»: L_shrink
    morph:
      𝑛1: $.x
    rewrite:
      𝑛2:
        of: 𝑛1
        rules:
          - name: small-pair
            pattern: ⟦ !B1, head ↦ 𝑒1, tail ↦ 𝑒2, !B2 ⟧
            result: ⟦ !B1, head ↦ 𝑒3, tail ↦ 𝑒4, !B2 ⟧
            where:
              - meta: 𝑒3
                function: remint
                args: [𝑒1]
              - meta: 𝑒4
                function: remint
                args: [𝑒2]
    terminators: [L_throw]
    𝑛: 𝑛2
location: 'Q.y'
input: '⟦ l/ ↦ ⟦ throw(message) ↦ ⟦ Ξ» ‍ L_throw ⟧ ⟧, pair(tail, head) ↦ ⟦⟧, y ↦ ⟦ x ↦ ⟦ head ↦ ⟦ Ξ» ‍ 𝜎1 ⟧, tail ↦ Ξ¦.pair( tail ↦ Ξ¦.l/.throw( message ↦ ⟦ Ξ” ‍ 01- ⟧ ), head ↦ ⟦ Ο† ↦ ⟦ Ξ» ‍ 𝜎2 ⟧ ⟧ ) ⟧, Ξ» ‍ L_shrink ⟧.tail ⟧'
result: '𝜎5:λ'
protocol: |
  𝕄(Ξ¦.y):
    𝔼(L_shrink):
      𝑛1Β·1 := ⟦ head ↦ 𝜎1:Ξ», tail ↦ Ξ¦.pair( tail ↦ Ξ¦.l/.throw( message ↦ 01-:Ξ” ), head ↦ 𝜎2:Ξ»:Ο† ) ⟧  # 𝕄(ΞΎ.x)
      𝕄(Ξ¦.pair( tail ↦ Ξ¦.l/.throw( message ↦ 01-:Ξ” ), head ↦ 𝜎2:Ξ»:Ο† )):
        𝑛·1Β·1 := Ξ¦.pair( tail ↦ Ξ¦.l/.throw( message ↦ 01-:Ξ” ) )
        𝑛·1Β·2 := 𝑛·1Β·1( head ↦ 𝜎2:Ξ»:Ο† )  # 𝕄(𝑛·1Β·1( head ↦ 𝜎2:Ξ»:Ο† ))
      𝕄(𝑛·1Β·2.tail):
        𝑛·1Β·3 := ⟦ message ↦ βˆ…, Ξ» ‍ L_throw ⟧( message ↦ 01-:Ξ” )
      𝔻(𝜎3:Ξ») == 01-
      deferred(𝜎4) := Ξ¦.l/.throw( message ↦ 𝜎3:Ξ» )  # 𝕄(𝑛·1Β·2.tail)
      deferred(𝜎5) := Ξ¦.pair( tail ↦ 𝜎4:Ξ», head ↦ 𝜎2:Ξ» )  # 𝕄(𝑛·1Β·2)
      𝑛2Β·1 := ⟦ head ↦ 𝜎1:Ξ», tail ↦ 𝜎5:Ξ» ⟧  # 𝑛1
      𝑛·1Β·4 := ⟦ head ↦ 𝜎1:Ξ», tail ↦ 𝜎5:Ξ» ⟧  # 𝑛
      𝑛·1Β·5 := ⟦ head ↦ 𝜎1:Ξ», tail ↦ 𝜎5:Ξ» ⟧  # 𝕄(𝑛·1Β·4)