1 (* Copyright (C) 2005, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
32 let out_comment och s =
33 let s = if s <> "" && s.[0] = '*' then "#" ^ s else s in
34 Printf.fprintf och "%s%s%s\n\n" "(*" s "*)"
36 let out_line_comment och s =
37 let l = 70 - String.length s in
38 let s = Printf.sprintf " %s %s" s (String.make l '*') in
41 let out_preamble och (path, lines) =
42 let ich = open_in path in
45 let s = input_line ich in
46 begin Printf.fprintf och "%s\n" s; print (pred i) end
49 out_line_comment och "This file was automatically generated: do not edit"
53 let pp_ast_statement =
54 GrafiteAstPp.pp_statement ~term_pp:CicNotationPp.pp_term
55 ~lazy_term_pp:CicNotationPp.pp_term ~obj_pp:(CicNotationPp.pp_obj CicNotationPp.pp_term)
60 let och = open_out f in
61 let atexit () = close_out och in
62 let rt_base_dir = Filename.dirname Sys.argv.(0) in
63 let path = Filename.concat rt_base_dir "matita.ma.templ" in
65 out_preamble och (path, lines);
66 let grafite_parser_cb ast =
67 output_string och (LexiconAstPp.pp_command ast)
69 let matita_engine_cb = function
70 | G.Executable (_, G.Macro (_, G.Inline _)) -> ()
72 output_string och (pp_ast_statement ast)
74 let matitac_lib_cb = output_string och in
75 (* GrafiteParser.set_callback grafite_parser_cb; *)
76 MatitaEngine.set_callback matita_engine_cb;
77 MatitacLib.set_callback matitac_lib_cb;
81 match Filename.basename Sys.argv.(0) with
82 |"gragrep" |"gragrep.opt" |"gragrep.opt.static" ->Gragrep.main()
83 |"matitadep" |"matitadep.opt" |"matitadep.opt.static" ->Matitadep.main()
84 |"matitaclean"|"matitaclean.opt"|"matitaclean.opt.static"->Matitaclean.main()
85 |"matitamake" |"matitamake.opt" |"matitamake.opt.static" ->Matitamake.main()
86 |"matitaprover"|"matitaprover.opt"
87 |"matitaprover.opt.static" ->Matitaprover.main()
88 |"matitawiki"|"matitawiki.opt" ->MatitaWiki.main()
91 let _ = Paramodulation.Saturation.init () in *)
92 (* ALB to link paramodulation *)
93 let dump_msg = "<filename> Dump source with expanded macros to <filename>" in
94 MatitaInit.add_cmdline_spec ["-dump", Arg.String dump, dump_msg];
95 let _ = MatitacLib.main `COMPILER in