Debian Codegraph @

vernac/comInductive.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 Vernacexpr
12 open Constrexpr
13
14 (** {6 Inductive and coinductive types} *)
15
16 type flags = {
17 poly : PolyFlags.t;
18 template : bool option;
19 finite : Declarations.recursivity_kind;
20 mode : Hints.hint_mode list option;
21 schemes : DeclareInd.declare_schemes;
22 }
23
24 (** Entry points for the vernacular commands Inductive and CoInductive *)
25
26 type uniform_inductive_flag =
27 | UniformParameters
28 | NonUniformParameters
29
30 val do_mutual_inductive
31 : flags:flags
32 -> ?typing_flags:Declarations.typing_flags
33 -> cumul_univ_decl_expr option
34 -> (one_inductive_expr * notation_declaration list) list
35 -> private_ind:bool
36 -> uniform:uniform_inductive_flag
37 -> unit
38
39 (** User-interface API *)
40
41 (** Prepare a "match" template for a given inductive type.
42 For each branch of the match, we list the constructor name
43 followed by enough pattern variables.
44 [Not_found] is raised if the given string isn't the qualid of
45 a known inductive type. *)
46
47 val make_cases : Names.inductive -> string list list
48
49 module Mind_decl : sig
50
51 (** inductive_expr at the constr level *)
52 type t = {
53 mie : Entries.mutual_inductive_entry;
54 default_dep_elim : DeclareInd.default_dep_elim list;
55 nuparams : int option;
56 univ_binders : UState.named_universes_entry;
57 implicits : DeclareInd.one_inductive_impls list;
58 uctx : Univ.ContextSet.t;
59 where_notations : Metasyntax.notation_interpretation_decl list;
60 coercions : Libnames.qualid list;
61 indlocs : DeclareInd.indlocs;
62 }
63
64 end
65
66 (** elaborates an inductive declaration (the first half of do_mutual_inductive) *)
67 val interp_mutual_inductive
68 : env:Environ.env
69 -> flags:flags
70 -> ?typing_flags:Declarations.typing_flags
71 -> cumul_univ_decl_expr option
72 -> (one_inductive_expr * notation_declaration list) list
73 -> private_ind:bool
74 -> uniform:uniform_inductive_flag
75 -> Mind_decl.t
76
77 type syntax_allows_template_poly = SyntaxAllowsTemplatePoly | SyntaxNoTemplatePoly
78
79 (** the post-elaboration part of interp_mutual_inductive, mainly dealing with
80 universe levels *)
81 val interp_mutual_inductive_constr
82 : sigma:Evd.evar_map
83 -> flags:flags
84 -> udecl:UState.universe_decl
85 -> variances:Entries.variance_entry
86 -> ctx_params:EConstr.rel_context
87 -> indnames:Names.Id.t list
88 -> arities_explicit:bool list
89 -> arities:EConstr.t list
90 -> template_syntax:syntax_allows_template_poly list
91 -> constructors:(Names.Id.t list * EConstr.constr list) list
92 (** Names and types of constructors, not including parameters (as in kernel entries) *)
93 -> env_ar:Environ.env
94 (** Environment with the inductives in the rel_context *)
95 -> private_ind:bool
96 -> DeclareInd.default_dep_elim list
97 * Entries.mutual_inductive_entry
98 * (* for global universe names, used by DeclareInd *)
99 UState.named_universes_entry
100 * (* global universes to declare before the inductive (ie without the template univs) *)
101 Univ.ContextSet.t
102
103 (************************************************************************)
104 (** Internal API, exported for Record *)
105 (************************************************************************)
106
107 val maybe_unify_params_in : Environ.env -> Evd.evar_map -> ninds:int -> nparams:int -> binders:int
108 -> EConstr.t -> Evd.evar_map
109 (** [nparams] is the number of parameters which aren't treated as
110 uniform, ie the length of params (including letins) where the env
111 is [uniform params, inductives, params, binders]. *)
112
113 val variance_of_entry
114 : cumulative:bool
115 -> variances:Entries.variance_entry
116 -> Entries.inductive_universes_entry
117 -> Entries.variance_entry option
118 (** Will return None if non-cumulative, and resize if there are more
119 universes than originally specified.
120 If monomorphic, [cumulative] is treated as [false].
121 *)
122
123 module Internal :
124 sig
125 val error_differing_params
126 : kind:string
127 -> (Names.lident * Vernacexpr.inductive_params_expr)
128 -> (Names.lident * Vernacexpr.inductive_params_expr)
129 -> 'a
130 end