Debian Codegraph @

vernac/record.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 Vernacexpr
13 open Constrexpr
14 open Structures
15
16 module Data : sig
17 type coercion_flags = {
18 coe_local : bool;
19 coe_reversible : bool;
20 }
21 type instance_flags = {
22 inst_locality : Hints.hint_locality;
23 inst_priority : int option;
24 }
25 type projection_flags = {
26 pf_coercion: coercion_flags option;
27 pf_instance: instance_flags option;
28 pf_canonical: bool;
29 }
30 type t = {
31 is_coercion : Vernacexpr.coercion_flag;
32 proj_flags : projection_flags list;
33 }
34 end
35
36 module Ast : sig
37 type t =
38 { name : Names.lident
39 ; is_coercion : coercion_flag
40 ; binders: local_binder_expr list
41 ; cfs : (local_decl_expr * Data.projection_flags * notation_declaration list) list
42 ; idbuild : lident
43 ; sort : constr_expr option
44 ; default_inhabitant_id : Id.t option
45 }
46 end
47
48 val definition_structure
49 : flags:ComInductive.flags
50 -> cumul_univ_decl_expr option
51 -> inductive_kind
52 -> primitive_proj:bool
53 -> Ast.t list
54 -> GlobRef.t list
55
56 module RecordEntry : sig
57
58 type one_ind_info = {
59 (* inhabitant_id not redundant with the entry in non prim record case *)
60 inhabitant_id : Id.t;
61 default_dep_elim : DeclareInd.default_dep_elim;
62 (* implfs includes the param and principal argument info *)
63 implfs : Impargs.manual_implicits list;
64 fieldlocs : Loc.t option list;
65 }
66
67 type t = {
68 global_univs : Univ.ContextSet.t;
69 ubinders : UState.named_universes_entry;
70 mie : Entries.mutual_inductive_entry;
71 ind_infos : one_ind_info list;
72 param_impls : Impargs.manual_implicits;
73 }
74
75 end
76
77 (** A record is an inductive [mie] with extra metadata *)
78 module Record_decl : sig
79 type t = {
80 entry : RecordEntry.t;
81 records : Data.t list;
82 projections_kind : Decls.definition_object_kind;
83 indlocs : DeclareInd.indlocs;
84 poly : PolyFlags.t
85 }
86 end
87
88 (** Ast.t list at the constr level *)
89 val interp_structure
90 : flags:ComInductive.flags
91 -> cumul_univ_decl_expr option
92 -> inductive_kind
93 -> primitive_proj:bool
94 -> Ast.t list
95 -> Record_decl.t
96
97
98 val declare_existing_class : GlobRef.t -> unit
99
100 val canonical_inhabitant_id : isclass:bool -> Id.t -> Id.t
101
102 (* Implementation internals, consult Rocq developers before using;
103 current user Elpi, see https://github.com/LPCIC/coq-elpi/pull/151 *)
104 module Internal : sig
105 val declare_projections
106 : Names.inductive
107 -> kind:Decls.definition_object_kind
108 -> inhabitant_id:Names.Id.t
109 -> Data.projection_flags list
110 -> ?fieldlocs:Loc.t option list
111 -> Impargs.manual_implicits list
112 -> Structure.projection list
113
114 val declare_structure_entry : Structure.t -> unit
115
116 end