packages feed

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)