]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_tactics/nTactics.ml
Added initial support for inversion principles in Matita NG.
[helm.git] / helm / software / components / ng_tactics / nTactics.ml
index 01a57f0c45fa2851722bfac93e9f4e8bc8afceb6..8887175b4d95a77cf969680b8ce6e9073be9d687 100644 (file)
@@ -87,6 +87,25 @@ let pos_tac i_s status =
    status#set_stack gstatus
 ;;
 
+let case_tac lab status =
+  let gstatus = 
+    match status#stack with
+    | [] -> assert false
+    | ([ loc ], t, [],`BranchTag) :: (g', t', k', tag) :: s
+      when is_fresh loc ->
+        let l_js = List.filter 
+                     (fun curloc -> 
+                        let _,_,metasenv,_,_ = status#obj in
+                        match NCicUtils.lookup_meta (goal_of_loc curloc) metasenv with
+                            Some s,_,_ when s = lab -> true
+                          | _ -> false) ([loc] @+ g') in
+          ((l_js, t , [],`BranchTag)
+           :: (([ loc ] @+ g') @- l_js, t', k', tag) :: s)
+    | _ -> fail (lazy "can't use relative positioning here")
+  in
+   status#set_stack gstatus
+;;
+
 let wildcard_tac status =
   let gstatus = 
     match status#stack with