X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_cache%2FcicCache.ml;h=b4ae4fbec3261fe31109778e2896f17fe10fc77f;hb=3bb4ce11fb9d4c6375483a80344beb94c4517dd7;hp=7dfd8242d1ff724f06d75ce0a5fdf35b89df0cc2;hpb=5a92117eeff70048d29e91ba24e113155d956e1b;p=helm.git diff --git a/helm/ocaml/cic_cache/cicCache.ml b/helm/ocaml/cic_cache/cicCache.ml index 7dfd8242d..b4ae4fbec 100644 --- a/helm/ocaml/cic_cache/cicCache.ml +++ b/helm/ocaml/cic_cache/cicCache.ml @@ -36,14 +36,52 @@ (******************************************************************************) let get_annobj uri = - let module G = Getter in let module U = UriManager in - let cicfilename = G.getxml (U.cicuri_of_uri uri) in - match CicParser.term_of_xml cicfilename uri false with - (_, Some _) -> assert false - | (annobj, None) -> annobj + let cicfilename = Http_getter.getxml' (U.cicuri_of_uri uri) in + match (U.bodyuri_of_uri uri) with + None -> + let annobj = CicParser.annobj_of_xml cicfilename None in + Unix.unlink cicfilename ; + annobj + | Some bodyuri -> + let cicbodyfilename = + try + ignore (Http_getter.resolve' bodyuri) ; + (* The body exists ==> it is not an axiom *) + Some (Http_getter.getxml' bodyuri) + with + Http_getter_types.Unresolvable_URI _ -> + (* The body does not exist ==> we consider it an axiom *) + None + in + let annobj = + CicParser.annobj_of_xml cicfilename cicbodyfilename + in + Unix.unlink cicfilename ; + (match cicbodyfilename with None -> () | Some f -> Unix.unlink f) ; + annobj ;; let get_obj uri = - Deannotate.deannotate_obj (get_annobj uri) + let module U = UriManager in + let cicfilename = Http_getter.getxml' (U.cicuri_of_uri uri) in + match (U.bodyuri_of_uri uri) with + None -> + let obj = CicParser.obj_of_xml cicfilename None in + Unix.unlink cicfilename ; + obj + | Some bodyuri -> + let cicbodyfilename = + try + ignore (Http_getter.resolve' bodyuri) ; + (* The body exists ==> it is not an axiom *) + Some (Http_getter.getxml' bodyuri) + with Http_getter_types.Unresolvable_URI _ -> + (* The body does not exist ==> we consider it an axiom *) + None + in + let obj = CicParser.obj_of_xml cicfilename cicbodyfilename in + Unix.unlink cicfilename ; + (match cicbodyfilename with None -> () | Some f -> Unix.unlink f) ; + obj ;;