1 let configuration_file = ref "../../matita/matita.conf.xml";;
3 let core_notation_script = "../../matita/core_notation.moo";;
5 let get_from_user ~(dbd:HMysql.dbd) =
7 match read_line () with
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
15 term, metasenv, ugraph
19 let module S = Saturation in
20 let set_ratio v = S.weight_age_ratio := v; S.weight_age_counter := v
21 and set_sel v = S.symbols_ratio := v; S.symbols_counter := v;
22 and set_conf f = configuration_file := f
25 | "lpo" -> Utils.compare_terms := Utils.lpo
26 | "kbo" -> Utils.compare_terms := Utils.kbo
27 | "nr-kbo" -> Utils.compare_terms := Utils.nonrec_kbo
28 | o -> raise (Arg.Bad ("Unknown term ordering: " ^ o))
29 and set_fullred b = S.use_fullred := b
30 and set_time_limit v = S.time_limit := float_of_int v
31 and set_width w = S.maxwidth := w
32 and set_depth d = S.maxdepth := d
35 "-f", Arg.Bool set_fullred,
36 "Enable/disable full-reduction strategy (default: enabled)";
38 "-r", Arg.Int set_ratio, "Weight-Age equality selection ratio (default: 4)";
40 "-s", Arg.Int set_sel,
41 "symbols-based selection ratio (relative to the weight ratio, default: 0)";
43 "-c", Arg.String set_conf, "Configuration file (for the db connection)";
45 "-o", Arg.String set_ordering,
46 "Term ordering. Possible values are:\n" ^
47 "\tkbo: Knuth-Bendix ordering\n" ^
48 "\tnr-kbo: Non-recursive variant of kbo (default)\n" ^
49 "\tlpo: Lexicographic path ordering";
51 "-l", Arg.Int set_time_limit, "Time limit in seconds (default: no limit)";
53 "-w", Arg.Int set_width,
54 Printf.sprintf "Maximal width (default: %d)" !Saturation.maxwidth;
56 "-d", Arg.Int set_depth,
57 Printf.sprintf "Maximal depth (default: %d)" !Saturation.maxdepth;
58 ] (fun a -> ()) "Usage:"
60 Helm_registry.load_from !configuration_file;
61 CicNotation.load_notation core_notation_script;
62 CicNotation.load_notation "../../matita/coq.ma";
63 let dbd = HMysql.quick_connect
64 ~host:(Helm_registry.get "db.host")
65 ~user:(Helm_registry.get "db.user")
66 ~database:(Helm_registry.get "db.database")
69 let term, metasenv, ugraph = get_from_user ~dbd in
70 Saturation.main dbd term metasenv ugraph;;