X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Ftactics%2Fring.ml;h=bd9c1513661ba61d6abc8561cbb1ced948e7594e;hb=0b77495c722e0c26ac243f27abb7208b6c37dede;hp=8e592e61d842322d4173bc0e0b6dd6420a50abdc;hpb=17f33fa8cb65de1f3edcba6ac750bbdb4d061117;p=helm.git diff --git a/helm/ocaml/tactics/ring.ml b/helm/ocaml/tactics/ring.ml index 8e592e61d..bd9c15136 100644 --- a/helm/ocaml/tactics/ring.ml +++ b/helm/ocaml/tactics/ring.ml @@ -125,20 +125,6 @@ let cic_is_const ?(uri: uri option = None) term = *) let uri_of_proof ~proof:(uri, _, _, _) = uri - (** - @param metano meta list index - @param metasenv meta list (environment) - @raise Failure if metano is not found in metasenv - @return conjecture corresponding to metano in metasenv - *) -let conj_of_metano metano = - try - List.find (function (m, _, _) -> m = metano) - with Not_found -> - failwith ( - "Ring.conj_of_metano: " ^ - (string_of_int metano) ^ " no such meta") - (** @param status current proof engine status @raise Failure if proof is None @@ -153,7 +139,7 @@ let metasenv_of_status ~status:((_,m,_,_), _) = m *) let context_of_status ~status:(proof, goal as status) = let metasenv = metasenv_of_status ~status:status in - let _, context, _ = List.find (function (m,_,_) -> m=goal) metasenv in + let _, context, _ = CicUtil.lookup_meta goal metasenv in context (** CIC TERM CONSTRUCTORS *) @@ -448,7 +434,7 @@ let purge_hyps_tac ~count ~status:(proof, goal as status) = | (_, []) -> failwith "Ring.purge_hyps_tac: no hypotheses left" in let (_, metasenv, _, _) = proof in - let (_, context, _) = conj_of_metano goal metasenv in + let (_, context, _) = CicUtil.lookup_meta goal metasenv in let proof',goal' = aux count context status in assert (goal = goal') ; proof',[goal'] @@ -464,7 +450,7 @@ let ring_tac ~status:((proof, goal) as status) = let eqt = mkMutInd (Logic_Type.eqt_URI, 0) [] in let r = Reals.r in let metasenv = metasenv_of_status ~status in - let (metano, context, ty) = conj_of_metano goal metasenv in + let (metano, context, ty) = CicUtil.lookup_meta goal metasenv in let (t1, t2) = split_eq ty in (* goal like t1 = t2 *) match (build_segments ~terms:[t1; t2]) with | (t1', t1'', t1'_eq_t1'')::(t2', t2'', t2'_eq_t2'')::[] -> begin