(* Copyright (C) 2005, HELM Team. * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science * Department, University of Bologna, Italy. * * HELM is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * HELM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HELM; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * * For details, see the HELM World-Wide-Web page, * http://helm.cs.unibo.it/ *) open Printf open GrafiteTypes let debug = false ;; let debug_print = if debug then prerr_endline else ignore ;; let eval_from_stream ?do_heavy_checks ~include_paths ?clean_baseuri status str cb = try while true do let ast = GrafiteParser.parse_statement str in cb !status ast; status := GrafiteEngine.eval_ast ~baseuri_of_script:(GrafiteParserMisc.baseuri_of_script ~include_paths) ~disambiguate_tactic:GrafiteDisambiguate.disambiguate_tactic ~disambiguate_command:GrafiteDisambiguate.disambiguate_command ?do_heavy_checks ?clean_baseuri !status ast done with End_of_file -> () let eval_from_stream_greedy ?do_heavy_checks ~include_paths ?clean_baseuri status str cb = while true do print_string "matita> "; flush stdout; let ast = GrafiteParser.parse_statement str in cb !status ast; status := GrafiteEngine.eval_ast ~baseuri_of_script:(GrafiteParserMisc.baseuri_of_script ~include_paths) ~disambiguate_tactic:GrafiteDisambiguate.disambiguate_tactic ~disambiguate_command:GrafiteDisambiguate.disambiguate_command ?do_heavy_checks ?clean_baseuri !status ast done ;; let eval_string ?do_heavy_checks ~include_paths ?clean_baseuri status str = eval_from_stream ?do_heavy_checks ~include_paths ?clean_baseuri status (Ulexing.from_utf8_string str) (fun _ _ -> ()) let default_options () = no_options let initial_status = lazy { aliases = DisambiguateTypes.Environment.empty; multi_aliases = DisambiguateTypes.Environment.empty; moo_content_rev = []; metadata = []; proof_status = No_proof; options = default_options (); objects = []; coercions = []; notation_ids = []; }