phino-0.0.156: test-resources/evaluate-packs/remints-a-datum-as-a-known-symbol.yaml
# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# A 'remint' step given a term whose Ο chain ends in data answers a fresh
# symbol and writes it as a known one, the way 'symbolize' does, so the head
# of the pair below becomes 'π1' standing for '01-' and the tail 'π2' standing
# for '02-' (#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 β¦ β¦ Ξ β€ 01- β§, tail β¦ β¦ Ο β¦ β¦ Ξ β€ 02- β§ β§ β§, Ξ» β€ L_shrink β§.tail β§'
result: 'π2:Ξ»'
protocol: |
π(Ξ¦.y):
πΌ(L_shrink):
π1Β·1 := β¦ head β¦ 01-:Ξ, tail β¦ 02-:Ξ:Ο β§ # π(ΞΎ.x)
π»(π1:Ξ») == 01-
π»(π2:Ξ») == 02-
π2Β·1 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π1
πΒ·1Β·1 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π
πΒ·1Β·2 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π(πΒ·1Β·1)