raise NoChoice
;;
-EliminationTactics.interactive_user_uri_choice :=
- (fun ~selection_mode -> interactive_user_uri_choice ~selection_mode:selection_mode);;
-
let interactive_interpretation_choice interpretations =
let chosen = ref None in
let window =
("<h1 color=\"red\">" ^ Printexc.to_string e ^ "</h1>") ;
;;
+let decompose_uris_choice_callback uris =
+(* N.B.: in questo passaggio perdo l'informazione su exp_named_subst !!!! *)
+ let module U = UriManager in
+ List.map
+ (function uri ->
+ match Disambiguate.cic_textual_parser_uri_of_string uri with
+ CicTextualParser0.IndTyUri (uri,typeno) -> (uri,typeno,[])
+ | _ -> assert false)
+ (interactive_user_uri_choice
+ ~selection_mode:`EXTENDED ~ok:"Ok" ~enable_button_for_non_vars:false
+ ~title:"Decompose" ~msg:"Please, select the Inductive Types to decompose"
+ (List.map
+ (function (uri,typeno,_) ->
+ U.string_of_uri uri ^ "#1/" ^ string_of_int (typeno+1)
+ ) uris)
+ )
+;;
(***********************)
(* TACTICS *)
let generalize = call_tactic_with_goal_input ProofEngine.generalize;;
let absurd = call_tactic_with_input ProofEngine.absurd;;
let contradiction = call_tactic ProofEngine.contradiction;;
-let decompose = call_tactic_with_input ProofEngine.decompose;;
+let decompose =
+ call_tactic_with_input
+ (ProofEngine.decompose ~uris_choice_callback:decompose_uris_choice_callback);;
let whd_in_scratch scratch_window =
call_tactic_with_goal_input_in_scratch ProofEngine.whd_in_scratch
let absurd term = apply_tactic (NegationTactics.absurd_tac ~term)
let contradiction () = apply_tactic NegationTactics.contradiction_tac
-let decompose term = apply_tactic (EliminationTactics.decompose_tac ~term)
+let decompose ~uris_choice_callback term =
+ apply_tactic (EliminationTactics.decompose_tac ~term ~uris_choice_callback)
(*
let decide_equality () = apply_tactic VariousTactics.decide_equality_tac
val absurd : Cic.term -> unit
val contradiction : unit -> unit
-val decompose : Cic.term -> unit
+val decompose :
+ uris_choice_callback:
+ ((UriManager.uri * int * (UriManager.uri * Cic.term) list) list ->
+ (UriManager.uri * int * (UriManager.uri * Cic.term) list) list) ->
+ Cic.term -> unit
(*
val decide_equality : unit -> unit