]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/paramodulation/saturate_main.ml
some bugs fixed
[helm.git] / helm / ocaml / paramodulation / saturate_main.ml
1 let configuration_file = ref "../../matita/matita.conf.xml";;
2
3 let core_notation_script = "../../matita/core_notation.moo";;
4
5 let get_from_user ~(dbd:Mysql.dbd) =
6   let rec get () =
7     match read_line () with
8     | "" -> []
9     | t -> t::(get ())
10   in
11   let term_string = String.concat "\n" (get ()) in
12   let env, metasenv, term, ugraph =
13     List.nth (Disambiguate.Trivial.disambiguate_string dbd term_string) 0
14   in
15   term, metasenv, ugraph
16 ;;
17
18 let _ =
19   let module S = Saturation in
20   let set_ratio v = S.weight_age_ratio := (v+1); S.weight_age_counter := (v+1)
21   and set_sel v = S.symbols_ratio := v; S.symbols_counter := v;
22   and set_conf f = configuration_file := f
23   and set_lpo () = Utils.compare_terms := Utils.lpo
24   and set_kbo () = Utils.compare_terms := Utils.nonrec_kbo
25   and set_fullred b = S.use_fullred := b
26   and set_time_limit v = S.time_limit := float_of_int v
27   in
28   Arg.parse [
29     "-f", Arg.Bool set_fullred,
30     "Enable/disable full-reduction strategy (default: enabled)";
31     
32     "-r", Arg.Int set_ratio, "Weight-Age equality selection ratio (default: 3)";
33
34     "-s", Arg.Int set_sel,
35     "symbols-based selection ratio (relative to the weight ratio, default: 2)";
36
37     "-c", Arg.String set_conf, "Configuration file (for the db connection)";
38
39     "-lpo", Arg.Unit set_lpo, "Use lpo term ordering";
40
41     "-kbo", Arg.Unit set_kbo, "Use (non-recursive) kbo term ordering (default)";
42
43     "-l", Arg.Int set_time_limit, "Time limit (in seconds)";
44   ] (fun a -> ()) "Usage:"
45 in
46 Helm_registry.load_from !configuration_file;
47 CicNotation.load_notation core_notation_script;
48 CicNotation.load_notation "../../matita/coq.moo";
49 let dbd = Mysql.quick_connect
50   ~host:(Helm_registry.get "db.host")
51   ~user:(Helm_registry.get "db.user")
52   ~database:(Helm_registry.get "db.database")
53   ()
54 in
55 let term, metasenv, ugraph = get_from_user ~dbd in
56 Saturation.main dbd term metasenv ugraph;;