]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/ng_tactics/declarative.ml
Use of standard OCaml syntax
[helm.git] / matita / components / ng_tactics / declarative.ml
index d96e6681109893d201d1ffa93d057742dd9238df..7ff18acdebb56ff87810ca06e120925a334c2060 100644 (file)
@@ -169,7 +169,7 @@ let beta_rewriting_step t status =
     (
       let newhypo = status_parameter "volatile_newhypo" status in
       if newhypo = "" then
-        fail (lazy "Invalid use of 'or equivalently'")
+        fail (lazy "Invalid use of 'that is equivalent to'")
       else
         change_tac ~where:("",0,(None,[newhypo,Ast.UserInput],None)) ~with_what:t status
     )
@@ -430,7 +430,7 @@ let add_names_to_goals_tac (cl:NCic.constructor list ref) (status:#NTacStatus.ta
           [] -> []
         | hd :: tl -> if n = 0 then [] else hd :: (sublist (n-1) tl)
       in
-      List.map (fun _,sw -> goal_of_switch sw) (sublist (List.length !cl) g)
+      List.map (fun (_,sw) -> goal_of_switch sw) (sublist (List.length !cl) g)
   in
   let rec add_names_to_goals g cl metasenv =
     match g,cl with
@@ -538,7 +538,11 @@ let we_proceed_by_cases_on ((txt,len,ast1) as t1)  t2 status =
   | FirstTypeWrong -> fail (lazy "What you want to prove is different from the conclusion")
 ;;
 
-let byinduction t1 id = suppose t1 id ;;
+let byinduction t1 id status =
+  let ctx = status_parameter "context" status in
+  if ctx <> "induction" then fail (lazy "You can't use this tactic outside of an induction context")
+  else suppose t1 id status
+;;
 
 let name_of_conj conj =
   let mattrs,_,_ = conj in
@@ -586,8 +590,7 @@ let focus_on_case_tac case status =
       let loc = 
         try 
           loc_of_goal goal_to_focus t 
-        with _ -> fail (lazy "The given case is not part of the current induction/cases analysis
-        context")
+        with _ -> fail (lazy "The given case is not part of the current induction/cases analysis context")
       in
       let curloc = if has_focused_goal status then 
           let goal = extract_first_goal_from_status status in
@@ -601,8 +604,7 @@ let focus_on_case_tac case status =
 
 let case id l status =
   let ctx = status_parameter "context" status in
-  if ctx <> "induction" && ctx <> "cases" then fail (lazy "You can't use case outside of an
-  induction/cases analysis context")
+  if ctx <> "induction" && ctx <> "cases" then fail (lazy "You can't use case outside of an induction/cases analysis context")
 else
   (
     if has_focused_goal status then fail (lazy "Finish the current case before switching")