let in_conclusion = "'http://www.cs.unibo.it/helm/schemas/schema-helm#InConclusion'" ;;
+let in_body = "'http://www.cs.unibo.it/helm/schemas/schema-helm#InBody'";;
+
let escape = Str.global_replace (Str.regexp_string "\'") "\\'";;
let hyp_const (conn:Mysql.dbd) uri =
(*query to obtain all the constants in the hypothesis and conclusion of the theorem*)
let query =
"select h_occurrence from refObj where source='"^uri^
- "' and (h_position="^main_hypothesis^" or h_position="^in_hypothesis^
- "or h_position="^main_conclusion^" or h_position="^in_conclusion^")" in
-(* prerr_endline ("$$$$$$$$$$$$$$$"^query);*)
+ "' and (not (h_position ="^in_body^"))" in
+ (*prerr_endline ("$$$$$$$$$$$$$$$"^query);*)
let result = Mysql.exec conn query in
(* now we transform the result in a set *)
let f a =
let refObjn = "refObj" ^ (string_of_int n) in
let new_must =
[ refObjn^".h_occurrence = '" ^ uri ^ "'";
- "("^refObjn^".h_position = " ^ main_conclusion^ " or "
- ^refObjn^".h_position = " ^ in_conclusion^ " or "
- ^refObjn^".h_position = " ^ main_hypothesis^ " or "
- ^refObjn^".h_position = " ^ in_hypothesis^ ")"] in
+ "(not ("^refObjn^".h_position ="^in_body^"))"] in
let where' =
if n = 0 then new_must@where
else
in
let from = String.concat "," from in
let where = String.concat " and " where in
- let query = "select refObj0.source from " ^ from ^ " where " ^ where in
- (* prerr_endline query;*)
+ let query = "select distinct(refObj0.source) from " ^ from ^ " where " ^ where in
+ (* prerr_endline query;*)
Mysql.exec conn query
;;
("no_inconcl_aux.source = refObj0.source")::where) in
let from = String.concat "," from in
let where = String.concat " and " where in
- let query = "select refObj0.source from " ^ from ^ " where " ^ where in
- prerr_endline query;
+ let query =
+ "select refObj0.source from " ^ from ^ " where " ^ where in
+ (* prerr_endline query;*)
Mysql.exec conn query
;;
let len = String.length s in
let suffix = String.sub s (len-4) 4 in
not (suffix = ".var") in
- let uris = List.filter isvar uris in
+ let uris = List.filter isvar uris in
(* delete all not "cic:/Coq" uris *)
(*
let uris =
*)
(* concl_cost are the costants in the conclusion of the proof
while hyp_const are the constants in the hypothesis *)
- let (_,concl_const) = NewConstraints.constants_of ty in
+ let concl_const = NewConstraints.constants_concl ty in
prerr_endline ("Ne sono rimasti " ^ string_of_int (List.length uris));
let hyp t set =
match t with