exception NoChoice;;
let
- interactive_user_uri_choice ~selection_mode ?(ok="Ok") ~title ~msg uris
+ interactive_user_uri_choice ~selection_mode ?(ok="Ok")
+ ?(enable_button_for_non_vars=false) ~title ~msg uris
=
let choices = ref [] in
let chosen = ref false in
+ let use_only_constants = ref false in
let window =
GWindow.dialog ~modal:true ~title ~width:600 () in
let lMessage =
GButton.button ~label:ok
~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
let _ = okb#misc#set_sensitive false in
+ let nonvarsb =
+ GButton.button
+ ~packing:
+ (function w ->
+ if enable_button_for_non_vars then
+ hbox#pack ~expand:false ~fill:false ~padding:5 w)
+ ~label:"Try constants only" () in
let checkb =
GButton.button ~label:"Check"
~packing:(hbox#pack ~padding:5) () in
ignore (cancelb#connect#clicked window#destroy) ;
ignore
(okb#connect#clicked (function () -> chosen := true ; window#destroy ())) ;
+ ignore
+ (nonvarsb#connect#clicked
+ (function () ->
+ use_only_constants := true ;
+ chosen := true ;
+ window#destroy ()
+ )) ;
ignore (checkb#connect#clicked check_callback) ;
ignore
(clist#connect#select_row
window#set_position `CENTER ;
window#show () ;
GMain.Main.main () ;
- if !chosen && List.length !choices > 0 then
- !choices
+ if !chosen then
+ if !use_only_constants then
+ List.filter
+ (function uri -> not (String.sub uri (String.length uri - 4) 4 = ".var"))
+ uris
+ else
+ if List.length !choices > 0 then !choices else raise NoChoice
else
raise NoChoice
;;
interactive_user_uri_choice
~selection_mode:`EXTENDED
~ok:"Try every selection."
+ ~enable_button_for_non_vars:true
~title:"Ambiguous input."
~msg:
("Ambiguous input \"" ^ id ^
let intros = call_tactic ProofEngine.intros;;
let exact = call_tactic_with_input ProofEngine.exact;;
let apply = call_tactic_with_input ProofEngine.apply;;
-let elimsimplintros = call_tactic_with_input ProofEngine.elim_simpl_intros;;
+let elimintrossimpl = call_tactic_with_input ProofEngine.elim_intros_simpl;;
let elimtype = call_tactic_with_input ProofEngine.elim_type;;
let whd = call_tactic_with_goal_input ProofEngine.whd;;
let reduce = call_tactic_with_goal_input ProofEngine.reduce;;
let applyb =
GButton.button ~label:"Apply"
~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
- let elimsimplintrosb =
- GButton.button ~label:"ElimSimplIntros"
+ let elimintrossimplb =
+ GButton.button ~label:"ElimIntrosSimpl"
~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
let elimtypeb =
GButton.button ~label:"ElimType"
ignore(exactb#connect#clicked exact) ;
ignore(applyb#connect#clicked apply) ;
- ignore(elimsimplintrosb#connect#clicked elimsimplintros) ;
+ ignore(elimintrossimplb#connect#clicked elimintrossimpl) ;
ignore(elimtypeb#connect#clicked elimtype) ;
ignore(whdb#connect#clicked whd) ;
ignore(reduceb#connect#clicked reduce) ;