]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_proof_checking/cicTypeChecker.mli
test branch
[helm.git] / helm / ocaml / cic_proof_checking / cicTypeChecker.mli
1 (* Copyright (C) 2000, HELM Team.
2  * 
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  * 
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * 
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://cs.unibo.it/helm/.
24  *)
25
26 (* These are the only exceptions that will be raised *)
27 exception TypeCheckerFailure of string Lazy.t
28 exception AssertFailure of string Lazy.t
29
30 (* this function is exported to be used also by the refiner;
31    the callback function (defaul value: ignore) is invoked on each
32    processed subterm; its first argument is the undebrujined term (the
33    input); its second argument the corresponding debrujined term (the
34    output). The callback is used to relocalize the error messages *)
35 val debrujin_constructor :
36  ?cb:(Cic.term -> Cic.term -> unit) ->
37   UriManager.uri -> int -> Cic.term -> Cic.term
38
39 val typecheck : UriManager.uri -> Cic.obj * CicUniv.universe_graph
40
41 (* FUNCTIONS USED ONLY IN THE TOPLEVEL *)
42
43 (* type_of_aux' metasenv context term *)
44 val type_of_aux':
45   ?subst:Cic.substitution -> Cic.metasenv -> Cic.context -> 
46   Cic.term -> CicUniv.universe_graph -> 
47   Cic.term * CicUniv.universe_graph
48
49 (* typechecks the obj and puts it in the environment *)
50 val typecheck_obj : UriManager.uri -> Cic.obj -> unit
51
52 (* check_allowed_sort_elimination uri i s1 s2
53    This function is used outside the kernel to determine in advance whether
54    a MutCase will be allowed or not.
55    [uri,i] is the type of the term to match
56    [s1] is the sort of the term to eliminate (i.e. the head of the arity
57         of the inductive type [uri,i])
58    [s2] is the sort of the goal (i.e. the head of the type of the outtype
59         of the MutCase) *)
60 val check_allowed_sort_elimination:
61  UriManager.uri -> int -> Cic.sort -> Cic.sort -> bool