summaryrefslogtreecommitdiff
path: root/pretyping/indrec.mli
blob: b2375c8f0e048620eb6671970aed1c357aed30bc (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
70
71
72
(************************************************************************)
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011     *)
(*   \VV/  **************************************************************)
(*    //   *      This file is distributed under the terms of the       *)
(*         *       GNU Lesser General Public License Version 2.1        *)
(************************************************************************)

(*i $Id: indrec.mli 14641 2011-11-06 11:59:10Z herbelin $ 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 (*isrec:*) bool * sorts * inductive
  | NotMutualInScheme of inductive * inductive

exception RecursionSchemeError of recursion_scheme_error

(** Eliminations *)

type dep_flag = bool

(* Build a case analysis elimination scheme in some sort family *)

val build_case_analysis_scheme : env -> evar_map -> inductive ->
      dep_flag -> sorts_family -> constr

(* Build a dependent case elimination predicate unless type is in Prop *)

val build_case_analysis_scheme_default : env -> evar_map -> inductive ->
      sorts_family -> constr

(* Builds a recursive induction scheme (Peano-induction style) in the same
   sort family as the inductive family; it is dependent if not in Prop *)

val build_induction_scheme : env -> evar_map -> inductive ->
      dep_flag -> sorts_family -> constr

(* Builds mutual (recursive) induction schemes *)

val build_mutual_induction_scheme :
  env -> evar_map -> (inductive * dep_flag * sorts_family) list -> constr list

(** Scheme combinators *)

(* [modify_sort_scheme s n c] modifies the quantification sort of
   scheme c whose predicate is abstracted at position [n] of [c] *)

val modify_sort_scheme : sorts -> int -> constr -> constr

(* [weaken_sort_scheme s n c t] derives by subtyping from [c:t]
   whose conclusion is quantified on [Type] at position [n] of [t] a
   scheme quantified on sort [s] *)

val weaken_sort_scheme : sorts -> int -> constr -> types -> constr * types

(** Recursor names utilities *)

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

val case_suffix : string