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

☣️ Issue dispatching hcom for sigma types #303

Open
TOTBWF opened this issue Feb 23, 2022 · 4 comments
Open

☣️ Issue dispatching hcom for sigma types #303

TOTBWF opened this issue Feb 23, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@TOTBWF
Copy link
Collaborator

TOTBWF commented Feb 23, 2022

When messing around with some ideas that @cangiuli had regarding records, I came across the following crash:

import prelude
import hlevel

-- Equivalences.
def fiber (A : type) (B : type)  (f : A → B) (b : B) : type := (a : A) × path B {f a} b

def is-equiv (A : type) (B : type) (f : A → B) : type := (b : B) → is-contr {fiber A B f b}

def equiv (A : type) (B : type) : type := (f : A → B) × is-equiv A B f

def equiv/id (A : type) : equiv A A :=
  [ x => x,
    x => [
      [ x , i => x ],
      fib i =>
        let aux : 𝕀 → A := j =>
	  hcom A 1 j {∂ i} {j _ => [
	    | j=1 ∨ i=0 => x
	    | i=1 => {snd fib} j
	    ]
	  }
        in [ aux 0, aux ]
    ]
  ]

#normalize {equiv/id {(x : type) × x}}

This crashes with:

[DEBUG] dispatch_rigid_hcom: lam[clo[lam[<anon>, el/out[ap[ap[var[2], var[1]], var[0]]]] ; [
[ 
] ; [ <let-sym> ]]]]
Core.Semantics.NbeFailed("Invalid arguments to dispatch_rigid_hcom")

I suspect that there's something fishy going on here with hcom_sg... It's worth noting this is fine for say, (x : type) × nat

@TOTBWF TOTBWF self-assigned this Feb 23, 2022
@TOTBWF TOTBWF added the bug Something isn't working label Feb 23, 2022
@TOTBWF
Copy link
Collaborator Author

TOTBWF commented Feb 23, 2022

Here's a more minimal repo:

def test : (x : type) × x :=
  hcom {(x : type) × x} 0 1 ⊥ {j _ =>  [ j=0 => [ nat, 4 ] ] }

@favonia favonia changed the title Issue dispatching hcom for sigma types ☣️ Issue dispatching hcom for sigma types Feb 23, 2022
@favonia favonia changed the title ☣️ Issue dispatching hcom for sigma types ☣️ Issue dispatching hcom for sigma types Feb 23, 2022
@TOTBWF
Copy link
Collaborator Author

TOTBWF commented Feb 26, 2022

After a bit of poking around, it seems that the crash happens when we try to evaluate the cap of the Box by test...

@jonsterling
Copy link
Collaborator

could it be caused by #288 ? LOL

@TOTBWF
Copy link
Collaborator Author

TOTBWF commented Mar 3, 2022

Oh that could totally be it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants