-
Notifications
You must be signed in to change notification settings - Fork 22
/
HintLocality.v
56 lines (46 loc) · 1.35 KB
/
HintLocality.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
(* Here's how local, global, and export hints work in Coq.
Very similar principles apply to definitions, but hints are a little special
in that:
(1) you can't name them to retrieve them locally (whereas you can qualify the
module for an un-exported definition and still use it) and (2) it's hard to
determine their scope because you can't name them and figure out where they
are
*)
Module A.
(* gfact will have a global hint proving it,
efact will have an export hint,
and lfact only as a local hint *)
Axioms gfact efact lfact : Prop.
Axiom gfact_true : gfact.
Axiom efact_true : efact.
Axiom lfact_true : lfact.
Global Hint Resolve gfact_true : core.
#[export] Hint Resolve efact_true : core.
Local Hint Resolve lfact_true : core.
End A.
Module B.
Import A.
(* here we directly imported both hints, so export vs
global makes no difference, but we don't have the
local one *)
Goal A.gfact.
Proof. auto. Qed.
Goal A.efact.
Proof. auto. Qed.
Goal A.lfact.
Proof. Fail progress auto. Abort.
End B.
Module C.
Import B.
(* here we only have the global hint from A, not the export one *)
Goal A.gfact.
Proof. auto. Qed.
Goal A.efact.
Proof.
(* doesn't work, we need to import A to get the relevant
* hint *)
Fail progress auto.
Abort.
Goal A.lfact.
Proof. Fail progress auto. Abort.
End C.