| Check of loc * 'term
| Hint of loc
| Match of loc * 'term
+ | Instance of loc * 'term
| Quit of loc
| Redo of loc * int option
| Undo of loc * int option
metadataExtractor.cmx: metadataTypes.cmx metadataExtractor.cmi
metadataPp.cmo: metadataTypes.cmi metadataPp.cmi
metadataPp.cmx: metadataTypes.cmx metadataPp.cmi
-metadataDb.cmo: metadataTypes.cmi metadataPp.cmi metadataExtractor.cmi \
- metadataDb.cmi
-metadataDb.cmx: metadataTypes.cmx metadataPp.cmx metadataExtractor.cmx \
- metadataDb.cmi
metadataConstraints.cmo: metadataTypes.cmi metadataPp.cmi \
metadataConstraints.cmi
metadataConstraints.cmx: metadataTypes.cmx metadataPp.cmx \
metadataConstraints.cmi
+metadataDb.cmo: metadataTypes.cmi metadataPp.cmi metadataExtractor.cmi \
+ metadataConstraints.cmi metadataDb.cmi
+metadataDb.cmx: metadataTypes.cmx metadataPp.cmx metadataExtractor.cmx \
+ metadataConstraints.cmx metadataDb.cmi
let (n,from,where) =
List.fold_left (add_constraint tables) (0,[],[]) metadata
in
+ let selected = if metadata = [] then count_tbl else "table0" in
let (n,from,where) =
add_all_constr count_tbl (n,from,where) concl_card full_card diff
in
let where = String.concat " and " where in
let query =
match rating with
- | None -> sprintf "select table0.source from %s where %s" from where
+ | None -> sprintf "select %s.source from %s where %s" selected from where
| Some `Hits ->
sprintf
- ("select table0.source from %s, hits where %s"
- ^^ " and hits.source = table0.source order by hits.no desc")
- from where
+ ("select %s.source from %s, hits where %s"
+ ^^ " and hits.source = %s.source order by hits.no desc")
+ selected from where selected
in
prerr_endline query;
let result = Mysql.exec dbd query in
val unindex: dbd:Mysql.dbd -> uri:UriManager.uri -> unit
+val count_distinct:
+ [ `Conclusion | `Hypothesis | `Statement] ->
+ MetadataTypes.metadata list ->
+ int
function
Cic.Lambda (n,s,t) ->
let dummy_uri =
- UriManager.uri_of_string ("dummy_"^(string_of_int i)) in
+ UriManager.uri_of_string ("cic:/dummy_"^(string_of_int i)) in
(aux (i+1) (CicSubstitution.subst (Cic.Const(dummy_uri,[])) t))
| t -> t
in aux 0 t
let no_full = MetadataDb.count_distinct `Statement metadata in
let is_dummy =
function
- `Obj(s, _) -> (String.sub s 0 5) = "dummy"
+ `Obj(s, _) -> (String.sub s 0 10) <> "cic:/dummy"
| _ -> false in
let metadata = List.filter is_dummy metadata in
let constraints = List.map MetadataTypes.constr_of_metadata metadata in