From: Enrico Tassi Date: Fri, 29 Apr 2005 12:15:43 +0000 (+0000) Subject: added dump/restore environment to the debug menu X-Git-Tag: single_binding~133 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=a2929cb64c8956a19d5da550911018efe46f189c;p=helm.git added dump/restore environment to the debug menu fixed bug: when proof is completed the browser@home is blank --- diff --git a/helm/matita/matita.ml b/helm/matita/matita.ml index 69295bd7e..3f08dd1c8 100644 --- a/helm/matita/matita.ml +++ b/helm/matita/matita.ml @@ -78,7 +78,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 +102,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 diff --git a/helm/matita/matitaMathView.ml b/helm/matita/matitaMathView.ml index 05f5246e5..c9e0b217f 100644 --- a/helm/matita/matitaMathView.ml +++ b/helm/matita/matitaMathView.ml @@ -370,13 +370,16 @@ class cicBrowser_impl ~(history:string MatitaMisc.history) () = mathView#load_root (MatitaMisc.empty_mathml ())#get_documentElement method private home () = - if self#script#onGoingProof () then - let ((uri, metasenv, bo, ty), _) = self#script#proofStatus in - let name = UriManager.name_of_uri (MatitaMisc.unopt uri) in - let obj = Cic.CurrentProof (name, metasenv, bo, ty, [], []) in - self#loadObj obj - else - self#blank () + match self#script#status.proof_status with + | Proof (uri, metasenv, bo, ty) -> + let name = UriManager.name_of_uri (MatitaMisc.unopt uri) in + let obj = Cic.CurrentProof (name, metasenv, bo, ty, [], []) in + self#loadObj obj + | Incomplete_proof ((uri, metasenv, bo, ty), _) -> + let name = UriManager.name_of_uri (MatitaMisc.unopt uri) in + let obj = Cic.CurrentProof (name, metasenv, bo, ty, [], []) in + self#loadObj obj + | _ -> self#blank () (** loads a cic uri from the environment * @param uri UriManager.uri *)