X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=components%2Fbinaries%2Ftptp2grafite%2Fmain.ml;h=786ff7e75abc7a00d2f94d9498210601cb7b6308;hb=81b53ddc3ce92187e62deff483919ca2251fd246;hp=4042d92d1905ade4f198354226967507a37ae3e8;hpb=0d5dc75385c26c4f2c2194e45336f86e5e6aa4e6;p=helm.git diff --git a/components/binaries/tptp2grafite/main.ml b/components/binaries/tptp2grafite/main.ml index 4042d92d1..786ff7e75 100644 --- a/components/binaries/tptp2grafite/main.ml +++ b/components/binaries/tptp2grafite/main.ml @@ -196,11 +196,12 @@ let convert_ast statements context = function (fun _ -> [GA.Executable(floc,GA.Tactical(floc, GA.Tactic(floc, GA.Exists floc),Some (GA.Branch floc))); - GA.Executable(floc,GA.Tactical(floc, GA.Pos (floc,2),None))]) + GA.Executable(floc,GA.Tactical(floc, + GA.Pos (floc,[2]),None))]) fv)) else [])@ [GA.Executable(floc,GA.Tactical(floc, GA.Tactic(floc, - GA.Auto (floc,None,None,Some "paramodulation",None)), + GA.Auto (floc,["paramodulation",""])), Some (GA.Dot(floc))))]@ (if fv <> [] then (List.flatten @@ -283,8 +284,19 @@ let _ = ([],[]) statements in let pp t = - (* for a correct pp we should disambiguate the term... *) - let term_pp = CicNotationPp.pp_term in + (* ZACK: setting width to 80 will trigger a bug of BoxPp.render_to_string + * which will show up using the following command line: + * ./tptp2grafite -tptppath ~tassi/TPTP-v3.1.1 GRP170-1 *) + let width = max_int in + let term_pp content_term = + let pres_term = TermContentPres.pp_ast content_term in + let dummy_tbl = Hashtbl.create 1 in + let markup = CicNotationPres.render dummy_tbl pres_term in + let s = BoxPp.render_to_string width markup in + Pcre.substitute + ~pat:"\\\\forall [Ha-z][a-z0-9_]*" ~subst:(fun x -> "\n" ^ x) s + in + CicNotationPp.set_pp_term term_pp; let lazy_term_pp = fun x -> assert false in let obj_pp = CicNotationPp.pp_obj in print_endline @@ -293,12 +305,20 @@ let _ = let extra_statements_start = [ GA.Executable(floc,GA.Command(floc, GA.Set(floc,"baseuri","cic:/matita/TPTP/" ^ !inputfile))); - GA.Executable(floc,GA.Command(floc, GA.Include(floc,"legacy/coq.ma")))] + GA.Executable(floc,GA.Command(floc, GA.Include(floc,"logic/equality.ma")))] in List.iter pp extra_statements_start; - print_endline + List.iter + (fun (n,s) -> + print_endline (LexiconAstPp.pp_command (LA.Alias(floc, - LA.Ident_alias("eq","cic:/Coq/Init/Logic/eq.ind#xpointer(1/1)"))) ^ "."); + LA.Ident_alias(n,s))) ^ ".")) + [(*("eq","cic:/Coq/Init/Logic/eq.ind#xpointer(1/1)"); + ("trans_eq","cic:/Coq/Init/Logic/trans_eq.con"); + ("eq_ind_r","cic:/Coq/Init/Logic/eq_ind_r.con"); + ("eq_ind","cic:/Coq/Init/Logic/eq_ind.con"); + ("sym_eq","cic:/Coq/Init/Logic/sym_eq.con"); + ("refl_equal","cic:/Coq/Init/Logic/eq.ind#xpointer(1/1/1)") *)]; List.iter pp grafite_ast_statements; exit 0