aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping/indrec.mli
blob: f0f7747cb65b3ba08bc550e5b33e2c1e94c12868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(*i $Id$ i*)

(*i*)
open Names
open Term
open Declarations
open Inductiveops
open Environ
open Evd
(*i*)

(* Errors related to recursors building *)

type recursion_scheme_error =
  | NotAllowedCaseAnalysis of bool * sorts * inductive
  | BadInduction of bool * identifier * sorts
  | NotMutualInScheme

exception RecursionSchemeError of recursion_scheme_error

(** Eliminations *)

(* These functions build elimination predicate for Case tactic *)

val make_case_dep : env -> evar_map -> inductive -> sorts_family -> constr
val make_case_nodep : env -> evar_map -> inductive -> sorts_family -> constr
val make_case_gen : env -> evar_map -> inductive -> sorts_family -> constr

(* This builds an elimination scheme associated (using the own arity
   of the inductive) *)

val build_indrec : env -> evar_map -> inductive -> constr
val instantiate_indrec_scheme : sorts -> int -> constr -> constr
val instantiate_type_indrec_scheme : sorts -> int -> constr -> types ->
  constr * types

(** Complex recursion schemes [Scheme] *)

val build_mutual_indrec : 
  env -> evar_map ->
    (inductive * mutual_inductive_body * one_inductive_body
    * bool * sorts_family) list
    -> constr list

(** Old Case/Match typing *)

val type_rec_branches : bool -> env -> evar_map -> inductive_type
  -> constr -> constr -> constr array * constr
val make_rec_branch_arg : 
  env -> evar_map ->
    int * ('b * constr) option array * int ->
    constr -> constructor_summary -> wf_paths list -> constr

(** Recursor names utilities *)

val lookup_eliminator : inductive -> sorts_family -> constr
val elimination_suffix : sorts_family -> string
val make_elimination_ident : identifier -> sorts_family -> identifier