-
Notifications
You must be signed in to change notification settings - Fork 632
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
Transparency in hint databases need some more documentation #5301
Comments
Comment author: @jhjourdan When are constants considered opaque for eauto ? [Hint Opaque] should make it possible to make some constant opaque, but apparently it does not in all cases, and particular in the following script: Parameter P : nat -> Prop.
Definition d := 1.
Hint Opaque d.
Parameter H : P 1.
Hint Resolve H.
Goal P d. eauto. (* H has been used although d is opaque. *) Qed. Moreover, it seems like (even though I am not sure) Hint Opaque annotations are completely ignored when it comes to unfold constants appearing in hints (as opposed to when they appear in the goals they are unified to). Additionally, the [discriminated] option that we can put on hint databases has poor documentation. Is it possible to get an example where it makes a difference in performance and/or in behavior? |
Essentially, Example:
IIRC, the reason for this highly annoying discrepancy is compatibility. Théo has been working on fixing this. |
Thanks! And apart from its limitations, what does the flag itself mean? Does it make constants opaque on both sides of the resolution (i.e. the current goal and the hints)? |
Yes, it calls unification with that constant declared opaque, so in both
the goal and hint side.
…On Sat, Nov 10, 2018 at 2:00 PM Maxime Dénès ***@***.***> wrote:
Thanks! And apart from its limitation, what does the flag itself mean?
Does it make constants opaque on both sides of the resolution (i.e. the
current goal and the hints)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5301 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGARbRHAq3r869qrjSQ7F4XkXUiWimpks5utszWgaJpZM4YXsrO>
.
|
Thanks @mattam82! One more thing I was wondering. Suppose I have an alias like Does Context: I'm trying to remove some module-related features from the kernel, but I need to tweak the behavior of hints w.r.t. aliases. |
A priori, you will have to fix |
Maybe I misinterpreted what you wrote above, but is the following a bug w.r.t. Axiom b : nat -> Prop.
Definition a := b.
Create HintDb foo.
Hint Transparent a : foo.
Hint Unfold a : foo.
Axiom ax0 : a 0.
Hint Resolve ax0 : foo.
Goal b 0.
Proof.
new auto with foo.
Qed. (* fails *) |
Oh I see now. This is not symmetric as I said earlier. Only in
discriminated databases ax0 is treated as a hint with no pattern because
you declared it transparent, which makes it apply to the `b 0` goal.
Otherwise we’re looking for the b head and nothing is found.
Le lun. 12 nov. 2018 à 18:24, Maxime Dénès <notifications@github.com> a
écrit :
… Maybe I misinterpreted what you wrote above, but is the following a bug
w.r.t. Hint Transparent, then?
Axiom b : nat -> Prop.Definition a := b.
Create HintDb foo.
Hint Transparent a : foo.Hint Unfold a : foo.
Axiom ax0 : a 0.Hint Resolve ax0 : foo.
Goal b 0.Proof.
new auto with foo.Qed. (* fails *)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5301 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGARZQYldbmaYjAaN0mApS0aXd0h4UEks5uua7QgaJpZM4YXsrO>
.
|
But then why doesn't it work with a discriminated database? Axiom b : nat -> Prop.
Definition a := b.
Create HintDb foo discriminated.
Hint Transparent a : foo.
Hint Unfold a : foo.
Axiom ax0 : a 0.
Hint Resolve ax0 : foo.
Goal b 0.
Proof.
new auto with foo.
Qed. |
Gah, because we still register |
So, is it a bug? If yes, I'll report it and try to fix it.
I would have expected the registration to unfold |
Here's another example demonstrating (in Coq 8.9.0) the original bug:
The If we "fix" auto so that it respects Opaque, how many users' proofs will break? Can we have a mode-switch for this, so that we can make experiments to investigate this question? |
Note: the issue was created automatically with bugzilla2github tool
Original bug ID: BZ#5301
From: @jhjourdan
Reported version: 8.6
CC: @RalfJung
The text was updated successfully, but these errors were encountered: