]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_annotations/cicXPath.ml
This commit was manufactured by cvs2svn to create branch 'init'.
[helm.git] / helm / ocaml / cic_annotations / cicXPath.ml
diff --git a/helm/ocaml/cic_annotations/cicXPath.ml b/helm/ocaml/cic_annotations/cicXPath.ml
deleted file mode 100644 (file)
index f2cb0ed..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-(* Copyright (C) 2000, HELM Team.
- * 
- * This file is part of HELM, an Hypertextual, Electronic
- * Library of Mathematics, developed at the Computer Science
- * Department, University of Bologna, Italy.
- * 
- * HELM is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * HELM is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HELM; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA  02111-1307, USA.
- * 
- * For details, see the HELM World-Wide-Web page,
- * http://cs.unibo.it/helm/.
- *)
-
-(******************************************************************************)
-(*                                                                            *)
-(*                               PROJECT HELM                                 *)
-(*                                                                            *)
-(*                Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>               *)
-(*                                 14/06/2000                                 *)
-(*                                                                            *)
-(*                                                                            *)
-(******************************************************************************)
-
-let get_annotation ids_to_annotations xpath =
- try
-  Some (Hashtbl.find ids_to_annotations xpath)
- with
-  Not_found -> None
-;;
-
-exception MoreThanOneTargetFor of Cic.id;;
-
-(* creates a hashtable mapping each unique id to a node of the annotated 
-object *)
-let get_ids_to_targets annobj =
- let module C = Cic in
-  let ids_to_targets = Hashtbl.create 503 in
-   let set_target id target =
-    try
-     ignore (Hashtbl.find ids_to_targets id) ;
-     raise (MoreThanOneTargetFor id)
-    with
-     Not_found -> Hashtbl.add ids_to_targets id target
-   in
-    let rec add_target_term t =
-     match t with
-        C.ARel (id,_,_)
-      | C.AVar (id,_)
-      | C.AMeta (id,_,_)
-      | C.ASort (id,_)
-      | C.AImplicit id ->
-         set_target id (C.Term t)
-      | C.ACast (id,va,ty) ->
-         set_target id (C.Term t) ;
-         add_target_term va ;
-         add_target_term ty
-      | C.AProd (id,_,so,ta)
-      | C.ALambda (id,_,so,ta)
-      | C.ALetIn (id,_,so,ta) ->
-         set_target id (C.Term t) ;
-         add_target_term so ;
-         add_target_term ta
-      | C.AAppl (id,l) ->
-         set_target id (C.Term t) ;
-         List.iter add_target_term l
-      | C.AConst (id,_,_)
-      | C.AMutInd (id,_,_,_)
-      | C.AMutConstruct (id,_,_,_,_) ->
-         set_target id (C.Term t)
-      | C.AMutCase (id,_,_,_,ot,it,pl) ->
-         set_target id (C.Term t) ;
-         List.iter add_target_term (ot::it::pl)
-      | C.AFix (id,_,ifl) ->
-         set_target id (C.Term t) ;
-         List.iter
-          (function (_,_,ty,bo) ->
-            add_target_term ty ;
-            add_target_term bo
-          ) ifl
-      | C.ACoFix (id,_,cfl) ->
-         set_target id (C.Term t) ;
-         List.iter
-          (function (_,ty,bo) ->
-            add_target_term ty ;
-            add_target_term bo
-          ) cfl
-    in
-     let add_target_obj annobj =
-      match annobj with
-        C.ADefinition (id,_,bo,ty,_) ->
-         set_target id (C.Object annobj) ;
-         add_target_term bo ;
-         add_target_term ty
-      | C.AAxiom (id,_,ty,_) ->
-         set_target id (C.Object annobj) ;
-         add_target_term ty
-      | C.AVariable (id,_,None,ty) ->
-         set_target id (C.Object annobj) ;
-         add_target_term ty
-      | C.AVariable (id,_,Some bo,ty) ->
-         set_target id (C.Object annobj) ;
-         add_target_term bo ;
-         add_target_term ty
-      | C.ACurrentProof (id,_,cl,bo,ty) ->
-         set_target id (C.Object annobj) ;
-         List.iter (function (cid,_,context, t) as annconj ->
-           set_target cid (C.Conjecture annconj) ;
-          List.iter 
-            (function ((hid,h) as annhyp) ->
-               set_target hid (C.Hypothesis annhyp) ;
-               match h with
-                 Some (_,C.ADecl at) -> add_target_term at
-               | Some (_,C.ADef at) -> add_target_term at
-               | None -> ()
-            ) context;
-          add_target_term t) cl ;
-         add_target_term bo ;
-         add_target_term ty
-      | C.AInductiveDefinition (id,itl,_,_) ->
-         set_target id (C.Object annobj) ;
-         List.iter
-          (function (_,_,arity,cl) ->
-            add_target_term arity ;
-            List.iter (function (_,ty,_) -> add_target_term ty) cl
-          ) itl
-     in
-      add_target_obj annobj ;
-      ids_to_targets
-;;