- match obj with
- | CicNotationPt.Inductive (_,(name,_,_,_)::_)
- | CicNotationPt.Record (_,name,_,_) ->
- (match baseuri with
- | Some baseuri ->
- Some (UriManager.uri_of_string (baseuri ^ "/" ^ name ^ ".ind"))
- | None -> raise BaseUriNotSetYet)
- | CicNotationPt.Inductive _ -> assert false
- | CicNotationPt.Theorem _ -> None in
- (*
- (let time = Unix.gettimeofday () in
+ let baseuri =
+ match baseuri with Some x -> x | None -> raise BaseUriNotSetYet
+ in
+ let name =
+ match obj with
+ | CicNotationPt.Inductive (_,(name,_,_,_)::_)
+ | CicNotationPt.Record (_,name,_,_) -> name ^ ".ind"
+ | CicNotationPt.Theorem (_,name,_,_,_) -> name ^ ".con"
+ | CicNotationPt.Inductive _ -> assert false
+ in
+ UriManager.uri_of_string (baseuri ^ "/" ^ name)
+ in
+(*
+ let _try_new cic =
+ (NCicLibrary.clear_cache ();
+ NCicEnvironment.invalidate ();
+ OCic2NCic.clear ();
+ let graph =
+ match cic with
+ | Some (Cic.CurrentProof (_,metasenv, _, ty,_,_)) ->
+ let _, ugraph =
+ CicTypeChecker.type_of_aux' metasenv [] ty CicUniv.empty_ugraph
+ in
+ ugraph
+ | Some (Cic.Constant (_,_, ty,_,_)) ->
+ let _, ugraph =
+ CicTypeChecker.type_of_aux' [] [] ty CicUniv.empty_ugraph
+ in
+ ugraph
+ | _ -> CicUniv.empty_ugraph
+ in
+
+(*
+ prerr_endline "PRIMA COERCIONS";
+ let _,l = CicUniv.do_rank graph in
+ List.iter (fun k ->
+ prerr_endline (CicUniv.string_of_universe k ^ " = " ^ string_of_int
+ (CicUniv.get_rank k))) l;
+*)
+
+ let graph =
+ List.fold_left
+ (fun graph (_,_,l) ->
+ List.fold_left
+ (fun graph (uri,_,_) ->
+ let _,g = CicTypeChecker.typecheck uri in
+ CicUniv.merge_ugraphs ~base_ugraph:graph ~increment:(g,uri))
+ graph l)
+ graph (CoercDb.to_list (CoercDb.dump ()))
+ in
+ ignore(CicUniv.do_rank graph);
+
+
+(*
+ prerr_endline "DOPO COERCIONS";
+ let _,l = CicUniv.do_rank graph in
+ List.iter (fun k ->
+ prerr_endline (CicUniv.string_of_universe k ^ " = " ^ string_of_int
+ (CicUniv.get_rank k))) l;
+*)
+
+