Debian Codegraph @

plugins/extraction/common.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 open Miniml
13
14 (** By default, in module Format, you can do horizontal placing of blocks
15 even if they include newlines, as long as the number of chars in the
16 blocks are less that a line length. To avoid this awkward situation,
17 we attach a big virtual size to [fnl] newlines. *)
18
19 val fnl : unit -> Pp.t
20 val fnl2 : unit -> Pp.t
21 val space_if : bool -> Pp.t
22
23 val pp_par : bool -> Pp.t -> Pp.t
24
25 (** [pp_apply] : a head part applied to arguments, possibly with parenthesis *)
26 val pp_apply : Pp.t -> bool -> Pp.t list -> Pp.t
27
28 (** Same as [pp_apply], but with also protection of the head by parenthesis *)
29 val pp_apply2 : Pp.t -> bool -> Pp.t list -> Pp.t
30
31 val pp_tuple_light : (bool -> 'a -> Pp.t) -> 'a list -> Pp.t
32 val pp_tuple : ('a -> Pp.t) -> 'a list -> Pp.t
33 val pp_array : ('a -> Pp.t) -> 'a list -> Pp.t
34 val pp_boxed_tuple : ('a -> Pp.t) -> 'a list -> Pp.t
35
36 val pr_binding : Id.t list -> Pp.t
37
38 val rename_id : Id.t -> Id.Set.t -> Id.t
39
40 type phase = Pre | Impl | Intf
41
42 module State :
43 sig
44 type t
45 val make : modular:bool -> library:bool -> keywords:Id.Set.t -> unit -> t
46
47 (** Getters *)
48
49 val get_table : t -> Table.t
50 val get_modular : t -> bool
51 val get_library : t -> bool
52 val get_keywords : t -> Id.Set.t
53 val get_phase : t -> phase
54 val get_duplicate : t -> ModPath.t -> Id.t -> string option
55
56 (** Setters *)
57 val set_phase : t -> phase -> t
58
59 (** Reader-like *)
60
61 val with_visibility : t -> ModPath.t -> MBId.t list -> (t -> 'a) -> 'a
62 (* the [module_path list] corresponds to module parameters, the innermost one
63 coming first in the list *)
64
65 val get_top_visible_mp : t -> ModPath.t
66
67 (** Cleanup *)
68
69 val reset : t -> unit
70
71 end
72
73 type env = Id.t list * Id.Set.t
74 val empty_env : State.t -> unit -> env
75
76 val rename_vars: Id.Set.t -> Id.t list -> env
77 val rename_tvars: Id.Set.t -> Id.t list -> Id.t list
78 val push_vars : Id.t list -> env -> Id.t list * env
79 val get_db_name : int -> env -> Id.t
80
81 val opened_libraries : State.t -> DirPath.Set.t
82
83 type kind = Term | Type | Cons | Mod
84
85 val pp_global_with_key : State.t -> kind -> KerName.t -> global -> string
86 val pp_global : State.t -> kind -> global -> string
87 val pp_global_name : State.t -> kind -> global -> string
88 val pp_module : State.t -> ModPath.t -> string
89
90 (* val clear_mpfiles_content : unit -> unit *)
91
92 (** Special hack for constants of type Ascii.ascii : if an
93 [Extract Inductive ascii => char] has been declared, then
94 the constants are directly turned into chars *)
95
96 val is_native_char : ml_ast -> bool
97 val get_native_char : ml_ast -> char
98 val pp_native_char : ml_ast -> Pp.t
99
100 (** Special hack for constants of type String.string : if an
101 [Extract Inductive string => string] has been declared, then
102 the constants are directly turned into string literals *)
103
104 val is_native_string : ml_ast -> bool
105 val get_native_string : ml_ast -> string
106 val pp_native_string : ml_ast -> Pp.t
107
108 (* Registered sig type *)
109 val sig_type_name : string