]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/tactics/ring.ml
s/List.find.../CicUtil.lookup_meta/
[helm.git] / helm / ocaml / tactics / ring.ml
index 8e592e61d842322d4173bc0e0b6dd6420a50abdc..bd9c1513661ba61d6abc8561cbb1ced948e7594e 100644 (file)
@@ -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