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: β₯