1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
9
(*i $Id: inductive.mli 9420 2006-12-08 15:34:09Z barras $ i*)
18
(*s Extracting an inductive type from a construction *)
20
val find_rectype : env -> constr -> inductive * constr list
22
type mind_specif = mutual_inductive_body * one_inductive_body
24
(*s Fetching information in the environment about an inductive type.
25
Raises [Not_found] if the inductive type is not found. *)
26
val lookup_mind_specif : env -> inductive -> mind_specif
28
val type_of_inductive : env -> mind_specif -> constr
30
(* Return type as quoted by the user *)
31
val type_of_constructor : constructor -> mind_specif -> constr
33
val arities_of_specif : mutual_inductive -> mind_specif -> constr array
35
(* [type_case_branches env (I,args) (p:A) c] computes useful types
36
about the following Cases expression:
37
<p>Cases (c :: (I args)) of b1..bn end
38
It computes the type of every branch (pattern variables are
39
introduced by products) and the type for the whole expression.
41
val type_case_branches :
42
env -> inductive * constr list -> constr * constr -> constr
43
-> constr array * constr
45
(* Check a [case_info] actually correspond to a Case expression on the
46
given inductive type. *)
47
val check_case_info : env -> inductive -> case_info -> unit
49
(*s Guard conditions for fix and cofix-points. *)
50
val check_fix : env -> fixpoint -> unit
51
val check_cofix : env -> cofixpoint -> unit
53
(*s Support for sort-polymorphic inductive types *)
55
val type_of_inductive_knowing_parameters :
56
env -> one_inductive_body -> constr array -> constr
58
val max_inductive_sort : sorts array -> Univ.universe
60
val instantiate_universes : env -> rel_context ->
61
polymorphic_arity -> constr array -> rel_context * sorts
63
(***************************************************************)
66
type size = Large | Strict
68
Subterm of (size * wf_paths)
73
(* dB of last fixpoint *)
75
(* inductive of recarg of each fixpoint *)
76
inds : inductive array;
77
(* the recarg information of inductive family *)
78
recvec : wf_paths array;
79
(* dB of variables denoting subterms *)
80
genv : subterm_spec list;
83
val subterm_specif : guard_env -> constr -> subterm_spec
84
val case_branches_specif : guard_env -> subterm_spec -> inductive ->
85
constr array -> (guard_env * constr) array