packages feed

phino-0.0.88: resources/contextualization.yaml

# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# Contextualization π’ž β€” applied top-to-bottom, first matching clause wins. It is
# binary, π’ž(n, c): n is the term being contextualized and c is the context (the
# expression that every free ΞΎ inside n stands for). π’ž walks the term
# structurally, replacing each ΞΎ with the context c, descending through
# dispatches and applications and stopping at formations β€” which introduce their
# own scope and are returned untouched β€” and at the global Ξ¦ and termination βŠ₯.
#
# Each rule is an inference rule: when 'match' matches the term and 'c-match'
# matches the context (binding the meta c), the rule yields the conclusion
# 'c-result' (a premise meta or a literal), provided the ordered 'premises'
# reduce as stated. A premise binds its 'n-result' to one π’ž ('contextualize')
# judgment. 'c-match' is the context-argument matcher of π’ž(n, c); it is always
# the c meta. Derived terms are named 𝑛, 𝑛1, … in premise order; the bare 𝑛 is
# skipped only when 'match' already binds it.

- name: cglobe
  match: Ξ¦
  c-match: π‘˜
  c-result: Ξ¦

- name: cxi
  match: ΞΎ
  c-match: π‘˜
  c-result: π‘˜

- name: cdead
  match: βŠ₯
  c-match: π‘˜
  c-result: βŠ₯

- name: cprim
  match: ⟦𝐡⟧
  c-match: π‘˜
  c-result: ⟦𝐡⟧

- name: cdispatch
  match: '𝑛.𝜏'
  c-match: π‘˜
  c-result: '𝑛1.𝜏'
  premises:
    - n-result: 𝑛1
      contextualize:
        - 𝑛
        - π‘˜

- name: capplication
  match: '𝑛(𝜏 ↦ 𝑒1)'
  c-match: π‘˜
  c-result: '𝑛1(𝜏 ↦ 𝑛2)'
  premises:
    - n-result: 𝑛1
      contextualize:
        - 𝑛
        - π‘˜
    - n-result: 𝑛2
      contextualize:
        - 𝑒1
        - π‘˜

- name: capplicationa
  match: '𝑛(α𝑖 ↦ 𝑒1)'
  c-match: π‘˜
  c-result: '𝑛1(α𝑖 ↦ 𝑛2)'
  premises:
    - n-result: 𝑛1
      contextualize:
        - 𝑛
        - π‘˜
    - n-result: 𝑛2
      contextualize:
        - 𝑒1
        - π‘˜