X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2Focaml%2Ftactics%2Ffilter_auto.ml;fp=helm%2Focaml%2Ftactics%2Ffilter_auto.ml;h=6fae7b7377aa0c1f88794e19a75eb6b3c477be56;hp=0000000000000000000000000000000000000000;hb=6150b8ef905aaea17b47ff466c067054f976cd8f;hpb=bd59745a232bff0e941e97170b88709d0ff6fdf2 diff --git a/helm/ocaml/tactics/filter_auto.ml b/helm/ocaml/tactics/filter_auto.ml new file mode 100644 index 000000000..6fae7b737 --- /dev/null +++ b/helm/ocaml/tactics/filter_auto.ml @@ -0,0 +1,65 @@ +(* Copyright (C) 2000-2002, HELM Team. + * + * This file is part of HELM, an Hypertextual, Electronic + * Library of Mathematics, developed at the Computer Science + * Department, University of Bologna, Italy. + * + * HELM is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * HELM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with HELM; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + * + * For details, see the HELM World-Wide-Web page, + * http://cs.unibo.it/helm/. + *) + + +let in_hypothesis = "'http://www.cs.unibo.it/helm/schemas/schema-helm#InHypothesis'" ;; + +let main_hypothesis = "'http://www.cs.unibo.it/helm/schemas/schema-helm#MainHypothesis'" ;; + +let main_conclusion = "'http://www.cs.unibo.it/helm/schemas/schema-helm#MainConclusion'" ;; + +let in_conclusion = "'http://www.cs.unibo.it/helm/schemas/schema-helm#InConclusion'" ;; + + +let hyp_const (conn:Mysql.dbd) uri = + (*query to obtain all the constants in the hypothesis 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); + let result = Mysql.exec conn query in + (* now we transform the result in a set *) + let f a = + match (Array.to_list a) with + [Some uri] -> uri + | _ -> assert false in + let result = Mysql.map ~f:f result in + List.fold_left + (fun set uri -> + NewConstraints.StringSet.add uri set) + NewConstraints.StringSet.empty result +;; + +(* for each uri check if its costants are a subset of + const, the set of the costants of the proof *) +let filter_new_constants (conn:Mysql.dbd) const (_,uri) = + let hyp = hyp_const conn uri in + prerr_endline (NewConstraints.pp_StringSet hyp); + NewConstraints.StringSet.subset hyp const +;; + + +