-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: Improve build, make it possible to write code with lsp (#1045)
- Loading branch information
Showing
9 changed files
with
131 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
open import Paths | ||
|
||
open data Nat | zero | suc Nat | ||
|
||
overlap def infix + Nat Nat : Nat | ||
| 0, b => b | ||
| a, 0 => a | ||
| suc a, b => suc (a + b) | ||
| a, suc b => suc (a + b) | ||
tighter = | ||
|
||
overlap def +-comm (a b : Nat) : a + b = b + a | ||
| 0, _ => refl | ||
| suc _, _ => pmap suc (+-comm _ _) | ||
| _, 0 => refl | ||
| _, suc _ => pmap suc (+-comm _ _) | ||
|
||
overlap def +-assoc (a b c : Nat) : a + (b + c) = (a + b) + c | ||
| 0, _, _ => refl | ||
| suc _, _, _ => pmap suc (+-assoc _ _ _) | ||
| _, 0, _ => refl | ||
| _, suc _, _ => pmap suc (+-assoc _ _ _) | ||
| _, _, 0 => refl | ||
| _, _, suc _ => pmap suc (+-assoc _ _ _) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
cli-impl/src/test/resources/shared/src/TypeTheory/Thorsten.aya
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
open import Paths | ||
|
||
open data Con : Type | ||
| • | ||
| infix ▷ (Γ : Con) (Ty Γ) | ||
|
||
// The ↑ operator in the paper | ||
def ext {Γ Δ : Con} (δ : Γ << Δ) (A : Ty Δ) : Γ ▷ Subst A δ << Δ ▷ A => | ||
δ ∘ π₁ (id refl) ∷ transport (Tm _) SubAss (π₂ (id refl)) | ||
|
||
// Incomplete | ||
open data Ty (Γ : Con) : Type | ||
| U | ||
| Π (A : Ty Γ) (B : Ty (Γ ▷ A)) | ||
| El (A : Tm Γ U) | ||
| Subst {Δ : Con} (Ty Δ) (s : Γ << Δ) | ||
| SubId {A : Ty Γ} : Subst A (id refl) = A | ||
| SubAss {Δ Θ : Con} {A : Ty Θ} {θ : Γ << Δ} {δ : Δ << Θ} | ||
: Subst (Subst A δ) θ = Subst A (δ ∘ θ) | ||
| SubU {Δ : Con} (δ : Γ << Δ) : Subst U δ = U | ||
| SubEl {Δ : Con} {δ : Γ << Δ} {a : Tm Δ U} | ||
: Subst (El a) δ = El (transport (Tm _) (SubU δ) (sub a)) | ||
| SubΠ {Δ : Con} (σ : Γ << Δ) {A : Ty Δ} {B : Ty (Δ ▷ A)} | ||
: Subst (Π A B) σ = Π (Subst A σ) (Subst B (ext σ A)) | ||
|
||
// Tms | ||
open data infix << (Γ : Con) (Δ : Con) : Type | ||
tighter = looser ▷ | ||
| _, • => ε | ||
| _, Δ ▷ A => infixr ∷ (δ : Γ << Δ) (Tm Γ (Subst A δ)) tighter = | ||
| infix ∘ {Θ : Con} (Θ << Δ) (Γ << Θ) tighter = ∷ | ||
| π₁ {A : Ty Δ} (Γ << Δ ▷ A) | ||
| id (Γ = Δ) | ||
| idl• {s : Γ << Δ} : id refl ∘ s = s | ||
| idr• {s : Γ << Δ} : s ∘ id refl = s | ||
| ass {Θ Ξ : Con} {ν : Γ << Ξ} {δ : Ξ << Θ} {σ : Θ << Δ} | ||
: (σ ∘ δ) ∘ ν = σ ∘ (δ ∘ ν) | ||
| π₁β {δ : Γ << Δ} {A : Ty Δ} (t : Tm Γ (Subst A δ)) : π₁ (δ ∷ t) = δ | ||
| Γ, Δ ▷ A => πη {δ : Γ << Δ ▷ A} : (π₁ δ ∷ π₂ δ) = δ | ||
| Γ, Δ ▷ A => ∷∘ {Θ : Con} {σ : Θ << Δ} {δ : Γ << Θ} {t : Tm Θ (Subst A σ)} | ||
: (σ ∷ t) ∘ δ = (σ ∘ δ) ∷ transport (Tm _) SubAss (sub t) | ||
| Γ, • => εη {δ : Γ << •} : δ = ε | ||
|
||
// Incomplete | ||
open data Tm (Γ : Con) (A : Ty Γ) : Type | ||
| _, Π A B => λ (Tm (Γ ▷ A) B) | ||
| Γ' ▷ A, B => app (Tm Γ' (Π A B)) | ||
| _, Subst A δ => sub (Tm _ A) | ||
| _, Subst A (π₁ δ) => π₂ (Γ << _ ▷ A) | ||
| _, Subst B δ => π₂β {Δ : Con} (t : Tm Γ A) | ||
: transport (Tm _) (pmap (Subst B) (π₁β t)) (π₂ (δ ∷ t)) = t | ||
| _ ▷ _, A => Πβ (f : Tm Γ A) : app (λ f) = f | ||
| _, Π _ _ => Πη (f : Tm Γ A) : λ (app f) = f | ||
// Subλ is omitted for its overwhleming complexity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters