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

"Hint Rewrite" with unresolved typeclass evar anomaly #6115

Closed
samuelgruetter opened this issue Nov 8, 2017 · 2 comments
Closed

"Hint Rewrite" with unresolved typeclass evar anomaly #6115

samuelgruetter opened this issue Nov 8, 2017 · 2 comments
Labels
kind: anomaly An uncaught exception has been raised. part: typeclasses The typeclass mechanism.

Comments

@samuelgruetter
Copy link
Contributor

Version

8.6

Operating system

Linux

Description of the problem

Class Decidable (P : Prop) := dec : {P} + {~P}.
Arguments dec _%type_scope {_}.

Notation DecidableEq T := (forall (x y: T), Decidable (x = y)).

Axiom word: nat -> Type.
Axiom weq: forall (sz : nat) (x y : word sz), {x = y} + {x <> y}.

Instance dec_eq_word : forall sz, DecidableEq (word sz) := weq.

Lemma get_put: forall {var: Type} {dec_eq_var: DecidableEq var} (x y: var),
  (x = y) = if dec (x = y) then True else False.
Admitted.

Check (@get_put _ _).

Hint Rewrite (@get_put _ _) : rewrite_state_op_specs.

yields the following error on the last line:

Anomaly: Evar ?X18 was not declared. Please report at
http://coq.inria.fr/bugs/.
@JasonGross JasonGross added the kind: anomaly An uncaught exception has been raised. label Nov 8, 2017
@JasonGross
Copy link
Member

Also present in 8.7.0. I suspect what's happening is that when Hint Rewrite runs TC resolution to get a term out, it does not thread the evar map properly somewhere, and so when TC resolution partially refines some evars with newly created ones, bad things happen. I wonder if the anomaly comes from Hint Rewrite itself, or if it comes in trying to print the error message....

@Zimmi48 Zimmi48 added the part: typeclasses The typeclass mechanism. label Nov 11, 2017
@SkySkimmer
Copy link
Contributor

Fixed since 8.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: anomaly An uncaught exception has been raised. part: typeclasses The typeclass mechanism.
Projects
None yet
Development

No branches or pull requests

4 participants