comparison src/elab_err.sig @ 329:eec65c11d3e2

foldTR2
author Adam Chlipala <adamc@hcoop.net>
date Sat, 13 Sep 2008 10:30:45 -0400
parents
children 075b36dbb1a4
comparison
equal deleted inserted replaced
328:58f1260f293f 329:eec65c11d3e2
1 (* Copyright (c) 2008, Adam Chlipala
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * - Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * - Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12 * - The names of contributors may not be used to endorse or promote products
13 * derived from this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
26 *)
27
28 signature ELAB_ERR = sig
29
30 datatype kunify_error =
31 KOccursCheckFailed of Elab.kind * Elab.kind
32 | KIncompatible of Elab.kind * Elab.kind
33
34 val kunifyError : kunify_error -> unit
35
36 datatype con_error =
37 UnboundCon of ErrorMsg.span * string
38 | UnboundDatatype of ErrorMsg.span * string
39 | UnboundStrInCon of ErrorMsg.span * string
40 | WrongKind of Elab.con * Elab.kind * Elab.kind * kunify_error
41 | DuplicateField of ErrorMsg.span * string
42 | ProjBounds of Elab.con * int
43 | ProjMismatch of Elab.con * Elab.kind
44
45 val conError : ElabEnv.env -> con_error -> unit
46
47 datatype cunify_error =
48 CKind of Elab.kind * Elab.kind * kunify_error
49 | COccursCheckFailed of Elab.con * Elab.con
50 | CIncompatible of Elab.con * Elab.con
51 | CExplicitness of Elab.con * Elab.con
52 | CKindof of Elab.kind * Elab.con
53 | CRecordFailure of Elab.con * Elab.con
54
55 val cunifyError : ElabEnv.env -> cunify_error -> unit
56
57 datatype exp_error =
58 UnboundExp of ErrorMsg.span * string
59 | UnboundStrInExp of ErrorMsg.span * string
60 | Unify of Elab.exp * Elab.con * Elab.con * cunify_error
61 | Unif of string * Elab.con
62 | WrongForm of string * Elab.exp * Elab.con
63 | IncompatibleCons of Elab.con * Elab.con
64 | DuplicatePatternVariable of ErrorMsg.span * string
65 | PatUnify of Elab.pat * Elab.con * Elab.con * cunify_error
66 | UnboundConstructor of ErrorMsg.span * string list * string
67 | PatHasArg of ErrorMsg.span
68 | PatHasNoArg of ErrorMsg.span
69 | Inexhaustive of ErrorMsg.span
70 | DuplicatePatField of ErrorMsg.span * string
71 | Unresolvable of ErrorMsg.span * Elab.con
72 | OutOfContext of ErrorMsg.span * (Elab.exp * Elab.con) option
73 | IllegalRec of string * Elab.exp
74
75 val expError : ElabEnv.env -> exp_error -> unit
76
77 datatype decl_error =
78 KunifsRemain of Elab.decl list
79 | CunifsRemain of Elab.decl list
80 | Nonpositive of Elab.decl
81
82 val declError : ElabEnv.env -> decl_error -> unit
83
84 datatype sgn_error =
85 UnboundSgn of ErrorMsg.span * string
86 | UnmatchedSgi of Elab.sgn_item
87 | SgiWrongKind of Elab.sgn_item * Elab.kind * Elab.sgn_item * Elab.kind * kunify_error
88 | SgiWrongCon of Elab.sgn_item * Elab.con * Elab.sgn_item * Elab.con * cunify_error
89 | SgiMismatchedDatatypes of Elab.sgn_item * Elab.sgn_item * (Elab.con * Elab.con * cunify_error) option
90 | SgnWrongForm of Elab.sgn * Elab.sgn
91 | UnWhereable of Elab.sgn * string
92 | WhereWrongKind of Elab.kind * Elab.kind * kunify_error
93 | NotIncludable of Elab.sgn
94 | DuplicateCon of ErrorMsg.span * string
95 | DuplicateVal of ErrorMsg.span * string
96 | DuplicateSgn of ErrorMsg.span * string
97 | DuplicateStr of ErrorMsg.span * string
98 | NotConstraintsable of Elab.sgn
99
100 val sgnError : ElabEnv.env -> sgn_error -> unit
101
102 datatype str_error =
103 UnboundStr of ErrorMsg.span * string
104 | NotFunctor of Elab.sgn
105 | FunctorRebind of ErrorMsg.span
106 | UnOpenable of Elab.sgn
107 | NotType of Elab.kind * (Elab.kind * Elab.kind * kunify_error)
108 | DuplicateConstructor of string * ErrorMsg.span
109 | NotDatatype of ErrorMsg.span
110
111 val strError : ElabEnv.env -> str_error -> unit
112
113 end