I have a long section (800LoC), that creates a new type and proves lots of lemmas about it, and put some of them into specific hint databases (both normal and rewrite). The proof of later lemmas in the section use both databases in their proof scripts. Then I close the section and the databases disappear. Is there a way to export that database outside the section so that user of the type can use the associated databases, or do I need to copy all the hint commands outside the section?
sadly for now you need to copy the hints — or split the section. You want #[export] Hint Resolve
/#[global] Hint Resolve
, but this is still pending last I checked
where "split the section" means
End your_section.
#[export] Hint Resolve ....
Section your_section.
(* abstract again over everything — hoping all assumptions can be auto-inferred when applying hints, but otherwise you'd have bigger problems *)
...
and yeah, I agree this isn't great when you use hints to prove more hints :-|
To be sure, the difficulty is that hints can contain arbitrary tactic code, and that the section-closing mechanism cannot handle tactics, right?
Hint Resolve
can't use tactics
and each Hint
command gives semantics to attributes separately — you're talking of Hint Extern
, which is orthogonal to Hint Resolve
.
no, the difficulty is that nobody has written the section closing for Hint Resolve
also not clear we want to do it when the hint is an arbitrary term
even having it just for constants would be very nice, especially since using arbitrary terms is somewhat discouraged already (I forget how officially beyond "PMP wants to drop that")
existing issue https://github.com/coq/coq/issues/16048
ping @Pierre-Marie Pédrot
Last updated: Oct 13 2024 at 01:02 UTC