forked from agda/agda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…-rewriting is enabled
- Loading branch information
1 parent
d7455a6
commit c4499fb
Showing
8 changed files
with
116 additions
and
17 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
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,28 @@ | ||
{-# OPTIONS --rewriting #-} | ||
|
||
open import Agda.Builtin.Equality | ||
open import Agda.Builtin.Bool | ||
open import Agda.Builtin.Nat | ||
|
||
{-# BUILTIN REWRITE _≡_ #-} | ||
|
||
not : Bool → Bool | ||
not true = false | ||
not false = true | ||
|
||
data Unit : Set where | ||
unit : Unit | ||
|
||
postulate | ||
X : Unit → Set | ||
X-Nat : X unit ≡ Nat | ||
X-Bool : (u : Unit) → X u ≡ Bool | ||
{-# REWRITE X-Nat #-} | ||
|
||
0' : (u : Unit) → X u | ||
0' unit = 0 | ||
|
||
{-# REWRITE X-Bool #-} | ||
|
||
test : (u : Unit) → not (0' u) ≡ true | ||
test unit = refl |
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,4 @@ | ||
Issue5396.agda:28,13-17 | ||
not 0 != true of type Bool | ||
when checking that the expression refl has type | ||
not (0' unit) ≡ true |
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,50 @@ | ||
{-# OPTIONS --type-in-type --rewriting #-} | ||
|
||
open import Agda.Builtin.Sigma | ||
open import Agda.Builtin.Equality | ||
|
||
coe : {A B : Set} → A ≡ B → A → B | ||
coe refl x = x | ||
|
||
{-# BUILTIN REWRITE _≡_ #-} | ||
|
||
Tel = Set | ||
U = Set | ||
|
||
variable | ||
Δ : Tel | ||
A B : Δ → U | ||
δ₀ δ₁ : Δ | ||
|
||
postulate | ||
IdTel : (Δ : Tel)(δ₀ δ₁ : Δ) → Tel | ||
Id : (A : Δ → U){δ₀ δ₁ : Δ}(δ₂ : IdTel Δ δ₀ δ₁) → A δ₀ → A δ₁ → U | ||
ap : {A : Δ → U}(a : (δ : Δ) → A δ) | ||
→ {δ₀ δ₁ : Δ}(δ₂ : IdTel Δ δ₀ δ₁) → Id A δ₂ (a δ₀) (a δ₁) | ||
|
||
idTel-sigma : {a₀ : A δ₀}{a₁ : A δ₁} | ||
→ IdTel (Σ Δ A) (δ₀ , a₀) (δ₁ , a₁) | ||
≡ Σ (IdTel Δ δ₀ δ₁) (λ δ₂ → Id A δ₂ a₀ a₁) | ||
{-# REWRITE idTel-sigma #-} | ||
|
||
id-u : {A₀ A₁ : U}{δ₂ : IdTel Δ δ₀ δ₁} | ||
→ Id {Δ = Δ}(λ _ → U) δ₂ A₀ A₁ ≡ (A₀ → A₁ → U) | ||
{-# REWRITE id-u #-} | ||
|
||
id-ap : {δ₂ : IdTel Δ δ₀ δ₁}{a₀ : A δ₀}{a₁ : A δ₁} | ||
→ Id A δ₂ a₀ a₁ ≡ ap {A = λ _ → U} A δ₂ a₀ a₁ | ||
|
||
ap-sigma : {δ₂ : IdTel Δ δ₀ δ₁}{a₀ : A δ₀}{a₁ : A δ₁} | ||
{B : (δ : Δ) → A δ → U} | ||
{b₀ : B δ₀ a₀}{b₁ : B δ₁ a₁}→ | ||
ap {Δ = Δ}{A = λ _ → U} (λ δ → Σ (A δ) (B δ)) | ||
δ₂ (a₀ , b₀) (a₁ , b₁) ≡ | ||
Σ (Id A δ₂ a₀ a₁) λ a₂ → Id {Δ = Σ Δ A} (λ (δ , a) → B δ a) (δ₂ , a₂) b₀ b₁ | ||
{-# REWRITE ap-sigma #-} | ||
{-# REWRITE id-ap #-} | ||
|
||
ap-proj₁ : {δ₂ : IdTel Δ δ₀ δ₁} | ||
{B : (δ : Δ) → A δ → U} | ||
{ab : (δ : Δ) → Σ (A δ) (B δ)} | ||
→ ap {Δ = Δ}{A = A}(λ δ → fst (ab δ)) δ₂ | ||
≡ fst (ap ab δ₂) |
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,4 @@ | ||
Issue5531.agda:50,23-31 | ||
ap (λ z → Σ (_A_208 z) (B z)) _239 (ab _δ₀_236) (ab _δ₁_237) !=< | ||
Σ _A_232 _B_233 | ||
when checking that the expression ap ab δ₂ has type Σ _A_232 _B_233 |