]> matita.cs.unibo.it Git - helm.git/blob - matita/components/ng_tactics/declarative.ml
Change Sort.merge (deprecated) with List.merge
[helm.git] / matita / components / ng_tactics / declarative.ml
1 (* Copyright (C) 2019, HELM Team.
2  *
3  * This file is part of HELM, an Hypertextual, Electronic
4  * Library of Mathematics, developed at the Computer Science
5  * Department, University of Bologna, Italy.
6  *
7  * HELM is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * HELM is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with HELM; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20  * MA  02111-1307, USA.
21  *
22  * For details, see the HELM World-Wide-Web page,
23  * http://cs.unibo.it/helm/.
24 *)
25
26 open Continuationals.Stack
27 module Ast = NotationPt
28 open NTactics
29 open NTacStatus
30
31 type just = [ `Term of NTacStatus.tactic_term | `Auto of NnAuto.auto_params ]
32
33 let mk_just status goal =
34   function
35     `Auto (l,params) -> NnAuto.auto_lowtac ~params:(l,params) status goal
36   | `Term t -> apply_tac t
37
38 exception NotAProduct
39 exception FirstTypeWrong
40 exception NotEquivalentTypes
41
42 let extract_first_goal_from_status status =
43   let s = status#stack in
44   match s with
45   | [] -> fail (lazy "There's nothing to prove")
46   | (g1, _, k, tag1, _) :: tl ->
47     let goals = filter_open g1 in
48     match goals with
49       [] -> fail (lazy "No goals under focus")
50     | loc::tl -> 
51       let goal = goal_of_loc (loc) in
52       goal ;;
53
54 let extract_conclusion_type status goal =
55   let gty = get_goalty status goal in
56   let ctx = ctx_of gty in
57   let status,gty = term_of_cic_term status gty ctx in
58   gty
59 ;;
60
61 let alpha_eq_tacterm_kerterm ty t status goal =
62   let gty = get_goalty status goal in
63   let ctx = ctx_of gty in
64   let status,cicterm = disambiguate status ctx ty `XTNone (*(`XTSome (mk_cic_term ctx t))*) in
65   let (_,_,metasenv,subst,_) = status#obj in
66   let status,ty = term_of_cic_term status cicterm ctx in
67   if NCicReduction.alpha_eq status metasenv subst ctx t ty then
68     true
69   else
70     false
71 ;;
72
73 let are_convertible ty1 ty2 status goal =
74   let gty = get_goalty status goal in
75   let ctx = ctx_of gty in
76   let status,cicterm1 = disambiguate status ctx ty1 `XTNone in
77   let status,cicterm2 = disambiguate status ctx ty2 `XTNone in
78   NTacStatus.are_convertible status ctx cicterm1 cicterm2
79
80 let clear_volatile_params_tac status =
81   match status#stack with
82     [] -> fail (lazy "Empty stack")
83   | (g,t,k,tag,p)::tl -> 
84     let rec remove_volatile = function
85         [] -> []
86       | (k,v as hd')::tl' ->
87         let re = Str.regexp "volatile_.*" in
88         if Str.string_match re k 0 then
89           remove_volatile tl'
90         else
91           hd'::(remove_volatile tl')
92     in
93     let newp = remove_volatile p in
94     status#set_stack ((g,t,k,tag,newp)::tl)
95 ;;
96
97 let add_parameter_tac key value status =
98   match status#stack with
99     [] -> status
100   | (g,t,k,tag,p) :: tl -> status#set_stack ((g,t,k,tag,(key,value)::p)::tl)
101 ;;
102
103
104 (* LCF-like tactic that checks whether the conclusion of the sequent of the given goal is a product, checks that
105    the type of the conclusion's bound variable is the same as t1 and then uses an exact_tac with
106    \lambda id: t1. ?. If a t2 is given it checks that t1 ~_{\beta} t2 and uses and exact_tac with \lambda id: t2. ?
107 *)
108 let lambda_abstract_tac id t1 status goal =
109   match extract_conclusion_type status goal with
110   | NCic.Prod (_,t,_) ->
111     if alpha_eq_tacterm_kerterm t1 t status goal then
112       let (_,_,t1) = t1 in
113       block_tac [exact_tac ("",0,(Ast.Binder (`Lambda,(Ast.Ident (id,None),Some t1),Ast.Implicit
114                                                 `JustOne))); clear_volatile_params_tac;
115                  add_parameter_tac "volatile_newhypo" id] status
116     else
117       raise FirstTypeWrong
118   | _ -> raise NotAProduct
119
120 let assume name ty status =
121   let goal = extract_first_goal_from_status status in
122   try lambda_abstract_tac name ty status goal
123   with
124   | NotAProduct -> fail (lazy "You can't assume without an universal quantification")
125   | FirstTypeWrong ->  fail (lazy "The assumed type is wrong")
126   | NotEquivalentTypes -> fail (lazy "The two given types are not equivalent")
127 ;;
128
129 let suppose t1 id status =
130   let goal = extract_first_goal_from_status status in
131   try lambda_abstract_tac id t1 status goal
132   with
133   | NotAProduct -> fail (lazy "You can't suppose without a logical implication")
134   | FirstTypeWrong ->  fail (lazy "The supposed proposition is different from the premise")
135   | NotEquivalentTypes -> fail (lazy "The two given propositions are not equivalent")
136 ;;
137
138 let assert_tac t1 t2 status goal continuation =
139   let t = extract_conclusion_type status goal in
140   if alpha_eq_tacterm_kerterm t1 t status goal then
141     match t2 with
142     | None -> continuation
143     | Some t2 ->
144       let status,res = are_convertible t1 t2 status goal in
145       if res then continuation
146       else
147         raise NotEquivalentTypes
148   else
149     raise FirstTypeWrong
150
151 let branch_dot_tac status =
152   match status#stack with 
153     ([],t,k,tag,p) :: tl ->
154     if List.length t > 0 then
155       status#set_stack (([List.hd t],List.tl t,k,tag,p)::tl)
156     else
157       status
158   | _ -> status
159 ;;
160
161 let status_parameter key status =
162   match status#stack with
163     [] -> ""
164   | (g,t,k,tag,p)::_ -> try List.assoc key p with _ -> ""
165 ;;
166
167 let beta_rewriting_step t status =
168   let ctx = status_parameter "volatile_context" status in
169   if ctx <> "beta_rewrite" then 
170     (
171       let newhypo = status_parameter "volatile_newhypo" status in
172       if newhypo = "" then
173         fail (lazy "Invalid use of 'or equivalently'")
174       else
175         change_tac ~where:("",0,(None,[newhypo,Ast.UserInput],None)) ~with_what:t status
176     )
177   else
178     change_tac ~where:("",0,(None,[],Some
179                                Ast.UserInput)) ~with_what:t status
180 ;;
181
182 let done_continuation status =
183   let rec continuation l =
184     match l with
185       [] -> []
186     | (_,t,_,tag,p)::tl ->
187       if tag = `BranchTag then
188         if List.length t > 0 then
189           let continue =
190             let ctx =
191               try List.assoc "context" p
192               with Not_found -> ""
193             in
194               ctx <> "induction" && ctx <> "cases"
195           in
196           if continue then [clear_volatile_params_tac;branch_dot_tac] else
197             [clear_volatile_params_tac]
198         else 
199           [merge_tac] @ (continuation tl)
200       else
201         []
202   in
203     continuation status#stack
204 ;;
205
206 let bydone just status =
207   let goal = extract_first_goal_from_status status in
208   let continuation = done_continuation status in
209   let l = [mk_just status goal just] @ continuation in
210   block_tac l status
211 ;;
212
213 let push_goals_tac status = 
214   match status#stack with
215     [] -> fail (lazy "Error pushing goals")
216   | (g1,t1,k1,tag1,p1) :: (g2,t2,k2,tag2,p2) :: tl ->
217     if List.length g2 > 0 then
218       status#set_stack ((g1,t1 @+ g2,k1,tag1,p1) :: ([],t2,k2,tag2,p2) :: tl)
219     else status (* Nothing to push *)
220   | _ -> status
221
222 let we_need_to_prove t id status =
223   let goal = extract_first_goal_from_status status in
224   match id with
225   | None ->
226     (
227       try assert_tac t None status goal (add_parameter_tac "volatile_context" "beta_rewrite" status)
228       with
229       | FirstTypeWrong -> fail (lazy "The given proposition is not the same as the conclusion")
230     )
231   | Some id ->
232     (
233       block_tac [clear_volatile_params_tac; cut_tac t; branch_tac; shift_tac; intro_tac id; merge_tac; branch_tac;
234                  push_goals_tac; add_parameter_tac "volatile_context" "beta_rewrite"
235                           ] status
236     )
237 ;;
238
239 let by_just_we_proved just ty id status =
240   let goal = extract_first_goal_from_status status in
241   let wrappedjust = just in
242   let just = mk_just status goal just in
243   match id with
244   | None ->
245     assert_tac ty None status goal (block_tac [clear_volatile_params_tac; add_parameter_tac
246                                                  "volatile_context" "beta_rewrite"] status)
247   | Some id ->
248     (
249       block_tac [cut_tac ty; branch_tac; just; shift_tac; intro_tac id; merge_tac;
250                  clear_volatile_params_tac; add_parameter_tac "volatile_newhypo" id] status
251     )
252 ;;
253
254 let existselim just id1 t1 t2 id2 status =
255   let goal = extract_first_goal_from_status status in
256   let (_,_,t1) = t1 in
257   let (_,_,t2) = t2 in
258   let just = mk_just status goal just in
259   (block_tac [
260       cut_tac ("",0,(Ast.Appl [Ast.Ident ("ex",None); t1; Ast.Binder (`Lambda,(Ast.Ident
261                                                                                  (id1,None), Some t1),t2)]));
262       branch_tac ~force:false;
263       just;
264       shift_tac;
265       case1_tac "_";
266       intros_tac ~names_ref:(ref []) [id1;id2];
267       merge_tac;
268       clear_volatile_params_tac
269     ]) status
270 ;;
271
272 let andelim just t1 id1 t2 id2 status =
273   let goal = extract_first_goal_from_status status in
274   let (_,_,t1) = t1 in
275   let (_,_,t2) = t2 in
276   let just = mk_just status goal just in
277   (block_tac [
278       cut_tac ("",0,(Ast.Appl [Ast.Ident ("And",None); t1 ; t2]));
279       branch_tac ~force:false;
280       just;
281       shift_tac;
282       case1_tac "_";
283       intros_tac ~names_ref:(ref []) [id1;id2];
284       merge_tac;
285       clear_volatile_params_tac
286     ]) status
287 ;;
288
289 let type_of_tactic_term status ctx t =
290   let status,cicterm = disambiguate status ctx t `XTNone in
291   let (_,cicty) = typeof status ctx cicterm in
292   cicty
293
294 let swap_first_two_goals_tac status =
295   let gstatus =
296     match status#stack with
297     | [] -> assert false
298     | (g,t,k,tag,p) :: s ->
299       match g with
300       | (loc1) :: (loc2) :: tl ->
301         ([loc2;loc1] @+ tl,t,k,tag,p) :: s
302       | _ -> assert false
303   in
304   status#set_stack gstatus
305
306 let thesisbecomes t1 = we_need_to_prove t1 None
307 ;;
308
309 let obtain id t1 status =
310   let goal = extract_first_goal_from_status status in
311   let cicgty = get_goalty status goal in
312   let ctx = ctx_of cicgty in
313   let cicty = type_of_tactic_term status ctx t1 in
314   let _,ty = term_of_cic_term status cicty ctx in
315   let (_,_,t1) = t1 in
316   block_tac [ cut_tac ("",0,(Ast.Appl [Ast.Ident ("eq",None); Ast.NCic ty; t1; Ast.Implicit
317                                          `JustOne]));
318               swap_first_two_goals_tac;
319               branch_tac; shift_tac; shift_tac; intro_tac id; merge_tac; branch_tac; push_goals_tac;
320               add_parameter_tac "volatile_context" "rewrite"
321             ]
322     status
323 ;;
324
325 let conclude t1 status =
326   let goal = extract_first_goal_from_status status in
327   let cicgty = get_goalty status goal in
328   let ctx = ctx_of cicgty in
329   let _,gty = term_of_cic_term status cicgty ctx in
330   match gty with
331     (* The first term of this Appl should probably be "eq" *)
332     NCic.Appl [_;_;plhs;_] ->
333     if alpha_eq_tacterm_kerterm t1 plhs status goal then
334       add_parameter_tac "volatile_context" "rewrite" status
335     else
336       fail (lazy "The given conclusion is different from the left-hand side of the current conclusion")
337   | _ -> fail (lazy "Your conclusion needs to be an equality")
338 ;;
339
340 let rewritingstep rhs just last_step status =
341   let ctx = status_parameter "volatile_context" status in
342   if ctx = "rewrite" then 
343     (
344       let goal = extract_first_goal_from_status status in
345       let cicgty = get_goalty status goal in
346       let ctx = ctx_of cicgty in
347       let _,gty = term_of_cic_term status cicgty ctx in
348       let cicty = type_of_tactic_term status ctx rhs in
349       let _,ty = term_of_cic_term status cicty ctx in
350       let just' = (* Extraction of the ""justification"" from the ad hoc justification *)
351         match just with
352           `Auto (univ, params) ->
353           let params =
354             if not (List.mem_assoc "timeout" params) then
355               ("timeout","3")::params
356             else params
357           in
358           let params' =
359             if not (List.mem_assoc "paramodulation" params) then
360               ("paramodulation","1")::params
361             else params
362           in
363           if params = params' then NnAuto.auto_lowtac ~params:(univ, params) status goal
364           else
365             first_tac [NnAuto.auto_lowtac ~params:(univ, params) status goal; NnAuto.auto_lowtac
366                          ~params:(univ, params') status goal]
367         | `Term just -> apply_tac just
368         | `SolveWith term -> NnAuto.demod_tac ~params:(Some [term], ["all","1";"steps","1"; "use_ctx","false"])
369         | `Proof -> id_tac
370       in
371       let plhs,prhs,prepare =
372         match gty with (* Extracting the lhs and rhs of the previous equality *)
373           NCic.Appl [_;_;plhs;prhs] -> plhs,prhs,(fun continuation -> continuation status)
374         | _ -> fail (lazy "You are not building an equaility chain")
375       in
376       let continuation =
377         if last_step then
378           let todo = [just'] @ (done_continuation status) in
379           block_tac todo
380         else
381           let (_,_,rhs) = rhs in
382           block_tac [apply_tac ("",0,Ast.Appl [Ast.Ident ("trans_eq",None); Ast.NCic ty; Ast.NCic plhs;
383                                                rhs; Ast.NCic prhs]); branch_tac; just'; merge_tac]
384       in
385       prepare continuation
386     )
387   else
388     fail (lazy "You are not building an equality chain")
389 ;;
390
391 let rec pp_metasenv_names (metasenv:NCic.metasenv) =
392   match metasenv with
393     [] -> ""
394   | hd :: tl ->
395     let n,conj = hd in
396     let meta_attrs,_,_ = conj in
397     let rec find_name_aux meta_attrs = match meta_attrs with
398         [] -> "Anonymous"
399       | hd :: tl -> match hd with
400           `Name n -> n
401         | _ -> find_name_aux tl
402     in
403     let name = find_name_aux meta_attrs
404     in
405     "[Goal: " ^ (string_of_int n) ^ ", Name: " ^ name ^ "]; " ^ (pp_metasenv_names tl)
406 ;;
407
408 let print_goals_names_tac s (status:#NTacStatus.tac_status) =
409   let (_,_,metasenv,_,_) = status#obj in
410   prerr_endline (s ^" -> Metasenv: " ^ (pp_metasenv_names metasenv)); status
411
412 (* Useful as it does not change the order in the list *)
413 let rec list_change_assoc k v = function
414     [] -> []
415   | (k',v' as hd) :: tl -> if k' = k then (k',v) :: tl else hd :: (list_change_assoc k v tl)
416 ;;
417
418 let add_names_to_goals_tac (cl:NCic.constructor list ref) (status:#NTacStatus.tac_status) =
419   let add_name_to_goal name goal metasenv =
420     let (mattrs,ctx,t as conj) = try List.assoc goal metasenv with _ -> assert false in
421     let mattrs = (`Name name) :: (List.filter (function `Name _ -> false | _ -> true) mattrs) in
422     let newconj = (mattrs,ctx,t) in
423     list_change_assoc goal newconj metasenv
424   in
425   let new_goals =
426     (* It's important that this tactic is called before branching and right after the creation of
427      * the new goals, when they are still under focus *)
428     match status#stack with
429       [] -> fail (lazy "Can not add names to an empty stack")
430     | (g,_,_,_,_) :: tl -> 
431       let rec sublist n = function
432           [] -> []
433         | hd :: tl -> if n = 0 then [] else hd :: (sublist (n-1) tl)
434       in
435       List.map (fun _,sw -> goal_of_switch sw) (sublist (List.length !cl) g)
436   in
437   let rec add_names_to_goals g cl metasenv =
438     match g,cl with
439       [],[] -> metasenv
440     | hd::tl, (_,consname,_)::tl' -> 
441       add_names_to_goals tl tl' (add_name_to_goal consname hd metasenv)
442     | _,_ -> fail (lazy "There are less goals than constructors")
443   in
444   let (olduri,oldint,metasenv,oldsubst,oldkind) = status#obj in
445   let newmetasenv = add_names_to_goals new_goals !cl metasenv
446   in status#set_obj(olduri,oldint,newmetasenv,oldsubst,oldkind)
447 ;;
448 (*
449   let (olduri,oldint,metasenv,oldsubst,oldkind) = status#obj in
450   let remove_name_from_metaattrs =
451    List.filter (function `Name _ -> false | _ -> true) in
452   let rec add_names_to_metasenv cl metasenv =
453     match cl,metasenv with
454       [],_ -> metasenv
455     | hd :: tl, mhd :: mtl ->
456       let _,consname,_ = hd in
457         let gnum,conj = mhd in
458         let mattrs,ctx,t = conj in
459         let mattrs = [`Name consname] @ (remove_name_from_metaattrs mattrs)
460         in
461         let newconj = mattrs,ctx,t in
462         let newmeta = gnum,newconj in
463         newmeta :: (add_names_to_metasenv tl mtl)
464     | _,[] -> assert false
465   in
466   let newmetasenv = add_names_to_metasenv !cl metasenv in
467   status#set_obj (olduri,oldint,newmetasenv,oldsubst,oldkind)
468 *)
469
470 let unfocus_branch_tac status =
471   match status#stack with
472     [] -> status
473   | (g,t,k,tag,p) :: tl -> status#set_stack (([],g @+ t,k,tag,p)::tl)
474 ;;
475
476 let we_proceed_by_induction_on t1 t2 status =
477   let goal = extract_first_goal_from_status status in
478   let txt,len,t1 = t1 in
479   let t1 = txt, len, Ast.Appl [t1; Ast.Implicit `Vector] in
480   let indtyinfo = ref None in
481   let sort = ref (NCic.Rel 1) in
482   let cl = ref [] in (* this is a ref on purpose, as the block of code after sort_of_goal_tac in
483   block_tac acts as a block of asynchronous code, in which cl gets modified with the info retrieved
484   with analize_indty_tac, and later used to label each new goal with a costructor name. Using a
485   plain list this doesn't seem to work, as add_names_to_goals_tac would immediately act on an empty
486   list, instead of acting on the list of constructors *)
487   try
488     assert_tac t2 None status goal (block_tac [
489         analyze_indty_tac ~what:t1 indtyinfo;
490         sort_of_goal_tac sort;
491         (fun status ->
492            let ity = HExtlib.unopt !indtyinfo in
493            let NReference.Ref (uri, _) = ref_of_indtyinfo ity in
494            let name =
495              NUri.name_of_uri uri ^ "_" ^
496              snd (NCicElim.ast_of_sort
497                     (match !sort with NCic.Sort x -> x | _ -> assert false))
498            in
499            let eliminator =
500              let l = [Ast.Ident (name,None)] in
501              (* Generating an implicit for each argument of the inductive type, plus one the
502               * predicate, plus an implicit for each constructor of the inductive type *)
503              let l = l @ HExtlib.mk_list (Ast.Implicit `JustOne) (ity.leftno+1+ity.consno) in
504              let _,_,t1 = t1 in
505              let l = l @ [t1] in
506              Ast.Appl l
507            in
508            cl := ity.cl;
509            exact_tac ("",0,eliminator) status);
510         add_names_to_goals_tac cl; 
511         branch_tac; 
512         push_goals_tac;
513         unfocus_branch_tac;
514         add_parameter_tac "context" "induction"
515       ] status)
516   with
517   | FirstTypeWrong -> fail (lazy "What you want to prove is different from the conclusion")
518 ;;
519
520 let we_proceed_by_cases_on ((txt,len,ast1) as t1)  t2 status =
521   let goal = extract_first_goal_from_status status in
522   let npt1 = txt, len, Ast.Appl [ast1; Ast.Implicit `Vector] in
523   let indtyinfo = ref None in
524   let cl = ref [] in
525   try
526     assert_tac t2 None status goal (block_tac [
527         analyze_indty_tac ~what:npt1 indtyinfo;
528         cases_tac ~what:t1 ~where:("",0,(None,[],Some
529                                            Ast.UserInput));
530         (
531           fun status ->
532             let ity = HExtlib.unopt !indtyinfo in
533             cl := ity.cl; add_names_to_goals_tac cl status
534         );
535         branch_tac; push_goals_tac;
536         unfocus_branch_tac;
537         add_parameter_tac "context" "cases"
538       ] status)
539   with
540   | FirstTypeWrong -> fail (lazy "What you want to prove is different from the conclusion")
541 ;;
542
543 let byinduction t1 id = suppose t1 id ;;
544
545 let name_of_conj conj =
546   let mattrs,_,_ = conj in
547   let rec search_name mattrs =
548     match mattrs with
549       [] -> "Anonymous"
550     | hd::tl ->
551       match hd with
552         `Name n -> n
553       | _ -> search_name tl
554   in
555   search_name mattrs
556
557 let rec loc_of_goal goal l =
558   match l with
559     [] -> fail (lazy "Reached the end")
560   | hd :: tl ->
561     let _,sw = hd in
562     let g = goal_of_switch sw in
563     if g = goal then hd
564     else loc_of_goal goal tl
565 ;;
566
567 let has_focused_goal status =
568   match status#stack with
569     [] -> false
570   | ([],_,_,_,_) :: tl -> false
571   | _ -> true
572 ;;
573
574 let focus_on_case_tac case status =
575   let (_,_,metasenv,_,_) = status#obj in
576   let rec goal_of_case case metasenv =
577     match metasenv with
578       [] -> fail (lazy "The given case does not exist")
579     | (goal,conj) :: tl ->
580       if name_of_conj conj = case then goal
581       else goal_of_case case tl
582   in
583   let goal_to_focus = goal_of_case case metasenv in
584   let gstatus =
585     match status#stack with
586       [] -> fail (lazy "There is nothing to prove")
587     | (g,t,k,tag,p) :: s ->
588       let loc = 
589         try 
590           loc_of_goal goal_to_focus t 
591         with _ -> fail (lazy "The given case is not part of the current induction/cases analysis
592         context")
593       in
594       let curloc = if has_focused_goal status then 
595           let goal = extract_first_goal_from_status status in
596           [loc_of_goal goal g]
597         else []
598       in
599       (((g @- curloc) @+ [loc]),(curloc @+ (t @- [loc])),k,tag,p) :: s
600   in 
601   status#set_stack gstatus
602 ;;
603
604 let case id l status =
605   let ctx = status_parameter "context" status in
606   if ctx <> "induction" && ctx <> "cases" then fail (lazy "You can't use case outside of an
607   induction/cases analysis context")
608 else
609   (
610     if has_focused_goal status then fail (lazy "Finish the current case before switching")
611     else
612       (
613 (*
614         let goal = extract_first_goal_from_status status in
615         let (_,_,metasenv,_,_) = status#obj in
616         let conj = NCicUtils.lookup_meta goal metasenv in
617         let name = name_of_conj conj in
618 *)
619         let continuation =
620           let rec aux l =
621             match l with
622               [] -> [id_tac]
623             | (id,ty)::tl ->
624               (try_tac (assume id ("",0,ty))) :: (aux tl)
625           in
626           aux l
627         in
628 (*         if name = id then block_tac continuation status *)
629 (*         else  *)
630           block_tac ([focus_on_case_tac id] @ continuation) status
631       )
632   )
633 ;;
634
635 let print_stack status = prerr_endline ("PRINT STACK: " ^ (pp status#stack)); id_tac status ;;
636
637 (* vim: ts=2: sw=0: et:
638  * *)