-module SetOfStrings = Map.Make(OrderedStrings);;
-
-(*CSC: commento obsoleto ed errato *)
-(* Invariant: the map is the identity function, *)
-(* i.e. (SetOfStrings.find str !set_of_uri) == str *)
-let set_of_uri = ref SetOfStrings.empty;;
-let set_of_prefixes = ref SetOfStrings.empty;;
-
-(* similar to uri_of_string, but used for prefixes of uris *)
-let normalize prefix =
- try
- SetOfStrings.find prefix !set_of_prefixes
- with
- Not_found ->
- set_of_prefixes := SetOfStrings.add prefix prefix !set_of_prefixes ;
- prefix
-;;
+module MapStringsToUri = Map.Make(OrderedStrings);;
+
+(* Invariant: the map is the identity function,
+ * i.e.
+ * let str' = (MapStringsToUri.find str !set_of_uri) in
+ * str' == (MapStringsToUri.find str' !set_of_uri)
+ *)
+let set_of_uri = ref MapStringsToUri.empty;;
+
+(* hash conses an uri *)
+let uri_of_string suri =
+ try
+ MapStringsToUri.find suri !set_of_uri
+ with Not_found ->
+ let new_uri = suri, fresh_id () in
+ set_of_uri := MapStringsToUri.add suri new_uri !set_of_uri;
+ new_uri