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

Unsolved constraints when --no-syntactic-equality is used #4265

Closed
nad opened this issue Dec 4, 2019 · 4 comments · Fixed by #4609
Closed

Unsolved constraints when --no-syntactic-equality is used #4265

nad opened this issue Dec 4, 2019 · 4 comments · Fixed by #4609
Assignees
Labels
generalize Related to generalisable variables type: bug Issues and pull requests about actual bugs
Milestone

Comments

@nad
Copy link
Contributor

nad commented Dec 4, 2019

Agda does not accept the following code:

{-# OPTIONS --no-syntactic-equality #-}

open import Agda.Primitive

variable
  a : Level

postulate
  A : Set a

Unsolved constraints:

Failed to solve the following constraints:
  univSort Setω = univSort Setω
@nad nad added type: bug Issues and pull requests about actual bugs generalize Related to generalisable variables labels Dec 4, 2019
@nad nad added this to the 2.6.2 milestone Dec 4, 2019
@jespercockx
Copy link
Member

It would be easy to add this rule to the conversion algorithm, but it's unexpected that it is needed at all. This calls for some further investigation...

@nad
Copy link
Contributor Author

nad commented Apr 17, 2020

The problem does not seem to have been fully solved:

{-# OPTIONS --no-syntactic-equality #-}

open import Agda.Primitive

variable
  : Level
  A : SetP : A  Set
Failed to solve the following constraints:
  lsuc _A.ℓ_9 = lsuc _A.ℓ_9

@nad nad reopened this Apr 17, 2020
@nad
Copy link
Contributor Author

nad commented Apr 21, 2020

{-# OPTIONS --no-syntactic-equality #-}

module _ where

module M where

_ : let open M in  {a} {A : Set a}  A  A
_ = λ x  x
Failed to solve the following constraints:
  univSort Agda.Primitive.Setω = univSort Agda.Primitive.Setω

@nad nad reopened this Apr 21, 2020
@jespercockx
Copy link
Member

jespercockx commented Apr 21, 2020

The problem here is another missing case in the isType_ function, which means Agda falls back to creating a fresh sort meta and calling checkExpr. However, the sort meta is used as a type in this function, which is not valid because it should be instantiated to Setω. Hence you get this currently unsolvable constraint. Three possible ways to fix this:

The first solution could work but there are probably many other missing cases. I'd rather remove the current implementation of isType_ and just rely on checkExpr for everything. The second solution might work (I haven't tried yet) but it is not yet clear what are the performance implications of always enabling this flag. The third solution seems best but will have to wait until the issue of syntax is sorted out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generalize Related to generalisable variables type: bug Issues and pull requests about actual bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants