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

Panic: Pattern match failure with Setω and --without-K #6005

Closed
flupe opened this issue Aug 2, 2022 · 3 comments
Closed

Panic: Pattern match failure with Setω and --without-K #6005

flupe opened this issue Aug 2, 2022 · 3 comments
Assignees
Labels
cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp internal-error Concerning internal errors of Agda regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) set-omega Problems with infinite sorts (Setω/SSetω) type: bug Issues and pull requests about actual bugs
Milestone

Comments

@flupe
Copy link
Contributor

flupe commented Aug 2, 2022

There seem to be a regression in the current master of Agda.

The following code (where we define the equality type at Setω)

{-# OPTIONS --without-K #-}

open import Agda.Builtin.Equality
open import Agda.Primitive using (Setω)

data _≡ω_ {A : Setω} (x : A) : A  Setω where
  refl : x ≡ω x

congω : {A : Set} {B : Setω} (f : A  B)
        {x y}  x ≡ y  f x ≡ω f y
congω f refl = refl

fails with the following message:

cong.agda:11,1-20
Panic: Pattern match failure in do expression at
src/full/Agda/TypeChecking/Primitive/Cubical.hs:2310:7-21
when checking the definition of congω

Can confirm this typechecks fine with the latest release (2.6.2.2) and with --with-K.

@flupe
Copy link
Contributor Author

flupe commented Aug 3, 2022

Just noticed the code fails at the same place as #6001. I also logged the types passed to toLType, giving:

toLType @14 ≡ @11 @0
toLType @14 ≡ @11 @0
toLType @13 ≡ @10 @0
toLType @13 ≡ @10 @0
toLType @11 @10 ≡ω @11 @9

As expected, the code fails because toLType does not handle things that live in Setω, just as for Prop (See #5816 and the fix #5897). I tried checking the example with the fix from #5897 and it no longer fails, so we can consider this issue to also be fixed by #5897.

@plt-amy plt-amy added type: bug Issues and pull requests about actual bugs cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp internal-error Concerning internal errors of Agda labels Aug 15, 2022
@andreasabel andreasabel added the regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) label Aug 23, 2022
@andreasabel andreasabel added this to the 2.6.3 milestone Aug 23, 2022
@andreasabel andreasabel added the set-omega Problems with infinite sorts (Setω/SSetω) label Aug 23, 2022
@andreasabel
Copy link
Member

Current error (after #5730 has been improved) is more benign:

Cannot generate inferred clause for congω. Case to handle:
  congω f
    (Agda.Primitive.Cubical.primHComp {.Agda.Primitive.lzero}
       {.(_ ≡ _)}
       {φ = φ}
       u
       a)
Cannot compose with type family: f x ≡ω f y.
when checking the definition of congω

@plt-amy
Copy link
Member

plt-amy commented Aug 31, 2022

Part of #6049, still an internal error to be fixed

@plt-amy plt-amy self-assigned this Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp internal-error Concerning internal errors of Agda regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) set-omega Problems with infinite sorts (Setω/SSetω) type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

No branches or pull requests

3 participants