4 (* profiling statistics... *)
5 let infer_time = ref 0.;;
6 let forward_simpl_time = ref 0.;;
7 let backward_simpl_time = ref 0.;;
9 (* limited-resource-strategy related globals *)
10 let processed_clauses = ref 0;; (* number of equalities selected so far... *)
11 let time_limit = ref 0.;; (* in seconds, settable by the user... *)
12 let start_time = ref 0.;; (* time at which the execution started *)
13 let elapsed_time = ref 0.;;
14 let maximal_retained_equality = ref None;;
16 (* equality-selection related globals *)
17 let weight_age_ratio = ref 0;; (* settable by the user from the command line *)
18 let weight_age_counter = ref !weight_age_ratio;;
19 let symbols_ratio = ref 0;;
20 let symbols_counter = ref 0;;
22 (* index of the greatest Cic.Meta created - TODO: find a better way! *)
28 | Success of Cic.term option * environment
33 let symbols_of_equality (_, (_, left, right), _, _) =
34 TermSet.union (symbols_of_term left) (symbols_of_term right)
38 let symbols_of_equality ((_, (_, left, right, _), _, _) as equality) =
39 let m1 = symbols_of_term left in
44 let c = TermMap.find k res in
45 TermMap.add k (c+v) res
48 (symbols_of_term right) m1
50 (* Printf.printf "symbols_of_equality %s:\n" *)
51 (* (string_of_equality equality); *)
52 (* TermMap.iter (fun k v -> Printf.printf "%s: %d\n" (CicPp.ppterm k) v) m; *)
53 (* print_newline (); *)
58 module OrderedEquality = struct
59 type t = Inference.equality
62 match meta_convertibility_eq eq1 eq2 with
65 let _, (ty, left, right, _), _, _ = eq1
66 and _, (ty', left', right', _), _, _ = eq2 in
67 let weight_of t = fst (weight_of_term ~consider_metas:false t) in
68 let w1 = (weight_of ty) + (weight_of left) + (weight_of right)
69 and w2 = (weight_of ty') + (weight_of left') + (weight_of right') in
70 match Pervasives.compare w1 w2 with
71 | 0 -> Pervasives.compare eq1 eq2
75 module EqualitySet = Set.Make(OrderedEquality);;
78 let select env passive (active, _) =
79 processed_clauses := !processed_clauses + 1;
81 let (neg_list, neg_set), (pos_list, pos_set), passive_table = passive in
83 List.filter (fun e -> e <> eq) l
85 if !weight_age_ratio > 0 then
86 weight_age_counter := !weight_age_counter - 1;
87 match !weight_age_counter with
89 weight_age_counter := !weight_age_ratio;
90 match neg_list, pos_list with
92 (* Negatives aren't indexed, no need to remove them... *)
94 ((tl, EqualitySet.remove hd neg_set), (pos, pos_set), passive_table)
96 let passive_table = Indexing.remove_index passive_table hd in
98 (([], neg_set), (tl, EqualitySet.remove hd pos_set), passive_table)
99 | _, _ -> assert false
101 | _ when (!symbols_counter > 0) && (EqualitySet.is_empty neg_set) -> (
102 symbols_counter := !symbols_counter - 1;
103 let cardinality map =
104 TermMap.fold (fun k v res -> res + v) map 0
107 | (Negative, e)::_ ->
108 let symbols = symbols_of_equality e in
109 let card = cardinality symbols in
110 let foldfun k v (r1, r2) =
111 if TermMap.mem k symbols then
112 let c = TermMap.find k symbols in
113 let c1 = abs (c - v) in
119 let f equality (i, e) =
121 TermMap.fold foldfun (symbols_of_equality equality) (0, 0)
123 let c = others + (abs (common - card)) in
124 if c < i then (c, equality)
127 let e1 = EqualitySet.min_elt pos_set in
130 TermMap.fold foldfun (symbols_of_equality e1) (0, 0)
132 (others + (abs (common - card))), e1
134 let _, current = EqualitySet.fold f pos_set initial in
135 (* Printf.printf "\nsymbols-based selection: %s\n\n" *)
136 (* (string_of_equality ~env current); *)
137 let passive_table = Indexing.remove_index passive_table current in
140 (remove current pos_list, EqualitySet.remove current pos_set),
143 let current = EqualitySet.min_elt pos_set in
146 (remove current pos_list, EqualitySet.remove current pos_set),
147 Indexing.remove_index passive_table current
149 (Positive, current), passive
152 symbols_counter := !symbols_ratio;
153 let set_selection set = EqualitySet.min_elt set in
154 if EqualitySet.is_empty neg_set then
155 let current = set_selection pos_set in
158 (remove current pos_list, EqualitySet.remove current pos_set),
159 Indexing.remove_index passive_table current
161 (Positive, current), passive
163 let current = set_selection neg_set in
165 (remove current neg_list, EqualitySet.remove current neg_set),
169 (Negative, current), passive
173 let make_passive neg pos =
174 let set_of equalities =
175 List.fold_left (fun s e -> EqualitySet.add e s) EqualitySet.empty equalities
177 let table = Indexing.empty_table () in
180 List.fold_left (fun tbl e -> Indexing.index tbl e) table pos
185 [], Indexing.empty_table ()
189 let add_to_passive passive (new_neg, new_pos) =
190 let (neg_list, neg_set), (pos_list, pos_set), table = passive in
191 let ok set equality = not (EqualitySet.mem equality set) in
192 let neg = List.filter (ok neg_set) new_neg
193 and pos = List.filter (ok pos_set) new_pos in
194 let add set equalities =
195 List.fold_left (fun s e -> EqualitySet.add e s) set equalities
197 (neg @ neg_list, add neg_set neg),
198 (pos_list @ pos, add pos_set pos),
199 List.fold_left (fun tbl e -> Indexing.index tbl e) table pos
203 let passive_is_empty = function
204 | ([], _), ([], _), _ -> true
209 let size_of_passive ((_, ns), (_, ps), _) =
210 (EqualitySet.cardinal ns) + (EqualitySet.cardinal ps)
214 let prune_passive howmany (active, _) passive =
215 let (nl, ns), (pl, ps), tbl = passive in
216 let howmany = float_of_int howmany
217 and ratio = float_of_int !weight_age_ratio in
218 let in_weight = int_of_float (howmany *. ratio /. (ratio +. 1.))
219 and in_age = int_of_float (howmany /. (ratio +. 1.)) in
220 Printf.printf "in_weight: %d, in_age: %d\n" in_weight in_age;
221 (* let rec pickw w s = *)
224 (* let e = EqualitySet.min_elt s in *)
225 (* let w, s' = pickw (w-1) (EqualitySet.remove e s) in *)
226 (* w, EqualitySet.add e s' *)
227 (* with Not_found -> *)
230 (* 0, EqualitySet.empty *)
234 | (Negative, e)::_ ->
235 let symbols = symbols_of_equality e in
236 let card = TermMap.fold (fun k v res -> res + v) symbols 0 in
240 let counter = ref !symbols_ratio in
241 let rec pickw w ns ps =
243 if not (EqualitySet.is_empty ns) then
244 let e = EqualitySet.min_elt ns in
245 let ns', ps = pickw (w-1) (EqualitySet.remove e ns) ps in
246 EqualitySet.add e ns', ps
247 else if !counter > 0 then
249 counter := !counter - 1;
250 if !counter = 0 then counter := !symbols_ratio
254 let e = EqualitySet.min_elt ps in
255 let ns, ps' = pickw (w-1) ns (EqualitySet.remove e ps) in
256 ns, EqualitySet.add e ps'
258 let foldfun k v (r1, r2) =
259 if TermMap.mem k symbols then
260 let c = TermMap.find k symbols in
261 let c1 = abs (c - v) in
267 let f equality (i, e) =
269 TermMap.fold foldfun (symbols_of_equality equality) (0, 0)
271 let c = others + (abs (common - card)) in
272 if c < i then (c, equality)
275 let e1 = EqualitySet.min_elt ps in
278 TermMap.fold foldfun (symbols_of_equality e1) (0, 0)
280 (others + (abs (common - card))), e1
282 let _, e = EqualitySet.fold f ps initial in
283 let ns, ps' = pickw (w-1) ns (EqualitySet.remove e ps) in
284 ns, EqualitySet.add e ps'
286 let e = EqualitySet.min_elt ps in
287 let ns, ps' = pickw (w-1) ns (EqualitySet.remove e ps) in
288 ns, EqualitySet.add e ps'
290 EqualitySet.empty, EqualitySet.empty
292 (* let in_weight, ns = pickw in_weight ns in *)
293 (* let _, ps = pickw in_weight ps in *)
294 let ns, ps = pickw in_weight ns ps in
295 let rec picka w s l =
299 | hd::tl when not (EqualitySet.mem hd s) ->
300 let w, s, l = picka (w-1) s tl in
301 w, EqualitySet.add hd s, hd::l
303 let w, s, l = picka w s tl in
308 let in_age, ns, nl = picka in_age ns nl in
309 let _, ps, pl = picka in_age ps pl in
310 if not (EqualitySet.is_empty ps) then
311 maximal_retained_equality := Some (EqualitySet.max_elt ps);
314 (fun e tbl -> Indexing.index tbl e) ps (Indexing.empty_table ()) in
315 (nl, ns), (pl, ps), tbl
319 let infer env sign current (active_list, active_table) =
320 let new_neg, new_pos =
323 Indexing.superposition_left env active_table current, []
326 Indexing.superposition_right !maxmeta env active_table current in
328 let rec infer_positive table = function
330 | (Negative, equality)::tl ->
331 let res = Indexing.superposition_left env table equality in
332 let neg, pos = infer_positive table tl in
334 | (Positive, equality)::tl ->
336 Indexing.superposition_right !maxmeta env table equality in
338 let neg, pos = infer_positive table tl in
341 let curr_table = Indexing.index (Indexing.empty_table ()) current in
342 let neg, pos = infer_positive curr_table active_list in
345 match !maximal_retained_equality with
346 | None -> new_neg, new_pos
349 List.filter (fun e -> OrderedEquality.compare e eq <= 0) new_pos in
354 let contains_empty env (negative, positive) =
355 let metasenv, context, ugraph = env in
357 let (proof, _, _, _) =
359 (fun (proof, (ty, left, right, ordering), m, a) ->
360 fst (CicReduction.are_convertible context left right ugraph))
369 let forward_simplify env (sign, current) ?passive (active_list, active_table) =
370 let pl, passive_table =
373 | Some ((pn, _), (pp, _), pt) ->
374 let pn = List.map (fun e -> (Negative, e)) pn
375 and pp = List.map (fun e -> (Positive, e)) pp in
378 let all = active_list @ pl in
379 let rec find_duplicate sign current = function
381 | (s, eq)::tl when s = sign ->
382 if meta_convertibility_eq current eq then true
383 else find_duplicate sign current tl
384 | _::tl -> find_duplicate sign current tl
386 let demodulate table current =
387 let newmeta, newcurrent =
388 Indexing.demodulation !maxmeta env table current in
390 if is_identity env newcurrent then
391 if sign = Negative then Some (sign, newcurrent) else None
393 Some (sign, newcurrent)
396 let res = demodulate active_table current in
399 | Some (sign, newcurrent) ->
400 match passive_table with
402 | Some passive_table -> demodulate passive_table newcurrent
407 if find_duplicate s c all then
411 (* if s = Utils.Negative then *)
414 (* if Indexing.subsumption env active_table c then *)
417 (* match passive_table with *)
419 (* | Some passive_table -> *)
420 (* if Indexing.subsumption env passive_table c then *)
426 (* let pred (sign, eq) = *)
427 (* if sign <> s then false *)
428 (* else subsumption env c eq *)
430 (* if List.exists pred all then None *)
434 type fs_time_info_t = {
435 mutable build_all: float;
436 mutable demodulate: float;
437 mutable subsumption: float;
440 let fs_time_info = { build_all = 0.; demodulate = 0.; subsumption = 0. };;
443 let forward_simplify_new env (new_neg, new_pos) ?passive active =
444 let t1 = Unix.gettimeofday () in
446 let active_list, active_table = active in
447 let pl, passive_table =
450 | Some ((pn, _), (pp, _), pt) ->
451 let pn = List.map (fun e -> (Negative, e)) pn
452 and pp = List.map (fun e -> (Positive, e)) pp in
455 let all = active_list @ pl in
457 let t2 = Unix.gettimeofday () in
458 fs_time_info.build_all <- fs_time_info.build_all +. (t2 -. t1);
460 let demodulate table target =
461 let newmeta, newtarget = Indexing.demodulation !maxmeta env table target in
465 (* let f sign' target (sign, eq) = *)
466 (* if sign <> sign' then false *)
467 (* else subsumption env target eq *)
470 let t1 = Unix.gettimeofday () in
472 let new_neg, new_pos =
473 let new_neg = List.map (demodulate active_table) new_neg
474 and new_pos = List.map (demodulate active_table) new_pos in
475 match passive_table with
476 | None -> new_neg, new_pos
477 | Some passive_table ->
478 List.map (demodulate passive_table) new_neg,
479 List.map (demodulate passive_table) new_pos
482 let t2 = Unix.gettimeofday () in
483 fs_time_info.demodulate <- fs_time_info.demodulate +. (t2 -. t1);
488 if not (Inference.is_identity env e) then EqualitySet.add e s else s)
489 EqualitySet.empty new_pos
491 let new_pos = EqualitySet.elements new_pos_set in
494 match passive_table with
496 (fun e -> not (Indexing.subsumption env active_table e))
497 | Some passive_table ->
498 (fun e -> not ((Indexing.subsumption env active_table e) ||
499 (Indexing.subsumption env passive_table e)))
502 let t1 = Unix.gettimeofday () in
504 (* let new_neg, new_pos = *)
505 (* List.filter subs new_neg, *)
506 (* List.filter subs new_pos *)
509 (* let new_neg, new_pos = *)
510 (* (List.filter (fun e -> not (List.exists (f Negative e) all)) new_neg, *)
511 (* List.filter (fun e -> not (List.exists (f Positive e) all)) new_pos) *)
514 let t2 = Unix.gettimeofday () in
515 fs_time_info.subsumption <- fs_time_info.subsumption +. (t2 -. t1);
519 (* (List.filter (fun e -> not (List.exists (f Negative e) all)) new_neg, *)
520 (* List.filter (fun e -> not (List.exists (f Positive e) all)) new_pos) *)
526 let backward_simplify_active env (new_neg, new_pos) active =
527 let active_list, active_table = active in
528 let new_pos, new_table =
530 (fun (l, t) e -> (Positive, e)::l, Indexing.index t e)
531 ([], Indexing.empty_table ()) new_pos
533 let active_list, newa =
535 (fun (s, equality) (res, newn) ->
536 match forward_simplify env (s, equality) (new_pos, new_table) with
546 List.exists (fun (s, e) -> meta_convertibility_eq eq1 e) where
550 (fun (s, eq) (res, tbl) ->
551 if (is_identity env eq) || (find eq res) then
554 (s, eq)::res, if s = Negative then tbl else Indexing.index tbl eq)
555 active_list ([], Indexing.empty_table ()),
557 (fun (s, eq) (n, p) ->
558 if (s <> Negative) && (is_identity env eq) then
561 if s = Negative then eq::n, p
566 | [], [] -> active, None
567 | _ -> active, Some newa
571 let backward_simplify_passive env (new_neg, new_pos) passive =
572 let new_pos, new_table =
574 (fun (l, t) e -> (Positive, e)::l, Indexing.index t e)
575 ([], Indexing.empty_table ()) new_pos
577 let (nl, ns), (pl, ps), passive_table = passive in
578 let f sign equality (resl, ress, newn) =
579 match forward_simplify env (sign, equality) (new_pos, new_table) with
580 | None -> resl, EqualitySet.remove equality ress, newn
583 equality::resl, ress, newn
585 let ress = EqualitySet.remove equality ress in
588 let nl, ns, newn = List.fold_right (f Negative) nl ([], ns, [])
589 and pl, ps, newp = List.fold_right (f Positive) pl ([], ps, []) in
592 (fun tbl e -> Indexing.index tbl e) (Indexing.empty_table ()) pl
594 match newn, newp with
595 | [], [] -> ((nl, ns), (pl, ps), passive_table), None
596 | _, _ -> ((nl, ns), (pl, ps), passive_table), Some (newn, newp)
600 let backward_simplify env new' ?passive active =
601 let active, newa = backward_simplify_active env new' active in
604 active, (make_passive [] []), newa, None
607 backward_simplify_passive env new' passive in
608 active, passive, newa, newp
612 let get_selection_estimate () =
613 elapsed_time := (Unix.gettimeofday ()) -. !start_time;
614 !processed_clauses * (int_of_float (!time_limit /. !elapsed_time))
618 let rec given_clause env passive active =
619 let selection_estimate = get_selection_estimate () in
620 let kept = size_of_passive passive in
622 if !time_limit = 0. || !processed_clauses = 0 then
624 else if !elapsed_time > !time_limit then (
625 Printf.printf "Time limit (%.2f) reached: %.2f\n"
626 !time_limit !elapsed_time;
628 ) else if kept > selection_estimate then (
629 Printf.printf ("Too many passive equalities: pruning... (kept: %d, " ^^
630 "selection_estimate: %d)\n") kept selection_estimate;
631 prune_passive selection_estimate active passive
636 match passive_is_empty passive with
639 let (sign, current), passive = select env passive active in
640 match forward_simplify env (sign, current) ~passive active with
642 given_clause env passive active
643 | Some (sign, current) ->
644 if (sign = Negative) && (is_identity env current) then (
645 Printf.printf "OK!!! %s %s" (string_of_sign sign)
646 (string_of_equality ~env current);
648 let proof, _, _, _ = current in
649 Success (Some proof, env)
651 print_endline "\n================================================";
652 Printf.printf "selected: %s %s"
653 (string_of_sign sign) (string_of_equality ~env current);
656 let t1 = Unix.gettimeofday () in
657 let new' = infer env sign current active in
658 let t2 = Unix.gettimeofday () in
659 infer_time := !infer_time +. (t2 -. t1);
661 let res, proof = contains_empty env new' in
665 let t1 = Unix.gettimeofday () in
666 let new' = forward_simplify_new env new' active in
667 let t2 = Unix.gettimeofday () in
669 forward_simpl_time := !forward_simpl_time +. (t2 -. t1)
675 let t1 = Unix.gettimeofday () in
676 let active, _, newa, _ =
677 backward_simplify env ([], [current]) active
679 let t2 = Unix.gettimeofday () in
680 backward_simpl_time := !backward_simpl_time +. (t2 -. t1);
684 let al, tbl = active in
685 let nn = List.map (fun e -> Negative, e) n in
690 Indexing.index tbl e)
696 Printf.printf "active:\n%s\n"
699 (fun (s, e) -> (string_of_sign s) ^ " " ^
700 (string_of_equality ~env e)) (fst active))));
706 Printf.printf "new':\n%s\n"
709 (fun e -> "Negative " ^
710 (string_of_equality ~env e)) neg) @
712 (fun e -> "Positive " ^
713 (string_of_equality ~env e)) pos)));
716 match contains_empty env new' with
719 let al, tbl = active in
721 | Negative -> (sign, current)::al, tbl
723 al @ [(sign, current)], Indexing.index tbl current
725 let passive = add_to_passive passive new' in
726 let (_, ns), (_, ps), _ = passive in
727 Printf.printf "passive:\n%s\n"
729 ((List.map (fun e -> "Negative " ^
730 (string_of_equality ~env e))
731 (EqualitySet.elements ns)) @
732 (List.map (fun e -> "Positive " ^
733 (string_of_equality ~env e))
734 (EqualitySet.elements ps))));
736 given_clause env passive active
743 let rec given_clause_fullred env passive active =
744 let selection_estimate = get_selection_estimate () in
745 let kept = size_of_passive passive in
747 if !time_limit = 0. || !processed_clauses = 0 then
749 else if !elapsed_time > !time_limit then (
750 Printf.printf "Time limit (%.2f) reached: %.2f\n"
751 !time_limit !elapsed_time;
753 ) else if kept > selection_estimate then (
754 Printf.printf ("Too many passive equalities: pruning... (kept: %d, " ^^
755 "selection_estimate: %d)\n") kept selection_estimate;
756 prune_passive selection_estimate active passive
761 match passive_is_empty passive with
764 let (sign, current), passive = select env passive active in
765 match forward_simplify env (sign, current) ~passive active with
767 given_clause_fullred env passive active
768 | Some (sign, current) ->
769 if (sign = Negative) && (is_identity env current) then (
770 Printf.printf "OK!!! %s %s" (string_of_sign sign)
771 (string_of_equality ~env current);
773 let proof, _, _, _ = current in
774 Success (Some proof, env)
776 print_endline "\n================================================";
777 Printf.printf "selected: %s %s"
778 (string_of_sign sign) (string_of_equality ~env current);
781 let t1 = Unix.gettimeofday () in
782 let new' = infer env sign current active in
783 let t2 = Unix.gettimeofday () in
784 infer_time := !infer_time +. (t2 -. t1);
787 if is_identity env current then active
789 let al, tbl = active in
791 | Negative -> (sign, current)::al, tbl
792 | Positive -> al @ [(sign, current)], Indexing.index tbl current
794 let rec simplify new' active passive =
795 let t1 = Unix.gettimeofday () in
796 let new' = forward_simplify_new env new' ~passive active in
797 let t2 = Unix.gettimeofday () in
798 forward_simpl_time := !forward_simpl_time +. (t2 -. t1);
799 let t1 = Unix.gettimeofday () in
800 let active, passive, newa, retained =
801 backward_simplify env new' ~passive active in
802 let t2 = Unix.gettimeofday () in
803 backward_simpl_time := !backward_simpl_time +. (t2 -. t1);
804 match newa, retained with
805 | None, None -> active, passive, new'
807 | None, Some (n, p) ->
809 simplify (nn @ n, np @ p) active passive
810 | Some (n, p), Some (rn, rp) ->
812 simplify (nn @ n @ rn, np @ p @ rp) active passive
814 let active, passive, new' = simplify new' active passive in
816 let k = size_of_passive passive in
817 if k < (kept - 1) then
818 processed_clauses := !processed_clauses + (kept - 1 - k);
821 Printf.printf "active:\n%s\n"
824 (fun (s, e) -> (string_of_sign s) ^ " " ^
825 (string_of_equality ~env e)) (fst active))));
831 Printf.printf "new':\n%s\n"
834 (fun e -> "Negative " ^
835 (string_of_equality ~env e)) neg) @
837 (fun e -> "Positive " ^
838 (string_of_equality ~env e)) pos)));
841 match contains_empty env new' with
843 let passive = add_to_passive passive new' in
844 given_clause_fullred env passive active
851 let get_from_user () =
852 let dbd = Mysql.quick_connect
853 ~host:"localhost" ~user:"helm" ~database:"mowgli" () in
855 match read_line () with
859 let term_string = String.concat "\n" (get ()) in
860 let env, metasenv, term, ugraph =
861 List.nth (Disambiguate.Trivial.disambiguate_string dbd term_string) 0
863 term, metasenv, ugraph
867 let given_clause_ref = ref given_clause;;
871 let module C = Cic in
872 let module T = CicTypeChecker in
873 let module PET = ProofEngineTypes in
874 let module PP = CicPp in
875 let term, metasenv, ugraph = get_from_user () in
876 let proof = None, (1, [], term)::metasenv, C.Meta (1, []), term in
878 PET.apply_tactic (PrimitiveTactics.intros_tac ()) (proof, 1) in
879 let goal = List.nth goals 0 in
880 let _, metasenv, meta_proof, _ = proof in
881 let _, context, goal = CicUtil.lookup_meta goal metasenv in
882 let equalities, maxm = find_equalities context proof in
883 maxmeta := maxm; (* TODO ugly!! *)
884 let env = (metasenv, context, ugraph) in
886 let term_equality = equality_of_term meta_proof goal in
887 let meta_proof, (eq_ty, left, right, ordering), _, _ = term_equality in
888 let active = make_active () in
889 let passive = make_passive [term_equality] equalities in
890 Printf.printf "\ncurrent goal: %s\n"
891 (string_of_equality ~env term_equality);
892 Printf.printf "\ncontext:\n%s\n" (PP.ppcontext context);
893 Printf.printf "\nmetasenv:\n%s\n" (print_metasenv metasenv);
894 Printf.printf "\nequalities:\n%s\n"
897 (string_of_equality ~env)
899 print_endline "--------------------------------------------------";
900 let start = Unix.gettimeofday () in
902 start_time := Unix.gettimeofday ();
903 let res = !given_clause_ref env passive active in
904 let finish = Unix.gettimeofday () in
907 Printf.printf "NO proof found! :-(\n\n"
908 | Success (Some proof, env) ->
909 Printf.printf "OK, found a proof!:\n%s\n%.9f\n"
910 (PP.pp proof (names_of_context context))
912 Printf.printf ("infer_time: %.9f\nforward_simpl_time: %.9f\n" ^^
913 "backward_simpl_time: %.9f\n")
914 !infer_time !forward_simpl_time !backward_simpl_time;
915 (* Printf.printf ("forward_simpl_details:\n build_all: %.9f\n" ^^ *)
916 (* " demodulate: %.9f\n subsumption: %.9f\n") *)
917 (* fs_time_info.build_all fs_time_info.demodulate *)
918 (* fs_time_info.subsumption; *)
919 | Success (None, env) ->
920 Printf.printf "Success, but no proof?!?\n\n"
922 print_endline ("EXCEPTION: " ^ (Printexc.to_string exc));
927 let configuration_file = ref "../../gTopLevel/gTopLevel.conf.xml";;
930 let set_ratio v = weight_age_ratio := (v+1); weight_age_counter := (v+1)
931 and set_sel v = symbols_ratio := v; symbols_counter := v;
932 and set_conf f = configuration_file := f
933 and set_lpo () = Utils.compare_terms := lpo
934 and set_kbo () = Utils.compare_terms := nonrec_kbo
935 and set_fullred () = given_clause_ref := given_clause_fullred
936 and set_time_limit v = time_limit := float_of_int v
939 "-f", Arg.Unit set_fullred, "Use full-reduction strategy";
941 "-r", Arg.Int set_ratio, "Weight-Age equality selection ratio (default: 0)";
943 "-s", Arg.Int set_sel,
944 "symbols-based selection ratio (relative to the weight ratio)";
946 "-c", Arg.String set_conf, "Configuration file (for the db connection)";
948 "-lpo", Arg.Unit set_lpo, "Use lpo term ordering";
950 "-kbo", Arg.Unit set_kbo, "Use (non-recursive) kbo term ordering (default)";
952 "-l", Arg.Int set_time_limit, "Time limit (in seconds)";
953 ] (fun a -> ()) "Usage:"
955 Helm_registry.load_from !configuration_file;