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

Evarconv does not handle opaque primitive projections correctly #17774

Closed
Janno opened this issue Jun 28, 2023 · 1 comment
Closed

Evarconv does not handle opaque primitive projections correctly #17774

Janno opened this issue Jun 28, 2023 · 1 comment
Milestone

Comments

@Janno
Copy link
Contributor

Janno commented Jun 28, 2023

Description of the problem

Evarconv considers opaque primitive projections not unifiable with themselves. The code below reproduces the problem in a roundabout way. (There is only one code path in Coq that calls Evarconv with transparency states that are not TransparentState.full!)

#[projections(primitive)]
Record r := { w : Prop -> Prop -> Prop }.

Set Typeclasses Filtered Unification. (* Only used to trigger evarconv code path *)
Class C (P : Prop) := {}.
Definition wand_apply (v : r) (P Q : Prop) : C (w v P Q) := Build_C _.
#[local] Hint Resolve wand_apply : typeclass_instances.

Goal forall (v : r) (Q P : Prop), C (w v P Q).
Proof.
  intros.
  Succeed typeclasses eauto.
  #[local] Hint Opaque w : typeclass_instances.
  Set Debug "unification,ho-unification".
  Fail typeclasses eauto.
Abort.

The example does not work on master because Typeclasses Filtered Unification has been removed. Our (closed source) OCaml plugin that first exhibited this problem only compiles with 8.17 right now so we do not know if the problem exists on master.

Coq Version

8.17

rlepigre added a commit to rlepigre/coq that referenced this issue Jun 29, 2023
rlepigre added a commit to rlepigre/coq that referenced this issue Jun 29, 2023
rlepigre added a commit to rlepigre/coq that referenced this issue Jul 3, 2023
rlepigre added a commit to rlepigre/coq that referenced this issue Sep 6, 2023
@rlepigre
Copy link
Contributor

rlepigre commented Sep 6, 2023

This can also be reproduced on master now, thanks to #17777 (see the new test case in #17788).

rlepigre added a commit to rlepigre/coq that referenced this issue Sep 6, 2023
rlepigre added a commit to rlepigre/coq that referenced this issue Sep 6, 2023
@coqbot-app coqbot-app bot closed this as completed in 3cabe16 Sep 8, 2023
@coqbot-app coqbot-app bot added this to the 8.19+rc1 milestone Sep 8, 2023
Villetaneuse pushed a commit to Villetaneuse/coq that referenced this issue Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants