From 2d26151ea656b0f386855ffb519541171855f755 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 23 Sep 2005 12:45:49 +0000 Subject: [PATCH] added support for universes uri ".univ" --- helm/ocaml/urimanager/uriManager.ml | 15 +++++++++++++-- helm/ocaml/urimanager/uriManager.mli | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/helm/ocaml/urimanager/uriManager.ml b/helm/ocaml/urimanager/uriManager.ml index f0bc57958..b4bf073e2 100644 --- a/helm/ocaml/urimanager/uriManager.ml +++ b/helm/ocaml/urimanager/uriManager.ml @@ -81,8 +81,10 @@ exception IllFormedUri of string;; let _dottypes = ".types" let _types = "types",5 -let _ann = "ann",3 +let _dotuniv = ".univ" +let _univ = "univ",4 let _dotann = ".ann" +let _ann = "ann",3 let _var = "var",3 let _dotbody = ".body" let _con = "con",3 @@ -92,6 +94,7 @@ let _con3 = "con" let _var3 = "var" let _ind3 = "ind" let _ann3 = "ann" +let _univ4 = "univ" let _types5 = "types" let _xpointer8 = "xpointer" let _cic5 = "cic:/" @@ -102,9 +105,11 @@ let is_malformed suri = else let len = String.length suri - 5 in let last5 = String.sub suri len 5 in + let last4 = String.sub last5 1 4 in let last3 = String.sub last5 2 3 in if last3 = _con3 || last3 = _var3 || last3 = _ind3 || - last3 = _ann3 || last5 = _types5 || last5 = _dotbody then + last3 = _ann3 || last5 = _types5 || last5 = _dotbody || + last4 = _univ4 then false else try @@ -177,9 +182,15 @@ let bodyuri_of_uri (uri, _) = None ;; +(* these are bugged! + * we should remove _types, _univ, _ann all toghether *) let innertypesuri_of_uri (uri, _) = uri_of_string ((clear_suffix uri _types) ^ _dottypes) ;; +let univgraphuri_of_uri (uri,_) = + uri_of_string ((clear_suffix uri _univ) ^ _dotuniv) +;; + let uri_of_uriref (uri, _) typeno consno = let typeno = typeno + 1 in diff --git a/helm/ocaml/urimanager/uriManager.mli b/helm/ocaml/urimanager/uriManager.mli index 5f0600c7e..8250cc839 100644 --- a/helm/ocaml/urimanager/uriManager.mli +++ b/helm/ocaml/urimanager/uriManager.mli @@ -57,6 +57,8 @@ val bodyuri_of_uri : uri -> uri option (* given an uri, it gives back the uri of its inner types *) val innertypesuri_of_uri : uri -> uri +(* given an uri, it gives back the uri of its univgraph *) +val univgraphuri_of_uri : uri -> uri (* builder for MutInd and MutConstruct URIs * [uri] -> [typeno] -> [consno option] -- 2.39.2