]> matita.cs.unibo.it Git - helm.git/blob - components/cic_proof_checking/cicTypeChecker.mli
tagged 0.5.0-rc1
[helm.git] / components / 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  ?check_exp_named_subst: bool ->
38   UriManager.uri -> int -> Cic.context -> Cic.term -> Cic.term
39
40 val typecheck : UriManager.uri -> Cic.obj * CicUniv.universe_graph
41
42 (* FUNCTIONS USED ONLY IN THE TOPLEVEL *)
43
44 (* type_of_aux' metasenv context term *)
45 val type_of_aux':
46   ?subst:Cic.substitution -> Cic.metasenv -> Cic.context -> 
47   Cic.term -> CicUniv.universe_graph -> 
48   Cic.term * CicUniv.universe_graph
49
50 (* typechecks the obj and puts it in the environment
51  * empty universes are filed with the given uri, thus you should
52  * get the object again after calling this *)
53 val typecheck_obj : UriManager.uri -> Cic.obj -> unit
54
55 (* check_allowed_sort_elimination uri i s1 s2
56    This function is used outside the kernel to determine in advance whether
57    a MutCase will be allowed or not.
58    [uri,i] is the type of the term to match
59    [s1] is the sort of the term to eliminate (i.e. the head of the arity
60         of the inductive type [uri,i])
61    [s2] is the sort of the goal (i.e. the head of the type of the outtype
62         of the MutCase) *)
63 val check_allowed_sort_elimination:
64  UriManager.uri -> int -> Cic.sort -> Cic.sort -> bool
65
66 (* does_not_occur ~subst context n nn t
67    checks if the semi-open interval of Rels (n,nn] occurs in t *)
68 val does_not_occur:
69  ?subst:Cic.substitution -> Cic.context -> int -> int -> Cic.term -> bool