phino-0.0.156: test-resources/evaluate-packs/remints-a-decorator-as-the-symbol-its-phi-comes-to.yaml
# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# Morphing stops at a formation, so the tail of the pair below, a call of
# 'as-number' the way EO's 'length.plus( 1 ).as-number' is one, comes to the
# object 'as-number' and not to the number it decorates. A 'remint' step then
# morphs the Ο of what the term came to, once per decorator, until a Ο chain
# ends in the bare symbol 'π2', and answers that symbol (#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: 'β¦ number(Ο) β¦ β¦β§, bytes(Ο) β¦ β¦ as-number β¦ β¦ Ο β¦ β
, Ο β¦ Ξ¦.number( Ο β¦ ΞΎ.Ο ) β§ β§, y β¦ β¦ x β¦ β¦ head β¦ β¦ Ξ» β€ π1 β§, tail β¦ Ξ¦.bytes( Ο β¦ β¦ Ξ» β€ π2 β§ ).as-number β§, Ξ» β€ L_shrink β§.tail β§'
result: 'π2:Ξ»'
protocol: |
π(Ξ¦.y):
πΌ(L_shrink):
π1Β·1 := β¦ head β¦ π1:Ξ», tail β¦ Ξ¦.bytes( Ο β¦ π2:Ξ» ).as-number β§ # π(ΞΎ.x)
π(Ξ¦.bytes( Ο β¦ π2:Ξ» ).as-number):
πΒ·1Β·1 := Ξ¦.bytes( Ο β¦ π2:Ξ» )
π(πΒ·1Β·1.as-number.Ο):
πΒ·1Β·2 := Ξ¦.number( Ο β¦ πΒ·1Β·1 )
π(πΒ·1Β·1.as-number.Ο.Ο):
πΒ·1Β·3 := Ξ¦.bytes( Ο β¦ π2:Ξ» )
π2Β·1 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π1
πΒ·1Β·4 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π
πΒ·1Β·5 := β¦ head β¦ π1:Ξ», tail β¦ π2:Ξ» β§ # π(πΒ·1Β·4)