<key name="input_path">/projects/helm/exportation/CoRN</key>
<key name="output_path">$(transcript.helm_dir)/matita/contribs/CoRN-Decl</key>
<key name="script_type">.v</key>
- <key name="coercion">Z_of_nat cic:/Coq/ZArith/BinInt</key>
+ <key name="coercion">Z_of_nat cic:/Coq/ZArith/BinInt/Z_of_nat.con</key>
+ <key name="coercion">Zpos cic:/Coq/ZArith/BinInt/Z.ind#xpointer(1/1/2)</key>
+ <key name="coercion">nat_of_P cic:/Coq/NArith/BinPos/nat_of_P.con</key>
</section>
</helm_registry>
end
| T.Coercion (b, obj) ->
let str = get_coercion st obj in
- let base_uri =
- if str <> "" then str else
- if b then out_base_uri else in_base_uri
- in
+ if str <> "" then path, Some (T.Coercion (b, str)) else
+ let base_uri = if b then out_base_uri else in_base_uri in
let s = obj ^ G.string_of_inline_kind T.Con in
path, Some (T.Coercion (b, Filename.concat base_uri s))
| T.Section (b, id, _) as item ->
RefinementTool.pack_coercion_obj = CicRefine.pack_coercion_obj;
}
-let eval_coercion status ~add_composites uri arity =
+let eval_coercion status ~add_composites uri arity baseuri =
let status,compounds =
GrafiteSync.add_coercion ~add_composites refinement_toolkit status uri arity
+ baseuri
in
let moo_content =
List.map (coercion_moo_statement_of arity) (uri::compounds)
status,[]
| GrafiteAst.Coercion (loc, uri, add_composites, arity) ->
eval_coercion status ~add_composites uri arity
+ (GrafiteTypes.get_string_option status "baseuri")
| GrafiteAst.Default (loc, what, uris) as cmd ->
LibraryObjects.set_default what uris;
GrafiteTypes.add_moo_content [cmd] status,[]
GrafiteTypes.universe = universe},
lemmas
-let add_coercion refinement_toolkit ~add_composites status uri arity =
+let add_coercion refinement_toolkit ~add_composites status uri arity baseuri =
let compounds =
- LibrarySync.add_coercion ~add_composites refinement_toolkit uri arity in
+ LibrarySync.add_coercion ~add_composites refinement_toolkit uri arity baseuri in
{status with GrafiteTypes.coercions = uri :: status.GrafiteTypes.coercions},
compounds
RefinementTool.kit ->
add_composites:bool -> GrafiteTypes.status ->
UriManager.uri -> int ->
+ string (* baseuri *) ->
GrafiteTypes.status * UriManager.uri list
val time_travel:
(* given a new coercion uri from src to tgt returns
* a list of (new coercion uri, coercion obj, universe graph)
*)
-let close_coercion_graph rt src tgt uri =
+let close_coercion_graph rt src tgt uri baseuri =
(* check if the coercion already exists *)
let coercions = CoercDb.to_list () in
let todo_list = get_closure_coercions src tgt uri coercions in
let name_tgt = CoercDb.name_of_carr tgt in
let by = List.map UriManager.name_of_uri l in
let name = mangle name_tgt name_src by in
- let buri = UriManager.buri_of_uri uri in
let c_uri =
- number_if_already_defined buri name
+ number_if_already_defined baseuri name
(List.map (fun (_,_,u,_) -> u) acc)
in
let named_obj =
val close_coercion_graph:
RefinementTool.kit ->
CoercDb.coerc_carr -> CoercDb.coerc_carr -> UriManager.uri ->
+ string (* baseuri *) ->
(CoercDb.coerc_carr * CoercDb.coerc_carr * UriManager.uri * Cic.obj) list
UriManager.UriHashtbl.clear coercion_hashtbl;
CoercDb.remove_coercion (fun (_,_,u1) -> true)
-let add_coercion ~add_composites refinement_toolkit uri arity =
+let add_coercion ~add_composites refinement_toolkit uri arity baseuri =
let coer_ty,_ =
let coer = CicUtil.term_of_uri uri in
CicTypeChecker.type_of_aux' [] [] coer CicUniv.empty_ugraph
else
let new_coercions =
CicCoercion.close_coercion_graph refinement_toolkit src_carr tgt_carr uri
+ baseuri
in
let composite_uris = List.map (fun (_,_,uri,_) -> uri) new_coercions in
if already_in then
(*prerr_endline ("composite for " ^ UriManager.string_of_uri uri);*)
let x =
add_coercion ~add_composites:true refinement_toolkit uri arity
+ (UriManager.buri_of_uri uri)
in
(*prerr_endline ("are: ");
List.iter (fun u -> prerr_endline (UriManager.string_of_uri u)) x;
val add_coercion:
add_composites:bool ->
RefinementTool.kit -> UriManager.uri -> int (* arity *) ->
+ string (* baseuri *) ->
UriManager.uri list
(* inverse of add_coercion, removes both the eventually created composite *)
Infix "{#Z}" := ap_Z (no associativity, at level 90).
*)
-coercion cic:/CoRN/model/structures/Zsec/Zpos.con 0 (* compounds *).
+coercion cic:/Coq/ZArith/BinInt/Z.ind#xpointer(1/1/2) 0 (* compounds *).
(* From reals/Bridges_LUB *************************************************)
(* From reals/Q_in_CReals *************************************************)
-coercion cic:/CoRN/reals/Q_in_CReals/nat_of_P.con 0 (* compounds *).
+coercion cic:/Coq/NArith/BinPos/nat_of_P.con 0 (* compounds *).
(* From reals/R_morphism **************************************************)
(* begin hide *)
-coercion cic:/matita/CoRN-Decl/model/structures/Zsec/Zpos.con 0 (* compounds *).
+coercion cic:/Coq/ZArith/BinInt/Z.ind#xpointer(1/1/2) 0 (* compounds *).
(* end hide *)
(*#**************************************)
-coercion cic:/matita/CoRN-Decl/reals/Q_in_CReals/nat_of_P.con 0 (* compounds *).
+coercion cic:/Coq/NArith/BinPos/nat_of_P.con 0 (* compounds *).
(* end hide *)