Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unification #48

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Unification #48

wants to merge 3 commits into from

Conversation

EwenBC
Copy link
Collaborator

@EwenBC EwenBC commented Nov 4, 2024

Creation of unification algorithm which update context by solving a telescopic equality

Algorithm:

Input:

  • a context Γ and a telescope equality ΔEq.

Output:

  • a new context Γ' ⊆ Γ where some variables of Γ have been replaced by their value from the unification
  • an equivalence between (Γ, ΔEq) and Γ'.

Example:

Input:

  • Γ := (m n : ℕ)(x y : A)(xs : Vec A m)(ys : Vec A n)
  • ΔEq := (e₁ : suc m ≡ suc n)(e₂ : cons m x xs ≡(Vec A e₁) cons n y ys)

Output:

  • Γ' := (m : ℕ)(x : A)(xs : Vec A m)
  • σ : (Γ, ΔEq) → Γ'
  • τ : Γ' → (Γ, ΔEq)
  • (maybe) e: ∀ x, σ τ x = x
  • (maybe) e': ∀ x, τ σ x = x

For more:

Implementation based on Proof-relevant unification: Dependent pattern matching with only the axioms of your type theory by Jesper Cockk and Dominique Devriese.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant