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

Typeclass resolution can lock coq-lsp responsiveness when looping #484

Open
Alizter opened this issue Apr 13, 2023 · 6 comments
Open

Typeclass resolution can lock coq-lsp responsiveness when looping #484

Alizter opened this issue Apr 13, 2023 · 6 comments

Comments

@Alizter
Copy link
Collaborator

Alizter commented Apr 13, 2023

It is a common occurrence to tweak a typeclass definition causing later lemmas to loop when searching. When this happens, it causes coq-lsp to become unresponsive.

@Alizter Alizter added the kind: bug Something isn't working label Apr 13, 2023
@ejgallego
Copy link
Owner

Can you provide a test case?

@Alizter
Copy link
Collaborator Author

Alizter commented Apr 13, 2023

Here is a test case:

From Coq Require Import Prelude.

Axiom Loop : Type.
Existing Class Loop.

Axiom loop : Loop -> Loop.
#[export] Existing Instance loop.

Global Instance foo : Loop.
Proof. Admitted.

Goal Loop.
exact _.

Try commenting out foo and typeclass search will loop. When this happens, LSP becomes unresponsive.

@ejgallego
Copy link
Owner

ejgallego commented Apr 14, 2023

Thanks a lot Ali, I have opened a file collecting uninterruptible cases, I hope to resolve them soon.

@ejgallego
Copy link
Owner

@Alizter note this example doesn't loop anymore, what'd be the suggested fix?

@ejgallego
Copy link
Owner

I did

Global Instance foo (a : Loop) : Loop.
Proof. Admitted.

for example, and that seems to work, but I don't know how TC work.

@Alizter
Copy link
Collaborator Author

Alizter commented May 10, 2024

If you give foo a lower priority with | 10 that should work.

ejgallego added a commit that referenced this issue May 16, 2024
@ejgallego ejgallego modified the milestones: 0.3.0, ocaml-5 Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants