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)