Debian Codegraph @

library/libnames.mli

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 open Names
12
13 (** {6 Dirpaths } *)
14 val dirpath_of_string : string -> DirPath.t
15
16 (** Pop the suffix of a [DirPath.t]. Raises a [Failure] for an empty path *)
17 val pop_dirpath : DirPath.t -> DirPath.t
18
19 (** Pop the suffix n times *)
20 val pop_dirpath_n : int -> DirPath.t -> DirPath.t
21
22 (** Immediate prefix and basename of a [DirPath.t]. May raise [Failure] *)
23 val split_dirpath : DirPath.t -> DirPath.t * Id.t
24
25 val add_dirpath_suffix : DirPath.t -> Id.t -> DirPath.t
26
27 val append_dirpath : DirPath.t -> DirPath.t -> DirPath.t
28
29 val drop_dirpath_prefix : DirPath.t -> DirPath.t -> DirPath.t
30 val is_dirpath_prefix_of : DirPath.t -> DirPath.t -> bool
31
32 val is_dirpath_suffix_of : DirPath.t -> DirPath.t -> bool
33
34 (** {6 Full paths are {e absolute} paths of declarations } *)
35 type full_path
36
37 val eq_full_path : full_path -> full_path -> bool
38
39 val compare_full_path : full_path -> full_path -> int
40
41 (** Constructors of [full_path] *)
42 val make_path : DirPath.t -> Id.t -> full_path
43
44 val add_path_suffix : full_path -> Id.t -> full_path
45
46 val append_path : full_path -> DirPath.t -> full_path
47
48 (** Destructors of [full_path] *)
49 val repr_path : full_path -> DirPath.t * Id.t
50
51 (** [path_pop_n_suffixes n p] removes the last [n] elements of [p].
52 Raises [Failure] if [p] is not long enough. *)
53 val path_pop_n_suffixes : int -> full_path -> full_path
54
55 (** [path_pop_suffix p] is [path_pop_n_suffixes 1 p]. *)
56 val path_pop_suffix : full_path -> full_path
57
58 (** The prefix of the path *)
59 val dirpath : full_path -> DirPath.t [@@deprecated "Compose [dirpath_of_path] and [pop_dirpath]"]
60 val basename : full_path -> Id.t
61
62 (** The full path as a [DirPath.t]. *)
63 val dirpath_of_path : full_path -> DirPath.t
64
65 val is_path_prefix_of : full_path -> DirPath.t -> bool
66
67 (** Parsing and printing of section path as ["root.module.id"] *)
68 val path_of_string : string -> full_path
69 val string_of_path : full_path -> string
70 val pr_path : full_path -> Pp.t
71
72 module Spmap : CSig.MapS with type key = full_path
73
74 (** {6 ... } *)
75 (** A [qualid] is a partially qualified ident; it includes fully
76 qualified names (= absolute names) and all intermediate partial
77 qualifications of absolute names, including single identifiers.
78 The [qualid] are used to access the name table. *)
79
80 type qualid_r
81 type qualid = qualid_r CAst.t
82
83 val make_qualid : ?loc:Loc.t -> DirPath.t -> Id.t -> qualid
84 val repr_qualid : qualid -> DirPath.t * Id.t
85
86 val qualid_eq : qualid -> qualid -> bool
87 val is_qualid_suffix_of_full_path : qualid -> full_path -> bool
88
89 val pr_qualid : qualid -> Pp.t
90 val string_of_qualid : qualid -> string
91 val qualid_of_string : ?loc:Loc.t -> string -> qualid
92
93 (** Turns an absolute name, a dirpath, or an Id.t into a
94 qualified name denoting the same name *)
95
96 val qualid_of_path : ?loc:Loc.t -> full_path -> qualid
97 val qualid_of_dirpath : ?loc:Loc.t -> DirPath.t -> qualid
98 val qualid_of_ident : ?loc:Loc.t -> Id.t -> qualid
99 val qualid_of_lident : lident -> qualid
100
101 val qualid_is_ident : qualid -> bool
102 val qualid_path : qualid -> DirPath.t
103 val qualid_basename : qualid -> Id.t
104
105 val idset_mem_qualid : qualid -> Id.Set.t -> bool
106 (** false when the qualid is not an ident *)
107
108 (** {6 ... } *)
109
110 (** This is the root of the rocq-core library *)
111 val rocq_init_root : Id.t (* "Corelib" *)
112 val rocq_init_string : string (* "Corelib" *)
113
114 (** This is the default root prefix for developments which doesn't
115 mention a root *)
116 val default_root_prefix : DirPath.t
117
118 (** For uninitialized data, cf [DirPath.dummy] *)
119 val dummy_full_path : full_path