]> matita.cs.unibo.it Git - helm.git/blob - components/cic/cicUtil.mli
tagged 0.5.0-rc1
[helm.git] / components / cic / cicUtil.mli
1 (* Copyright (C) 2004, 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://helm.cs.unibo.it/
24  *)
25
26 exception Meta_not_found of int
27 exception Subst_not_found of int
28
29 val lookup_meta: int -> Cic.metasenv -> Cic.conjecture
30 val lookup_subst: int -> Cic.substitution -> Cic.context * Cic.term * Cic.term
31 val exists_meta: int -> Cic.metasenv -> bool
32 val clean_up_local_context :
33   Cic.substitution -> Cic.metasenv -> int -> (Cic.term option) list 
34   -> (Cic.term option) list
35
36 val is_closed : Cic.term -> bool
37 val is_meta_closed : Cic.term -> bool
38 val metas_of_term : Cic.term -> (int * Cic.term option list) list
39 (* as before but with no duplicates. may avoind some stack overflows *)
40 val metas_of_term_set : Cic.term -> (int * Cic.term option list) list
41
42   (** @raise Failure "not enough prods" *)
43 val strip_prods: int -> Cic.term -> Cic.term
44
45 (** conversions between terms which are fully representable as uris (Var, Const,
46  * Mutind, and MutConstruct) and corresponding tree representations *)
47 val term_of_uri: UriManager.uri -> Cic.term (** @raise UriManager.IllFormedUri *)
48 val uri_of_term: Cic.term -> UriManager.uri (** @raise Invalid_argument "uri_of_term" *)
49
50 val id_of_annterm: Cic.annterm -> Cic.id
51
52 (** {2 Cic selectors} *)
53
54 val params_of_obj: Cic.obj -> UriManager.uri list
55 val attributes_of_obj: Cic.obj -> Cic.attribute list
56 val projections_of_record: Cic.obj -> UriManager.uri -> UriManager.uri list
57 val arity_of_composed_coercion: Cic.obj -> int
58 val is_generated: Cic.obj -> bool
59
60 (** mk_rels [howmany] [from] 
61  * creates a list of [howmany] rels starting from [from] in decreasing order *)
62 val mk_rels : int -> int -> Cic.term list
63
64 (** {2 Uri hash consing} *)
65 val rehash_term: Cic.term -> Cic.term
66 val rehash_obj: Cic.obj -> Cic.obj
67
68 val alpha_equivalence: Cic.term -> Cic.term -> bool
69
70 (* FG: Consistency Check 
71  * detects applications without arguments
72  *)
73 val is_sober: Cic.term -> bool