Let's say I have a type class like the following:
Class Decision (P : Prop) := decide : {P} + {¬P}.
Hint Mode Decision ! : typeclass_instances.
Would the recommended hint locality always be #[global]
for this case? Is there any situation one might want #[local]
or #[export]
?
IIUC, you're declaring the clearly correct hint mode together with the typeclass at the outset, right? Then I'd recommend global, and very much not export.
Also, under my assumptions, and assuming clients aren't hit by some bug, nobody is going to need to override the mode, so there's no use for export and local.
However, all the assumptions I mentioned have exceptions.
I recently git-committed a crime as follows (viewer discretion advised): Module danger. #[export] Hint Mode elem_of !!!!!! : kinda_core. Hint Resolve <lemma about elem_of that risks instantiating evars> : kinda_core. End danger.
thanks, that's what I suspected
Karl Palmskog has marked this topic as resolved.
Last updated: Oct 13 2024 at 01:02 UTC