type term_info =
{ sort: (Cic.id, Ast.sort_kind) Hashtbl.t;
- uri: (Cic.id, string) Hashtbl.t;
+ uri: (Cic.id, UriManager.uri) Hashtbl.t;
}
let get_types uri =
let aux = function
| Cic.ARel (id,_,_,b) -> idref id (Ast.Ident (b, None))
| Cic.AVar (id,uri,substs) ->
- register_uri id (UriManager.string_of_uri uri);
+ register_uri id uri;
idref id (Ast.Ident (UriManager.name_of_uri uri, aux_substs substs))
| Cic.AMeta (id,n,l) -> idref id (Ast.Meta (n, aux_context l))
| Cic.ASort (id,Cic.Prop) -> idref id (Ast.Sort `Prop)
k s, k t))
| Cic.AAppl (aid,args) -> idref aid (Ast.Appl (List.map k args))
| Cic.AConst (id,uri,substs) ->
- register_uri id (UriManager.string_of_uri uri);
+ register_uri id uri;
idref id (Ast.Ident (UriManager.name_of_uri uri, aux_substs substs))
| Cic.AMutInd (id,uri,i,substs) as t ->
let name = name_of_inductive_type uri i in
let uri_str = UriManager.string_of_uri uri in
let puri_str = sprintf "%s#xpointer(1/%d)" uri_str (i+1) in
- register_uri id puri_str;
+ register_uri id (UriManager.uri_of_string puri_str);
idref id (Ast.Ident (name, aux_substs substs))
| Cic.AMutConstruct (id,uri,i,j,substs) ->
let name = constructor_of_inductive_type uri i j in
let uri_str = UriManager.string_of_uri uri in
let puri_str = sprintf "%s#xpointer(1/%d/%d)" uri_str (i + 1) j in
- register_uri id puri_str;
+ register_uri id (UriManager.uri_of_string puri_str);
idref id (Ast.Ident (name, aux_substs substs))
| Cic.AMutCase (id,uri,typeno,ty,te,patterns) ->
let name = name_of_inductive_type uri typeno in
let idref = CicUtil.id_of_annterm annterm in
(try
register_uri idref
- (UriManager.string_of_uri
- (CicUtil.uri_of_term (Deannotate.deannotate_term annterm)))
+ (CicUtil.uri_of_term (Deannotate.deannotate_term annterm))
with Invalid_argument _ -> ());
idref)
ctors
(Cic.id, CicNotationPt.sort_kind) Hashtbl.t -> (* id -> sort *)
Cic.annterm -> (* acic *)
CicNotationPt.term (* ast *)
- * (Cic.id, string) Hashtbl.t (* id -> uri *)
- (* TODO change the type of id->uri table to (Cic.id, UriManager.uri) tbl *)
+ * (Cic.id, UriManager.uri) Hashtbl.t (* id -> uri *)
(** level 2 -> level 1 *)
val pp_ast: CicNotationPt.term -> CicNotationPt.term