correctly. Thus including another file a bugged coercion graph was produced,
with randomic effects quite hard to understand. (Examples in dama where
it was not possible to use <= in place of le here and there because of a
coercion with the wrong arity).
type 'a eval_from_moo =
{ efm_go: GrafiteTypes.status -> string -> GrafiteTypes.status }
type 'a eval_from_moo =
{ efm_go: GrafiteTypes.status -> string -> GrafiteTypes.status }
-let coercion_moo_statement_of arity uri =
+let coercion_moo_statement_of (uri,arity) =
GrafiteAst.Coercion (HExtlib.dummy_floc, uri, false, arity)
let refinement_toolkit = {
GrafiteAst.Coercion (HExtlib.dummy_floc, uri, false, arity)
let refinement_toolkit = {
baseuri
in
let moo_content =
baseuri
in
let moo_content =
- List.map (coercion_moo_statement_of arity) (uri::compounds)
+ List.map coercion_moo_statement_of ((uri,arity)::compounds)
in
let status = GrafiteTypes.add_moo_content moo_content status in
{status with GrafiteTypes.proof_status = GrafiteTypes.No_proof},
in
let status = GrafiteTypes.add_moo_content moo_content status in
{status with GrafiteTypes.proof_status = GrafiteTypes.No_proof},
let eval_tactical ~disambiguate_tactic status tac =
let apply_tactic = apply_tactic ~disambiguate_tactic in
let eval_tactical ~disambiguate_tactic status tac =
let apply_tactic = apply_tactic ~disambiguate_tactic in
in
let is_a_coercion, arity_coercion = is_a_coercion uri in
if is_a_coercion then
in
let is_a_coercion, arity_coercion = is_a_coercion uri in
if is_a_coercion then
- Some (uri, coercion_moo_statement_of arity_coercion uri)
+ Some (uri, coercion_moo_statement_of (uri,arity_coercion))
else if is_a_wanted_coercion then
else if is_a_wanted_coercion then
- Some (uri, coercion_moo_statement_of arity_wanted uri)
+ Some (uri, coercion_moo_statement_of (uri,arity_wanted))
let status, lemmas = add_obj uri obj status in
{status with
GrafiteTypes.proof_status = GrafiteTypes.No_proof},
let status, lemmas = add_obj uri obj status in
{status with
GrafiteTypes.proof_status = GrafiteTypes.No_proof},
+ (*CSC: I throw away the arities *)
uri::lemmas
| GrafiteAst.Relation (loc, id, a, aeq, refl, sym, trans) ->
Setoids.add_relation id a aeq refl sym trans;
uri::lemmas
| GrafiteAst.Relation (loc, id, a, aeq, refl, sym, trans) ->
Setoids.add_relation id a aeq refl sym trans;
add_composites:bool -> GrafiteTypes.status ->
UriManager.uri -> int ->
string (* baseuri *) ->
add_composites:bool -> GrafiteTypes.status ->
UriManager.uri -> int ->
string (* baseuri *) ->
- GrafiteTypes.status * UriManager.uri list
+ GrafiteTypes.status * (UriManager.uri * int) list (* URI and arity *)
val time_travel:
present:GrafiteTypes.status -> past:GrafiteTypes.status -> unit
val time_travel:
present:GrafiteTypes.status -> past:GrafiteTypes.status -> unit
let lemmas =
if add_composites then
List.fold_left
let lemmas =
if add_composites then
List.fold_left
- (fun acc (_,_,uri,obj) ->
+ (fun acc (_,tgt,uri,obj) ->
add_single_obj uri obj refinement_toolkit;
add_single_obj uri obj refinement_toolkit;
+ let arity = match tgt with CoercDb.Fun n -> n | _ -> 0 in
+ (uri,arity)::acc)
if coercion then
begin
(*prerr_endline ("composite for " ^ UriManager.string_of_uri uri);*)
if coercion then
begin
(*prerr_endline ("composite for " ^ UriManager.string_of_uri uri);*)
+ (*CSC: I think there is a bug here. The composite coercions
+ are not remembered in the .moo file. Thus they are re-generated
+ every time. Right? *)
let x =
add_coercion ~add_composites:true refinement_toolkit uri arity
(UriManager.buri_of_uri uri)
let x =
add_coercion ~add_composites:true refinement_toolkit uri arity
(UriManager.buri_of_uri uri)
List.iter (fun u -> prerr_endline (UriManager.string_of_uri u)) x;
prerr_endline "---";
*)
List.iter (fun u -> prerr_endline (UriManager.string_of_uri u)) x;
prerr_endline "---";
*)
+ (*CSC: I throw the arity away. See comment above *)
+ List.map fst x
add_composites:bool ->
RefinementTool.kit -> UriManager.uri -> int (* arity *) ->
string (* baseuri *) ->
add_composites:bool ->
RefinementTool.kit -> UriManager.uri -> int (* arity *) ->
string (* baseuri *) ->
+ (UriManager.uri * int) list (* URI and arity *)
(* inverse of add_coercion, removes both the eventually created composite *)
(* coercions and the information that [uri] and the composites are coercion *)
(* inverse of add_coercion, removes both the eventually created composite *)
(* coercions and the information that [uri] and the composites are coercion *)