X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Ftactics%2FvariousTactics.ml;fp=matita%2Fcomponents%2Ftactics%2FvariousTactics.ml;h=0000000000000000000000000000000000000000;hb=0fde70bd19b8fdfa72b807b9713a02ad1bd91b5b;hp=fd383cf99dbe76ee977c3c7fa50a52b7aaf73566;hpb=f61ffe97078aab1e47ee1b7f212e707b0412e77e;p=helm.git diff --git a/matita/components/tactics/variousTactics.ml b/matita/components/tactics/variousTactics.ml deleted file mode 100644 index fd383cf99..000000000 --- a/matita/components/tactics/variousTactics.ml +++ /dev/null @@ -1,58 +0,0 @@ -(* Copyright (C) 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/. - *) - -(* $Id$ *) - - -(* TODO se ce n'e' piu' di una, prende la prima che trova... sarebbe meglio -chiedere: find dovrebbe restituire una lista di hyp (?) da passare all'utonto con una -funzione di callback che restituisce la (sola) hyp da applicare *) - -let assumption_tac = - let module PET = ProofEngineTypes in - let assumption_tac status = - let (proof, goal) = status in - let module C = Cic in - let module R = CicReduction in - let module S = CicSubstitution in - let module PT = PrimitiveTactics in - let _,metasenv,_,_,_, _ = proof in - let _,context,ty = CicUtil.lookup_meta goal metasenv in - let rec find n = function - hd::tl -> - (match hd with - (Some (_, C.Decl t)) when - fst (R.are_convertible context (S.lift n t) ty - CicUniv.oblivion_ugraph) -> n - | (Some (_, C.Def (_,ty'))) when - fst (R.are_convertible context (S.lift n ty') ty - CicUniv.oblivion_ugraph) -> n - | _ -> find (n+1) tl - ) - | [] -> raise (PET.Fail (lazy "Assumption: No such assumption")) - in PET.apply_tactic (PT.apply_tac ~term:(C.Rel (find 1 context))) status - in - PET.mk_tactic assumption_tac -;;