packages feed

phino-0.0.81: resources/morphing.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# Morphing 𝕄 β€” applied top-to-bottom, first matching clause wins. The input
# is always a normal form: a non-NF expression matches no clause.

- name: prim
  description: '𝕄(p) ⟿ p'
  match: 𝑝
  then: 𝑝

- name: lambda
  description: '𝕄(⟦𝐡1, Ξ» ‍ F, 𝐡2⟧ * t) ⟿ 𝕄(𝒩(F(⟦𝐡1, 𝐡2⟧) * t))'
  match: '⟦𝐡1, λ ‍ !F, 𝐡2⟧ * !t'
  where:
    - meta: 𝑒
      function: lambda
      args:
        - '⟦𝐡1, λ ‍ !F, 𝐡2⟧'
  then:
    morph:
      normalize: '𝑒 * !t'

- name: root
  description: '𝕄(Ξ¦.Ο„ * t) ⟿ 𝕄(𝒩(e * t)) if Ξ¦ ↦ ⟦𝐡1, Ο„ ↦ e, 𝐡2⟧'
  match: 'Φ.𝜏 * !t'
  where:
    - meta: 𝑒
      function: global
      args:
        - 𝜏
  then:
    morph:
      normalize: '𝑒 * !t'

- name: stuck
  description: '𝕄(n) ⟿ βŠ₯ otherwise'
  match: 𝑛
  then: βŠ₯