("<h1 color=\"red\">" ^ Printexc.to_string e ^ "</h1>") ;
;;
+let mk_fresh_name_callback context name ~typ =
+ let fresh_name =
+ match ProofEngineHelpers.mk_fresh_name context name ~typ with
+ Cic.Name fresh_name -> fresh_name
+ | Cic.Anonymous -> assert false
+ in
+ match
+ GToolbox.input_string ~title:"Enter a fresh hypothesis name" ~text:fresh_name
+ ("Enter a fresh name for the hypothesis " ^
+ CicPp.pp typ
+ (List.map (function None -> None | Some (n,_) -> Some n) context))
+ with
+ Some fresh_name' -> Cic.Name fresh_name'
+ | None -> raise NoChoice
+;;
+
let new_proof () =
let inputt = ((rendering_window ())#inputt : term_editor) in
let outputhtml = ((rendering_window ())#outputhtml : GHtml.xmhtml) in
refresh_sequent notebook ;
refresh_proof output ;
!save_set_sensitive true ;
- inputt#reset
+ inputt#reset ;
+ ProofEngine.intros ~mk_fresh_name_callback () ;
+ refresh_sequent notebook ;
+ refresh_proof output
with
RefreshSequentException e ->
output_html outputhtml
;;
-let intros = call_tactic ProofEngine.intros;;
+let intros = call_tactic (ProofEngine.intros ~mk_fresh_name_callback);;
let exact = call_tactic_with_input ProofEngine.exact;;
let apply = call_tactic_with_input ProofEngine.apply;;
let elimintrossimpl = call_tactic_with_input ProofEngine.elim_intros_simpl;;
let fold_whd = call_tactic_with_input ProofEngine.fold_whd;;
let fold_reduce = call_tactic_with_input ProofEngine.fold_reduce;;
let fold_simpl = call_tactic_with_input ProofEngine.fold_simpl;;
-let cut = call_tactic_with_input ProofEngine.cut;;
+let cut = call_tactic_with_input (ProofEngine.cut ~mk_fresh_name_callback);;
let change = call_tactic_with_input_and_goal_input ProofEngine.change;;
-let letin = call_tactic_with_input ProofEngine.letin;;
+let letin = call_tactic_with_input (ProofEngine.letin ~mk_fresh_name_callback);;
let ring = call_tactic ProofEngine.ring;;
let clearbody = call_tactic_with_hypothesis_input ProofEngine.clearbody;;
let clear = call_tactic_with_hypothesis_input ProofEngine.clear;;