Debian Codegraph @

interp/decls.ml

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 (** This module registers tables for some non-logical informations
12 associated declarations *)
13
14 open Names
15 open Libnames
16
17 type theorem_kind =
18 | Theorem
19 | Lemma
20 | Fact
21 | Remark
22 | Property
23 | Proposition
24 | Corollary
25
26 type definition_object_kind =
27 | Definition
28 | Coercion
29 | SubClass
30 | CanonicalStructure
31 | Example
32 | Fixpoint
33 | CoFixpoint
34 | Scheme
35 | StructureComponent
36 | IdentityCoercion
37 | Instance
38 | Method
39 | Let
40 | LetContext
41
42 type assumption_object_kind = Definitional | Logical | Conjectural | Context
43
44 (* [assumption_kind]
45
46 | Local | Global
47 ------------------------------------
48 Definitional | Variable | Parameter
49 Logical | Hypothesis | Axiom
50
51 *)
52
53 (** Kinds *)
54
55 type logical_kind =
56 | IsPrimitive
57 | IsSymbol
58 | IsAssumption of assumption_object_kind
59 | IsDefinition of definition_object_kind
60 | IsProof of theorem_kind
61
62 (** Data associated to section variables and local definitions *)
63
64 type variable_data = {
65 opaque:bool;
66 kind:logical_kind;
67 }
68
69 let vartab =
70 Summary.ref (Id.Map.empty : (variable_data*DirPath.t) Id.Map.t) ~name:"VARIABLE"
71
72 let secpath () = Lib.current_dirpath true
73 let add_variable_data id o = vartab := Id.Map.add id (o,secpath()) !vartab
74
75 let variable_opacity id = let {opaque},_ = Id.Map.find id !vartab in opaque
76 let variable_kind id = let {kind},_ = Id.Map.find id !vartab in kind
77
78 let variable_secpath id =
79 let _, dir = Id.Map.find id !vartab in
80 make_qualid dir id
81
82 let variable_exists id = Id.Map.mem id !vartab