1 (* Copyright (C) 2002, HELM Team.
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.
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.
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.
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,
22 * For details, see the HELM World-Wide-Web page,
23 * http://cs.unibo.it/helm/.
26 open HelmLibraryObjects
28 let debug_print = fun _ -> ()
30 let rec injection_tac ~term =
31 let injection_tac ~term status =
32 let (proof, goal) = status in
34 let module U = UriManager in
35 let module P = PrimitiveTactics in
36 let module T = Tacticals in
37 let _,metasenv,_,_ = proof in
38 let _,context,_ = CicUtil.lookup_meta goal metasenv in
39 let termty,_ = (* TASSI: FIXME *)
40 CicTypeChecker.type_of_aux' metasenv context term CicUniv.empty_ugraph in
41 ProofEngineTypes.apply_tactic
43 (C.Appl [(C.MutInd (equri, 0, [])) ; tty ; t1 ; t2])
44 when (U.eq equri Logic.eq_URI) -> (
46 (C.MutInd (turi,typeno,exp_named_subst))
47 | (C.Appl (C.MutInd (turi,typeno,exp_named_subst)::_)) -> (
49 ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
50 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
51 when (uri1 = uri2) && (typeno1 = typeno2) &&
52 (consno1 = consno2) && (exp_named_subst1 = exp_named_subst2) ->
53 (* raise (ProofEngineTypes.Fail "Injection: nothing to do") ; *) T.id_tac
54 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::applist1)),
55 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::applist2)))
56 when (uri1 = uri2) && (typeno1 = typeno2) && (consno1 = consno2) && (exp_named_subst1 = exp_named_subst2) ->
57 let rec traverse_list i l1 l2 =
60 | hd1::tl1,hd2::tl2 ->
62 ~start:(injection1_tac ~i ~term)
63 ~continuation:(traverse_list (i+1) tl1 tl2)
64 | _ -> raise (ProofEngineTypes.Fail "Discriminate: i 2 termini hanno in testa lo stesso costruttore, ma applicato a un numero diverso di termini. possibile???") ; T.id_tac
65 in traverse_list 1 applist1 applist2
66 | ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
67 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
68 | ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
69 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::_)))
70 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::_)),
71 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
72 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::_)),
73 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::_)))
74 when (consno1 <> consno2) || (exp_named_subst1 <> exp_named_subst2) ->
75 (* raise (ProofEngineTypes.Fail "Injection: not a projectable equality but a discriminable one") ; *) T.id_tac
76 | _ -> (* raise (ProofEngineTypes.Fail "Injection: not a projectable equality") ; *) T.id_tac
78 | _ -> raise (ProofEngineTypes.Fail "Injection: not a projectable equality")
80 | _ -> raise (ProofEngineTypes.Fail "Injection: not an equation")
83 ProofEngineTypes.mk_tactic (injection_tac ~term)
85 and injection1_tac ~term ~i =
86 let injection1_tac ~term ~i status =
87 let (proof, goal) = status in
88 (* precondizione: t1 e t2 hanno in testa lo stesso costruttore ma differiscono (o potrebbero differire?) nell'i-esimo parametro del costruttore *)
90 let module S = CicSubstitution in
91 let module U = UriManager in
92 let module P = PrimitiveTactics in
93 let module T = Tacticals in
94 let _,metasenv,_,_ = proof in
95 let _,context,_ = CicUtil.lookup_meta goal metasenv in
96 let termty,_ = (* TASSI: FIXME *)
97 CicTypeChecker.type_of_aux' metasenv context term CicUniv.empty_ugraph in
98 match termty with (* an equality *)
99 (C.Appl [(C.MutInd (equri, 0, [])) ; tty ; t1 ; t2])
100 when (U.eq equri Logic.eq_URI) -> (
101 match tty with (* some inductive type *)
102 (C.MutInd (turi,typeno,exp_named_subst))
103 | (C.Appl (C.MutInd (turi,typeno,exp_named_subst)::_)) ->
104 let t1',t2',consno = (* sono i due sottotermini che differiscono *)
106 ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::applist1)),
107 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::applist2)))
108 when (uri1 = uri2) && (typeno1 = typeno2) && (consno1 = consno2) && (exp_named_subst1 = exp_named_subst2) -> (* controllo ridondante *)
109 (List.nth applist1 (i-1)),(List.nth applist2 (i-1)),consno2
113 CicTypeChecker.type_of_aux' metasenv context t1'
114 CicUniv.empty_ugraph in
116 match fst(CicEnvironment.get_obj
117 CicUniv.empty_ugraph turi ) with
118 C.InductiveDefinition (ind_type_list,_,nr_ind_params_dx,_) ->
119 let _,_,_,constructor_list = (List.nth ind_type_list typeno) in
120 let i_constr_id,_ = List.nth constructor_list (consno - 1) in
122 (function (id,cty) ->
123 let reduced_cty = CicReduction.whd context cty in
126 C.Prod (_,_,target) when (k <= nr_ind_params_dx) ->
128 | C.Prod (binder,source,target) when (k > nr_ind_params_dx) ->
132 | C.Anonymous -> C.Name "y"
134 C.Lambda (binder',source,(aux target (k+1)))
136 let nr_param_constr = k - 1 - nr_ind_params_dx in
137 if (id = i_constr_id)
138 then C.Rel (nr_param_constr - i + 1)
139 else S.lift (nr_param_constr + 1) t1' (* + 1 per liftare anche il lambda agguinto esternamente al case *)
143 | _ -> raise (ProofEngineTypes.Fail "Discriminate: object is not an Inductive Definition: it's imposible")
145 ProofEngineTypes.apply_tactic
147 ~start:(P.cut_tac (C.Appl [(C.MutInd (equri,0,[])) ; tty' ; t1' ; t2']))
150 ~start:(injection_tac ~term:(C.Rel 1))
151 ~continuation:T.id_tac (* !!! qui devo anche fare clear di term tranne al primo passaggio *)
154 ~start:(ProofEngineTypes.mk_tactic
156 let (proof, goal) = status in
157 let _,metasenv,_,_ = proof in
158 let _,context,gty = CicUtil.lookup_meta goal metasenv in
161 (C.Appl (C.MutInd (_,_,_)::arglist)) ->
163 | _ -> raise (ProofEngineTypes.Fail "Injection: goal after cut is not correct")
165 ProofEngineTypes.apply_tactic
187 ~start:(EqualityTactics.rewrite_simpl_tac ~term)
188 ~continuation:EqualityTactics.reflexivity_tac
192 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not a discriminable equality")
194 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not an equality")
196 ProofEngineTypes.mk_tactic (injection1_tac ~term ~i)
201 exception TwoDifferentSubtermsFound of int
203 (* term ha tipo t1=t2; funziona solo se t1 e t2 hanno in testa costruttori
206 let discriminate'_tac ~term =
207 let discriminate'_tac ~term status =
208 let (proof, goal) = status in
209 let module C = Cic in
210 let module U = UriManager in
211 let module P = PrimitiveTactics in
212 let module T = Tacticals in
213 let _,metasenv,_,_ = proof in
214 let _,context,_ = CicUtil.lookup_meta goal metasenv in
216 CicTypeChecker.type_of_aux' metasenv context term CicUniv.empty_ugraph in
218 (C.Appl [(C.MutInd (equri, 0, [])) ; tty ; t1 ; t2])
219 when (U.eq equri Logic.eq_URI) -> (
221 (C.MutInd (turi,typeno,exp_named_subst))
222 | (C.Appl (C.MutInd (turi,typeno,exp_named_subst)::_)) ->
224 let consno2 = (* bruuutto: uso un eccezione per terminare con successo! buuu!! :-/ *)
226 let rec traverse t1 t2 =
228 ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
229 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
230 when (uri1 = uri2) && (typeno1 = typeno2) && (consno1 = consno2) && (exp_named_subst1 = exp_named_subst2) ->
232 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::applist1)),
233 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::applist2)))
234 when (uri1 = uri2) && (typeno1 = typeno2) && (consno1 = consno2) && (exp_named_subst1 = exp_named_subst2) ->
235 let rec traverse_list l1 l2 =
238 | hd1::tl1,hd2::tl2 -> traverse hd1 hd2; traverse_list tl1 tl2
239 | _ -> raise (ProofEngineTypes.Fail "Discriminate: i 2 termini hanno in testa lo stesso costruttore, ma applicato a un numero diverso di termini. possibile???")
240 in traverse_list applist1 applist2
242 | ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
243 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
244 | ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
245 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::_)))
246 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::_)),
247 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
248 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::_)),
249 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::_)))
250 when (consno1 <> consno2) || (exp_named_subst1 <> exp_named_subst2) ->
251 raise (TwoDifferentSubtermsFound consno2)
252 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not a discriminable equality")
254 with (TwoDifferentSubtermsFound consno2) -> consno2
257 then raise (ProofEngineTypes.Fail "Discriminate: Discriminating terms are structurally equal")
261 (* a list of "True" except for the element in position consno2 which is "False" *)
262 match fst(CicEnvironment.get_obj
263 CicUniv.empty_ugraph turi) with
264 C.InductiveDefinition (ind_type_list,_,nr_ind_params,_) ->
265 let _,_,_,constructor_list = (List.nth ind_type_list typeno) in
266 let false_constr_id,_ = List.nth constructor_list (consno2 - 1) in
268 (function (id,cty) ->
269 let red_ty = CicReduction.whd context cty in (* dubbio: e' corretto ridurre in questo context ??? *)
272 C.Prod (_,_,target) when (k <= nr_ind_params) ->
274 | C.Prod (binder,source,target) when (k > nr_ind_params) ->
275 C.Lambda (binder,source,(aux target (k+1)))
277 if (id = false_constr_id)
278 then (C.MutInd(Logic.false_URI,0,[]))
279 else (C.MutInd(Logic.true_URI,0,[]))
283 | _ -> raise (ProofEngineTypes.Fail "Discriminate: object is not an Inductive Definition: it's imposible")
286 let (proof',goals') =
287 ProofEngineTypes.apply_tactic
288 (EliminationTactics.elim_type_tac
289 ~term:(C.MutInd(Logic.false_URI,0,[])))
294 let _,metasenv',_,_ = proof' in
295 let _,context',gty' =
296 CicUtil.lookup_meta goal' metasenv'
298 ProofEngineTypes.apply_tactic
309 (C.Lambda ((C.Name "x"),tty,(C.Sort C.Prop))),
319 ~start:(EqualityTactics.rewrite_back_simpl_tac ~term)
320 ~continuation:(IntroductionTactics.constructor_tac ~n:1)
323 | _ -> raise (ProofEngineTypes.Fail "Discriminate: ElimType False left more (or less) than one goal")
325 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not a discriminable equality")
327 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not an equality")
329 ProofEngineTypes.mk_tactic (discriminate'_tac ~term)
332 let discriminate_tac ~term =
333 let discriminate_tac ~term status =
334 ProofEngineTypes.apply_tactic
336 ~start:(* (injection_tac ~term) *) Tacticals.id_tac
337 ~continuation:(discriminate'_tac ~term)) (* NOOO!!! non term ma una (qualunque) delle nuove hyp introdotte da inject *)
340 ProofEngineTypes.mk_tactic (discriminate_tac ~term)
345 let decide_equality_tac =
346 (* il goal e' un termine della forma t1=t2\/~t1=t2; la tattica decide se l'uguaglianza
347 e' vera o no e lo risolve *)
353 let compare_tac ~term = Tacticals.id_tac
355 (* term is in the form t1=t2; the tactic leaves two goals: in the first you have to *)
356 (* demonstrate the goal with the additional hyp that t1=t2, in the second the hyp is ~t1=t2 *)
357 let module C = Cic in
358 let module U = UriManager in
359 let module P = PrimitiveTactics in
360 let module T = Tacticals in
361 let _,metasenv,_,_ = proof in
362 let _,context,gty = CicUtil.lookup_meta goal metasenv in
363 let termty = (CicTypeChecker.type_of_aux' metasenv context term) in
365 (C.Appl [(C.MutInd (uri, 0, [])); _; t1; t2]) when (uri = (U.uri_of_string "cic:/Coq/Init/Logic/eq.ind")) ->
367 let term' = (* (t1=t2)\/~(t1=t2) *)
369 (C.MutInd ((U.uri_of_string "cic:/Coq/Init/Logic/or.ind"), 0, [])) ;
372 (C.MutInd ((U.uri_of_string "cic:/Coq/Init/Logic/eq.ind"), 1, [])) ;
374 C.Appl [C.Const ((U.uri_of_string "cic:/Coq/Init/Logic/not.con"), []) ; t2]
379 ~start:(P.cut_tac ~term:term')
381 T.then_ ~start:(P.intros_tac) ~continuation:(P.elim_intros_simpl_tac ~term:(C.Rel 1)) ;
384 | (C.Appl [(C.MutInd (uri, 0, [])); _; t1; t2]) when (uri = (U.uri_of_string "cic:/Coq/Init/Logic_Type/eqT.ind")) ->
385 let term' = (* (t1=t2) \/ ~(t1=t2) *)
387 (C.MutInd ((U.uri_of_string "cic:/Coq/Init/Logic/or.ind"), 0, [])) ;
390 (C.MutInd ((U.uri_of_string "cic:/Coq/Init/Logic_Type/eqT.ind"), 1, [])) ;
392 C.Appl [C.Const ((U.uri_of_string "cic:/Coq/Init/Logic/not.con"), []) ; t2]
397 ~start:(P.cut_tac ~term:term')
399 T.then_ ~start:(P.intros_tac) ~continuation:(P.elim_intros_simpl_tac ~term:(C.Rel 1)) ;
402 | _ -> raise (ProofEngineTypes.Fail "Compare: Not an equality")
408 (* DISCRIMINTATE SENZA INJECTION
410 exception TwoDifferentSubtermsFound of (Cic.term * Cic.term * int)
412 let discriminate_tac ~term status =
413 let module C = Cic in
414 let module U = UriManager in
415 let module P = PrimitiveTactics in
416 let module T = Tacticals in
417 let (proof, goal) = status in
418 let _,metasenv,_,_ = proof in
419 let _,context,_ = CicUtil.lookup_meta goal metasenv in
420 let termty = (CicTypeChecker.type_of_aux' metasenv context term) in
422 (C.Appl [(C.MutInd (equri, 0, [])) ; tty ; t1 ; t2])
423 when (U.eq equri (U.uri_of_string "cic:/Coq/Init/Logic/eq.ind"))
424 or (U.eq equri (U.uri_of_string "cic:/Coq/Init/Logic_Type/eqT.ind")) -> (
426 (C.MutInd (turi,typeno,exp_named_subst))
427 | (C.Appl (C.MutInd (turi,typeno,exp_named_subst)::_)) ->
429 let (t1',t2',consno2') = (* bruuutto: uso un eccezione per terminare con successo! buuu!! :-/ *)
431 let rec traverse t1 t2 =
432 debug_print ("XXXX t1 " ^ CicPp.ppterm t1) ;
433 debug_print ("XXXX t2 " ^ CicPp.ppterm t2) ;
435 ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
436 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
437 when (uri1 = uri2) && (typeno1 = typeno2) && (consno1 = consno2) && (exp_named_subst1 = exp_named_subst2) ->
439 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::applist1)),
440 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::applist2)))
441 when (uri1 = uri2) && (typeno1 = typeno2) && (consno1 = consno2) && (exp_named_subst1 = exp_named_subst2) ->
442 let rec traverse_list l1 l2 =
445 | hd1::tl1,hd2::tl2 -> traverse hd1 hd2; traverse_list tl1 tl2
446 | _ -> raise (ProofEngineTypes.Fail "Discriminate: i 2 termini hanno in testa lo stesso costruttore, ma applicato a un numero diverso di termini. possibile???")
447 in traverse_list applist1 applist2
449 | ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
450 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
451 | ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1)),
452 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::_)))
453 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::_)),
454 (C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2)))
455 | ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::_)),
456 (C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::_)))
457 when (consno1 <> consno2) || (exp_named_subst1 <> exp_named_subst2) ->
458 raise (TwoDifferentSubtermsFound (t1,t2,consno2))
459 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not a discriminable equality")
461 with (TwoDifferentSubtermsFound (t1,t2,consno2)) -> (t1,t2,consno2)
463 debug_print ("XXXX consno2' " ^ (string_of_int consno2')) ;
465 then raise (ProofEngineTypes.Fail "Discriminate: Discriminating terms are structurally equal")
469 (* a list of "True" except for the element in position consno2' which is "False" *)
470 match fst(CicEnvironment.get_obj turi
471 CicUniv.empty_ugraph) with
472 C.InductiveDefinition (ind_type_list,_,nr_ind_params) ->
473 debug_print ("XXXX nth " ^ (string_of_int (List.length ind_type_list)) ^ " " ^ (string_of_int typeno)) ;
474 let _,_,_,constructor_list = (List.nth ind_type_list typeno) in
475 debug_print ("XXXX nth " ^ (string_of_int (List.length constructor_list)) ^ " " ^ (string_of_int consno2')) ;
476 let false_constr_id,_ = List.nth constructor_list (consno2' - 1) in
477 debug_print ("XXXX nth funzionano ") ;
479 (function (id,cty) ->
480 let red_ty = CicReduction.whd context cty in (* dubbio: e' corretto ridurre in questo context ??? *)
483 C.Prod (_,_,target) when (k <= nr_ind_params) ->
485 | C.Prod (binder,source,target) when (k > nr_ind_params) ->
486 C.Lambda (binder,source,(aux target (k+1)))
488 if (id = false_constr_id)
489 then (C.MutInd (U.uri_of_string "cic:/Coq/Init/Logic/False.ind") 0 [])
490 else (C.MutInd (U.uri_of_string "cic:/Coq/Init/Logic/True.ind") 0 [])
494 | _ -> raise (ProofEngineTypes.Fail "Discriminate: object is not an Inductive Definition: it's imposible")
497 let (proof',goals') =
498 EliminationTactics.elim_type_tac
499 ~term:(C.MutInd (U.uri_of_string "cic:/Coq/Init/Logic/False.ind") 0 [] )
504 let _,metasenv',_,_ = proof' in
505 let _,context',gty' =
506 CicUtil.lookup_meta goal' metasenv'
518 (C.Lambda ((C.Name "x"),tty,(C.Sort C.Prop))),
527 debug_print ("XXXX rewrite<-: " ^ CicPp.ppterm (CicTypeChecker.type_of_aux' metasenv' context' (C.Appl [(C.MutInd (equri,0,[])) ; tty ; t1' ; t2'])));
528 debug_print ("XXXX rewrite<-: " ^ CicPp.ppterm (C.Appl [(C.MutInd (equri,0,[])) ; tty ; t1' ; t2'])) ;
529 debug_print ("XXXX equri: " ^ U.string_of_uri equri) ;
530 debug_print ("XXXX tty : " ^ CicPp.ppterm tty) ;
531 debug_print ("XXXX tt1': " ^ CicPp.ppterm (CicTypeChecker.type_of_aux' metasenv' context' t1')) ;
532 debug_print ("XXXX tt2': " ^ CicPp.ppterm (CicTypeChecker.type_of_aux' metasenv' context' t2')) ;
533 if (CicTypeChecker.type_of_aux' metasenv' context' t1') <> tty then debug_print ("XXXX tt1': " ^ CicPp.ppterm (CicTypeChecker.type_of_aux' metasenv' context' t1')) ;
534 if (CicTypeChecker.type_of_aux' metasenv' context' t2') <> tty then debug_print ("XXXX tt2': " ^ CicPp.ppterm (CicTypeChecker.type_of_aux' metasenv' context' t2')) ;
535 if (CicTypeChecker.type_of_aux' metasenv' context' t1') <> (CicTypeChecker.type_of_aux' metasenv' context' t2')
536 then debug_print ("XXXX tt1': " ^ CicPp.ppterm (CicTypeChecker.type_of_aux'
537 metasenv' context' t1')) ; debug_print ("XXXX tt2': " ^ CicPp.ppterm (CicTypeChecker.type_of_aux' metasenv' context' t2')) ;
539 let termty' = ProofEngineReduction.replace_lifting ~equality:(==) ~what:t1 ~with_what:t1' ~where:termty in
540 let termty'' = ProofEngineReduction.replace_lifting ~equality:(==) ~what:t2 ~with_what:t2' ~where:termty' in
542 debug_print ("XXXX rewrite<- " ^ CicPp.ppterm term ^ " : " ^ CicPp.ppterm (CicTypeChecker.type_of_aux' metasenv' context' term));
544 ~start:(EqualityTactics.rewrite_back_simpl_tac ~term:term)
545 ~continuation:(IntroductionTactics.constructor_tac ~n:1)
548 | _ -> raise (ProofEngineTypes.Fail "Discriminate: ElimType False left more (or less) than one goal")
550 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not a discriminable equality")
552 | _ -> raise (ProofEngineTypes.Fail "Discriminate: not an equality")