]> matita.cs.unibo.it Git - helm.git/blobdiff - components/metadata/metadataConstraints.ml
Debugging code is now controlled by the debug flag.
[helm.git] / components / metadata / metadataConstraints.ml
index 6cab493fce46d067aa46c33f93d58d27e0a5d7f7..6c373f18036677cf454d256fd79e264f2161a49e 100644 (file)
@@ -29,7 +29,7 @@ open Printf
 open MetadataTypes 
 
 let critical_value = 7
-let just_factor = 3
+let just_factor = 1
 
 module UriManagerSet = UriManager.UriSet
 module SetSet = Set.Make (UriManagerSet)
@@ -174,17 +174,21 @@ let exec ~(dbd:HMysql.dbd) ?rating (n,from,where) =
 let at_least ~(dbd:HMysql.dbd) ?concl_card ?full_card ?diff ?rating tables
   (metadata: MetadataTypes.constr list)
 =
-  let obj_tbl,rel_tbl,sort_tbl, count_tbl = tables 
-  in
+  let obj_tbl,rel_tbl,sort_tbl, count_tbl = tables in
   if (metadata = []) && concl_card = None && full_card = None then
-    failwith "MetadataQuery.at_least: no constraints given";
-  let (n,from,where) =
-    List.fold_left (add_constraint ~tables) (0,[],[]) metadata
-  in
-  let (n,from,where) =
-    add_all_constr ~tbl:count_tbl (n,from,where) concl_card full_card diff
-  in
-  exec ~dbd ?rating (n,from,where)
+    begin
+      HLog.warn "MetadataConstraints.at_least: no constraints given";
+      []
+    end
+  else
+    let (n,from,where) =
+      List.fold_left (add_constraint ~tables) (0,[],[]) metadata
+    in
+    let (n,from,where) =
+      add_all_constr ~tbl:count_tbl (n,from,where) concl_card full_card diff
+    in
+    exec ~dbd ?rating (n,from,where)
+;;
     
 let at_least  
   ~(dbd:HMysql.dbd) ?concl_card ?full_card ?diff ?rating
@@ -542,7 +546,12 @@ let compute_with_only ~(dbd:HMysql.dbd) ?(facts=false) ?(where = `Conclusion)
           maximal_prefixes)
     in
 (*     Printf.fprintf stderr "all: %d\n" (List.length all);flush_all (); *)
-    List.filter (function (_,uri) -> at_most ~dbd ~where constants uri) all in
+(*
+    List.filter (function (_,uri) -> 
+      at_most ~dbd ~where constants uri) 
+*)
+    all 
+    in
   let equal_to = compute_exactly ~dbd ~facts ~where main prefixes in
     greater_than @ equal_to
 
@@ -620,6 +629,7 @@ let sigmatch ~(dbd:HMysql.dbd) ?(facts=false) ?(where = `Conclusion)
       let types_no = List.length types in
       List.map (function (n,l) -> (n+types_no,types@l)) subsets
     in
+    prerr_endline ("critical_value exceded..." ^ string_of_int constants_no);
     let all_constants = 
      let all = match main with None -> types | Some m -> m::types in
       List.fold_right UriManagerSet.add all constants