phino-0.0.156: test-resources/evaluate-packs/remints-a-term-as-the-symbol-its-phi-chain-ends-in.yaml
# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# A rule of a 'rewrite' block may not write a π into its result, but a 'where'
# step may call 'remint', which answers the symbol the term it is given stands
# for. A term whose Ο chain ends in a bare symbol is that symbol, so nothing is
# minted and no line is written: the head of the pair below is 'π1' and its
# tail 'π2', whatever else the tail holds (#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]
π: π2
location: 'Q.y'
input: 'β¦ y β¦ β¦ x β¦ β¦ head β¦ β¦ Ο β¦ β¦ Ξ» β€ π1 β§ β§, tail β¦ β¦ Ο β¦ β¦ Ξ» β€ π2 β§, k β¦ β¦ Ξ» β€ π3 β§ β§ β§, Ξ» β€ L_shrink β§.tail β§'
result: 'π2:Ξ»'
protocol: |
π(Ξ¦.y):
πΌ(L_shrink):
π1Β·1 := β¦ head β¦ π1:Ξ»:Ο, tail β¦ β¦ Ο β¦ π2:Ξ», k β¦ π3:Ξ» β§ β§ # π(ΞΎ.x)
π2Β·1 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π1
πΒ·1Β·1 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π
πΒ·1Β·2 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π(πΒ·1Β·1)