X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fbinaries%2Ftptp2grafite%2Fmain.ml;h=03f8f2e9f7e2a65c30e130a8c8ade30e0c51664d;hb=ef81020b09c01bd12a3d7083104d90f7edca6893;hp=4a57812432a6c4ead7ee46c66fe5aaf5eb96f989;hpb=aaa3e96cdef325732c756ddf6ad20915b1587d93;p=helm.git diff --git a/helm/software/components/binaries/tptp2grafite/main.ml b/helm/software/components/binaries/tptp2grafite/main.ml index 4a5781243..03f8f2e9f 100644 --- a/helm/software/components/binaries/tptp2grafite/main.ml +++ b/helm/software/components/binaries/tptp2grafite/main.ml @@ -4,6 +4,8 @@ module PT = CicNotationPt;; module A = Ast;; let floc = HExtlib.dummy_floc;; +let universe = "Univ" ;; + let kw = [ "and","myand" ];; @@ -85,7 +87,7 @@ let build_ctx_for_arities univesally arities t = | (name,nargs)::tl -> PT.Binder (binder, - (mk_ident name,Some (mk_arrow "A" nargs)), + (mk_ident name,Some (mk_arrow universe nargs)), aux tl) in aux arities @@ -101,7 +103,7 @@ let convert_atom universally a = | A.False -> mk_ident "False" | A.Eq (l,r) | A.NotEq (l,r) -> (* removes the negation *) - PT.Appl [mk_ident "eq";mk_ident "A";convert_term l;convert_term r] + PT.Appl [mk_ident "eq";mk_ident universe;convert_term l;convert_term r] in build_ctx_for_arities universally (List.map (fun x -> (x,0)) (collect_fv_from_atom a)) (aux a) @@ -180,7 +182,7 @@ let convert_ast statements context = function let f = PT.Binder (`Forall, - (mk_ident "A",Some (PT.Sort `Set)), + (mk_ident universe,Some (PT.Sort `Set)), convert_formula fv false context f) in let o = PT.Theorem (`Theorem,name,f,None) in @@ -281,8 +283,18 @@ 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 + 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 @@ -294,9 +306,17 @@ let _ = GA.Executable(floc,GA.Command(floc, GA.Include(floc,"legacy/coq.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