X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fparamodulation%2Fsaturate_main.ml;h=ce4182e1ac6ac8620ef002181ef16e0097fe06df;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=1870a5137127ea975abcef23b28cd899d9f60318;hpb=259a4a2080cc5af5b20da1cd9133eb32f28c5d8f;p=helm.git diff --git a/helm/ocaml/paramodulation/saturate_main.ml b/helm/ocaml/paramodulation/saturate_main.ml index 1870a5137..ce4182e1a 100644 --- a/helm/ocaml/paramodulation/saturate_main.ml +++ b/helm/ocaml/paramodulation/saturate_main.ml @@ -1,3 +1,28 @@ +(* 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://cs.unibo.it/helm/. + *) + let configuration_file = ref "../../matita/matita.conf.xml";; let core_notation_script = "../../matita/core_notation.moo";; @@ -15,6 +40,10 @@ let get_from_user ~(dbd:HMysql.dbd) = term, metasenv, ugraph ;; +let full = ref false;; + +let retrieve_only = ref false;; + let _ = let module S = Saturation in let set_ratio v = S.weight_age_ratio := v; S.weight_age_counter := v @@ -28,8 +57,13 @@ let _ = | o -> raise (Arg.Bad ("Unknown term ordering: " ^ o)) and set_fullred b = S.use_fullred := b and set_time_limit v = S.time_limit := float_of_int v + and set_width w = S.maxwidth := w + and set_depth d = S.maxdepth := d + and set_full () = full := true + and set_retrieve () = retrieve_only := true in Arg.parse [ + "-full", Arg.Unit set_full, "Enable full mode"; "-f", Arg.Bool set_fullred, "Enable/disable full-reduction strategy (default: enabled)"; @@ -47,11 +81,19 @@ let _ = "\tlpo: Lexicographic path ordering"; "-l", Arg.Int set_time_limit, "Time limit in seconds (default: no limit)"; + + "-w", Arg.Int set_width, + Printf.sprintf "Maximal width (default: %d)" !Saturation.maxwidth; + + "-d", Arg.Int set_depth, + Printf.sprintf "Maximal depth (default: %d)" !Saturation.maxdepth; + + "-retrieve", Arg.Unit set_retrieve, "retrieve only"; ] (fun a -> ()) "Usage:" in Helm_registry.load_from !configuration_file; CicNotation.load_notation core_notation_script; -CicNotation.load_notation "../../matita/coq.moo"; +CicNotation.load_notation "../../matita/coq.ma"; let dbd = HMysql.quick_connect ~host:(Helm_registry.get "db.host") ~user:(Helm_registry.get "db.user") @@ -59,4 +101,8 @@ let dbd = HMysql.quick_connect () in let term, metasenv, ugraph = get_from_user ~dbd in -Saturation.main dbd term metasenv ugraph;; +if !retrieve_only then + Saturation.retrieve_and_print dbd term metasenv ugraph +else + Saturation.main dbd !full term metasenv ugraph +;;