]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_tactics/nTactics.ml
repeat_tac
[helm.git] / helm / software / components / ng_tactics / nTactics.ml
index fc0a8013cca3b09deb1b8ab9703499dc0f66d4f5..e044cd3bf2d194a467036480d6fe0525904c2515 100644 (file)
@@ -601,13 +601,20 @@ let auto ~params:(l,_) status goal =
         (status, (t,ty) :: l))
       (status,[]) l
   in
-  let pt, metasenv, subst = 
-    Paramod.nparamod status metasenv subst (ctx_of gty) (NCic.Rel ~-1,t) l 
-  in      
-  let status = status#set_obj (n,h,metasenv,subst,o) in
-  instantiate status goal (NTacStatus.mk_cic_term (ctx_of gty) pt)
+  match
+    NCicParamod.nparamod status metasenv subst (ctx_of gty) (NCic.Rel ~-1,t) l 
+  with
+  | [] -> raise (NTacStatus.Error (lazy "no proof found",None))
+  | (pt, metasenv, subst)::_ -> 
+      let status = status#set_obj (n,h,metasenv,subst,o) in
+      instantiate status goal (NTacStatus.mk_cic_term (ctx_of gty) pt)
 ;;
 
 let auto_tac ~params status =
   distribute_tac (auto ~params) status
 ;;
+
+let rec repeat_tac t status =
+  try repeat_tac t (atomic_tac t status)
+  with NTacStatus.Error _ -> status
+;;