module PosEqSet = Set.Make(OrderedPosEquality);;
-module DiscriminationTree = Trie.Make(PSMap);;
+(* module DiscriminationTree = Trie.Make(PSMap);; *)
-(*
module DiscriminationTree = struct
type key = path_string
type t = Node of PosEqSet.t option * (t PSMap.t)
traverse [] t acc
end
-*)
+
let string_of_discrimination_tree tree =
let rec to_string level = function
| DiscriminationTree.Node (value, map) ->
let print_candidates mode term res =
-(* match res with *)
-(* | [] -> () *)
-(* | _ -> *)
- let _ =
- match mode with
- | Matching ->
- Printf.printf "| candidates Matching %s\n" (CicPp.ppterm term)
- | Unification ->
- Printf.printf "| candidates Unification %s\n" (CicPp.ppterm term)
- in
- print_endline
- (String.concat "\n"
- (List.map
- (fun (p, e) ->
- Printf.sprintf "| (%s, %s)" (Utils.string_of_pos p)
- (Inference.string_of_equality e))
- res));
- print_endline "|";
+ let _ =
+ match mode with
+ | Matching ->
+ Printf.printf "| candidates Matching %s\n" (CicPp.ppterm term)
+ | Unification ->
+ Printf.printf "| candidates Unification %s\n" (CicPp.ppterm term)
+ in
+ print_endline
+ (String.concat "\n"
+ (List.map
+ (fun (p, e) ->
+ Printf.sprintf "| (%s, %s)" (Utils.string_of_pos p)
+ (Inference.string_of_equality e))
+ res));
+ print_endline "|";
;;
-(*
let empty_table () =
Path_indexing.PSTrie.empty
;;
and in_index = Path_indexing.in_index;;
let get_candidates mode trie term =
- let res =
- let s =
- match mode with
- | Matching -> Path_indexing.retrieve_generalizations trie term
- | Unification -> Path_indexing.retrieve_unifiables trie term
- in
- Path_indexing.PosEqSet.elements s
+ let s =
+ match mode with
+ | Matching -> Path_indexing.retrieve_generalizations trie term
+ | Unification -> Path_indexing.retrieve_unifiables trie term
in
- print_candidates mode term res;
- res
+ Path_indexing.PosEqSet.elements s
;;
-*)
+(*
let empty_table () =
Discrimination_tree.DiscriminationTree.empty
;;
(* print_candidates mode term res; *)
res
;;
+*)
let rec find_matches metasenv context ugraph lift_amount term =
let module S = CicSubstitution in
let module M = CicMetaSubst in
let module HL = HelmLibraryObjects in
+ let candidates = get_candidates Matching table term in
match term with
| C.Meta _ -> None
| term ->
- let candidates = get_candidates Matching table term in
let res =
find_matches metasenv context ugraph lift_amount term candidates
in
let module S = CicSubstitution in
let module M = CicMetaSubst in
let module HL = HelmLibraryObjects in
+ let candidates = get_candidates Unification table term in
let res, lifted_term =
match term with
| C.Meta (i, l) ->
match term with
| C.Meta _ -> res, lifted_term
| term ->
- let candidates = get_candidates Unification table term in
let r =
find_all_matches metasenv context ugraph lift_amount term candidates
in
module PSMap = Map.Make(OrderedPathStringElement);;
+(* module PSTrie = Trie.Make(PathStringElementMap);; *)
+
module OrderedPosEquality = struct
type t = Utils.pos * Inference.equality
module PosEqSet = Set.Make(OrderedPosEquality);;
-module PSTrie = Trie.Make(PSMap);;
-
-(*
(*
* Trie: maps over lists.
* Copyright (C) 2000 Jean-Christophe FILLIATRE
traverse [] t acc
end
-*)
let index trie equality =
let w, s, l = picka w s tl in
w, s, hd::l
else
- 0, s, []
+ 0, s, l
in
let in_age, ns, nl = picka in_age ns nl in
let _, ps, pl = picka in_age ps pl in
let get_selection_estimate () =
elapsed_time := (Unix.gettimeofday ()) -. !start_time;
+(* !processed_clauses * (int_of_float (!time_limit /. !elapsed_time)) *)
int_of_float (
ceil ((float_of_int !processed_clauses) *.
(!time_limit /. !elapsed_time -. 1.)))