aboutsummaryrefslogtreecommitdiff
path: root/kernel/type_errors.mli
blob: 3a3e1488e0fd3ffaaa462c7b5f51ec24d28a84f9 (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
73
(* $Id$ *)

(*i*)
open Pp
open Names
open Term
open Sign
open Environ
(*i*)

(* Type errors. *)

type type_error =
  | UnboundRel of int
  | CantExecute of constr
  | NotAType of constr
  | BadAssumption of constr
  | ReferenceVariables of identifier
  | ElimArity of constr * constr list * constr * constr * constr
      * (constr * constr * string) option
  | CaseNotInductive of constr * constr
  | NumberBranches of constr * constr * int
  | IllFormedBranch of constr * int * constr * constr
  | Generalization of (name * typed_type) * constr
  | ActualType of constr * constr * constr
  | CantAply of string * unsafe_judgment * unsafe_judgment list
  | IllFormedRecBody of std_ppcmds * name list * int * constr array
  | IllTypedRecBody of int * name list * unsafe_judgment array 
      * typed_type array

exception TypeError of path_kind * context * type_error

val error_unbound_rel : path_kind -> 'a unsafe_env -> int -> 'b

val error_cant_execute : path_kind -> 'a unsafe_env -> constr -> 'b

val error_not_type : path_kind -> 'a unsafe_env -> constr -> 'b

val error_assumption : path_kind -> 'a unsafe_env -> constr -> 'b
 
val error_reference_variables : path_kind -> 'a unsafe_env -> identifier -> 'b

val error_elim_arity : 
  path_kind -> 'a unsafe_env -> constr -> constr list -> constr 
    -> constr -> constr -> (constr * constr * string) option -> 'b

val error_case_not_inductive : 
  path_kind -> 'a unsafe_env -> constr -> constr -> 'b

val error_number_branches : 
  path_kind -> 'a unsafe_env -> constr -> constr -> int -> 'b

val error_ill_formed_branch :
  path_kind -> 'a unsafe_env -> constr -> int -> constr -> constr -> 'b

val error_generalization :
  path_kind -> 'a unsafe_env -> name * typed_type -> constr -> 'b

val error_actual_type :
  path_kind -> 'a unsafe_env -> constr -> constr -> constr -> 'b

val error_cant_apply : 
  path_kind -> 'a unsafe_env -> string -> unsafe_judgment 
    -> unsafe_judgment list -> 'b

val error_ill_formed_rec_body :
  path_kind -> 'a unsafe_env -> std_ppcmds
    -> name list -> int -> constr array -> 'b

val error_ill_typed_rec_body  :
  path_kind -> 'a unsafe_env -> int -> name list -> unsafe_judgment array 
    -> typed_type array -> 'b