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

Can't case split an HitInt with some already existing cases #5702

Closed
ShreckYe opened this issue Dec 17, 2021 · 1 comment · Fixed by #6214
Closed

Can't case split an HitInt with some already existing cases #5702

ShreckYe opened this issue Dec 17, 2021 · 1 comment · Fixed by #6214
Assignees
Labels
cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp hits Higher inductive types internal-error Concerning internal errors of Agda type: bug Issues and pull requests about actual bugs
Milestone

Comments

@ShreckYe
Copy link

"HitInt.agda":

{-# OPTIONS --cubical --safe #-}
module HitInt where

open import Cubical.Data.Nat
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude using (subst)

data  : Set where
  pos : (n : ℕ) neg : (n : ℕ) posneg : pos 0 ≡ neg 0

-- copied and adapted from Cubical.Data.Int.MoreInts.QuoInt.Base

sucℤ : ℤ
sucℤ (pos n)       = pos (suc n)
sucℤ (neg zero)    = pos 1
sucℤ (neg (suc n)) = neg n
sucℤ (posneg _)    = pos 1

predℤ : ℤ
predℤ (neg n)       = neg (suc n)
predℤ (pos zero)    = neg 1
predℤ (pos (suc n)) = pos n
predℤ (posneg _)    = neg 1

_+ℤ_ : ℤ
m +ℤ (pos (suc n)) = sucℤ   (m +ℤ pos n)
m +ℤ (neg (suc n)) = predℤ  (m +ℤ neg n)
m +ℤ _             = m

"SymInt.agda":

{-# OPTIONS --cubical --safe #-}
module SymInt where

open import Cubical.Core.Everything
open import HitInt renaming (_+ℤ_ to _+_; ℤ to Z)

open import Cubical.Foundations.Prelude using (refl; cong)
open import Cubical.Data.Nat using (zero; suc)

0+ :  a  pos zero + a ≡ a
0+ (pos (suc n)) = cong sucℤ (0+ (pos n))
0+ (neg (suc n)) = cong predℤ (0+ (neg n))
0+ a = {!!}

I get this when case splitting a in the hole with the VS Code plugin on Windows:

An internal error has occurred. Please report this as a bug.
Location of the error: __IMPOSSIBLE__, called at src/full\Agda\TypeChecking\Coverage\Match.hs:449:17 in Agda-2.6.2.1-298662f04d83232d4bb339c60ce5d585c6be23bd:Agda.TypeChecking.Coverage.Match
@ShreckYe ShreckYe changed the title Can't case split an HitInt Can't case split an HitInt with some already existing cases Dec 17, 2021
@ice1000
Copy link
Member

ice1000 commented Jan 1, 2022

VarP _ x -> __IMPOSSIBLE__ -- blockedOnConstructor (splitPatVarIndex x) c

🤔🤔

/cc @Saizan

@jespercockx jespercockx added cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp hits Higher inductive types type: bug Issues and pull requests about actual bugs internal-error Concerning internal errors of Agda labels Aug 25, 2022
@jespercockx jespercockx added this to the 2.6.3 milestone Aug 25, 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 hits Higher inductive types internal-error Concerning internal errors of Agda type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants