fix function η with subsingleton types
This commit is contained in:
parent
c9f66bb6af
commit
d2a117fe61
4 changed files with 54 additions and 2 deletions
33
golden-tests/tests/eta-singleton/eta-sing.quox
Normal file
33
golden-tests/tests/eta-singleton/eta-sing.quox
Normal file
|
@ -0,0 +1,33 @@
|
|||
-- inspired by https://github.com/agda/agda/issues/2556
|
||||
|
||||
postulate0 A : ★
|
||||
|
||||
def0 ZZ : ★ = 0 ≡ 0 : ℕ
|
||||
|
||||
def reflZ : ZZ = δ _ ⇒ 0
|
||||
|
||||
|
||||
namespace erased {
|
||||
def0 ZZA : ★ = 0.ZZ → A
|
||||
|
||||
def propeq : (x : ZZA) → x ≡ (λ _ ⇒ x reflZ) : ZZA =
|
||||
λ x ⇒ δ _ ⇒ x
|
||||
|
||||
def defeq : 0.(P : ZZA → ★) → 0.(x : ZZA) → P (λ _ ⇒ x reflZ) → P x =
|
||||
λ P x p ⇒ p
|
||||
}
|
||||
|
||||
namespace unrestricted {
|
||||
def0 ZZA : ★ = ω.ZZ → A
|
||||
|
||||
def defeq : 0.(P : ZZA → ★) → 0.(x : ZZA) → P (λ _ ⇒ x reflZ) → P x =
|
||||
λ P x p ⇒ p
|
||||
}
|
||||
|
||||
namespace linear {
|
||||
def0 ZZA : ★ = 1.ZZ → A
|
||||
|
||||
#[fail]
|
||||
def defeq : 0.(P : ZZA → ★) → 0.(x : ZZA) → P (λ _ ⇒ x reflZ) → P x =
|
||||
λ P x p ⇒ p
|
||||
}
|
9
golden-tests/tests/eta-singleton/expected
Normal file
9
golden-tests/tests/eta-singleton/expected
Normal file
|
@ -0,0 +1,9 @@
|
|||
0.A : ★
|
||||
0.ZZ : ★
|
||||
ω.reflZ : ZZ
|
||||
0.erased.ZZA : ★
|
||||
ω.erased.propeq : 1.(x : erased.ZZA) → x ≡ (λ _ ⇒ x reflZ) : erased.ZZA
|
||||
ω.erased.defeq : 0.(P : 1.erased.ZZA → ★) → 0.(x : erased.ZZA) → 1.(P (λ _ ⇒ (x reflZ))) → P x
|
||||
0.unrestricted.ZZA : ★
|
||||
ω.unrestricted.defeq : 0.(P : 1.unrestricted.ZZA → ★) → 0.(x : unrestricted.ZZA) → 1.(P (λ _ ⇒ (x reflZ))) → P x
|
||||
0.linear.ZZA : ★
|
2
golden-tests/tests/eta-singleton/run
Normal file
2
golden-tests/tests/eta-singleton/run
Normal file
|
@ -0,0 +1,2 @@
|
|||
. ../lib.sh
|
||||
check "$1" eta-sing.quox
|
Loading…
Add table
Add a link
Reference in a new issue