X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Fmatita.ml;h=a422ece1655ba7321d9ce31d1cb5fb68aaf74d0a;hb=6915a58db8db95966b9519d1d984d895e7b5fe39;hp=69295bd7e0793af4c3792092db418e239a60353b;hpb=3b5b254f2faa600a14a837e95f94f953dc9959c7;p=helm.git diff --git a/helm/matita/matita.ml b/helm/matita/matita.ml index 69295bd7e..a422ece16 100644 --- a/helm/matita/matita.ml +++ b/helm/matita/matita.ml @@ -63,6 +63,15 @@ let script = ~buffer:gui#main#scriptTextView#buffer ~init:(Lazy.force MatitaEngine.initial_status) ~mathviewer:(MatitaMathView.mathViewer ()) + ~urichooser:(fun uris -> + try + MatitaGui.interactive_uri_choice ~selection_mode:`SINGLE + ~title:"Matita: URI chooser" + ~msg:"Select the URI" ~hide_uri_entry:true + ~hide_try:true ~ok_label:"_Apply" + ~copy_cb:(fun s -> gui#main#scriptTextView#buffer#insert ("\n"^s^"\n")) + () ~id:"boh?" uris + with MatitaTypes.Cancel -> []) () (* math viewers *) @@ -70,7 +79,7 @@ let _ = let sequent_viewer = MatitaMathView.sequentViewer_instance () in let sequents_viewer = MatitaMathView.sequentsViewer_instance () in sequent_viewer#set_href_callback - (Some (fun uri -> (MatitaMathView.cicBrowser ())#loadUri uri)); + (Some (fun uri -> (MatitaMathView.cicBrowser ())#load (`Uri uri))); let browser_observer _ = MatitaMathView.refresh_all_browsers () in let sequents_observer status = sequents_viewer#reset; @@ -78,7 +87,12 @@ let _ = | Incomplete_proof ((proof, goal) as status) -> sequents_viewer#load_sequents status; sequents_viewer#goto_sequent goal - | _ -> () + | Proof proof -> + prerr_endline "sequents_viewer#load_logo_with_qed (no proof)"; () + | No_proof -> + prerr_endline "sequents_viewer#load_logo (no proof)"; () + | Intermediate _ -> + assert false (* only the engine may be in this state *) in script#addObserver sequents_observer; script#addObserver browser_observer @@ -97,6 +111,15 @@ let _ = let oc = open_out "env.dump" in CicEnvironment.dump_to_channel oc; close_out oc); + addDebugItem "load environment from \"env.dump\"" (fun _ -> + let ic = open_in "env.dump" in + CicEnvironment.restore_from_channel ic; + close_in ic); + addDebugItem "dump universes" (fun _ -> + List.iter (fun (u,_,g) -> + prerr_endline (UriManager.string_of_uri u); + CicUniv.print_ugraph g) (CicEnvironment.list_obj ()) + ); addDebugItem "print selected terms" (fun () -> let i = ref 0 in List.iter @@ -123,6 +146,12 @@ let _ = (fun _ -> let nb = gui#main#hintNotebook in nb#goto_page ((nb#current_page + 1) mod 3)); + (* + addDebugItem "print (on stdout) \"statement\" grammar entry" + (fun _ -> + Grammar.print_entry Format.std_formatter + (Grammar.Entry.obj CicTextualParser2.statement); + Format.pp_print_flush Format.std_formatter ());*) end (** *) @@ -135,13 +164,13 @@ let _ = print_endline "\nThanks for using Matita!\n"); Sys.catch_break true; (try - script#loadFrom Sys.argv.(1); + gui#loadScript Sys.argv.(1); with Invalid_argument _ -> ()); if Filename.basename Sys.argv.(0) = "cicbrowser" then begin (* cicbrowser *) Helm_registry.set "matita.mode" "cicbrowser"; let browser = MatitaMathView.cicBrowser () in try - browser#loadUri Sys.argv.(1) + browser#load (`Uri Sys.argv.(1)) with Invalid_argument _ -> () end else begin (* matita *) Helm_registry.set "matita.mode" "matita";