X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fmatita.ml;h=b3963bf0272d9f9330284a8314ba2ce3fcb473e8;hb=8844ee999e40d69795aa73fbeb198997a46fcf04;hp=b39eb85313030bb475af71efe000d7f53b27e7ab;hpb=910c252965fe17d6b5af92e4658e7d02bac82d58;p=helm.git diff --git a/helm/software/matita/matita.ml b/helm/software/matita/matita.ml index b39eb8531..b3963bf02 100644 --- a/helm/software/matita/matita.ml +++ b/helm/software/matita/matita.ml @@ -67,6 +67,8 @@ let script = ~parent:gui#main#toplevel ()) () in + Predefined_virtuals.load_predefined_virtuals (); + Predefined_virtuals.load_predefined_classes (); gui#sourceView#source_buffer#begin_not_undoable_action (); s#reset (); s#template (); @@ -105,7 +107,9 @@ let _ = (** {{{ Debugging *) let _ = - if BuildTimeConf.debug then begin + if BuildTimeConf.debug || + Helm_registry.get_bool "matita.debug_menu" + then begin gui#main#debugMenu#misc#show (); let addDebugItem ~label callback = let item = @@ -114,6 +118,12 @@ let _ = let addDebugSeparator () = ignore (GMenu.separator_item ~packing:gui#main#debugMenu_menu#append ()) in + addDebugItem "dump aliases" (fun _ -> + let status = script#lexicon_status in + HLog.debug (String.concat "\n" + (DisambiguateTypes.Environment.fold + (fun _ x l -> (LexiconAstPp.pp_alias x)::l) + status.LexiconEngine.aliases []))); addDebugItem "dump environment to \"env.dump\"" (fun _ -> let oc = open_out "env.dump" in CicEnvironment.dump_to_channel oc; @@ -147,7 +157,7 @@ let _ = (fun cmd -> prerr_endline (GrafiteAstPp.pp_command - ~term_pp:(fun _ -> assert false) + ~term_pp:(fun t -> CicPp.ppterm t) ~obj_pp:(fun _ -> assert false) cmd)) (List.rev moo)); @@ -166,8 +176,10 @@ let _ = (MatitaScript.current ())#grafite_status.GrafiteTypes.proof_status with | GrafiteTypes.No_proof -> (Cic.Implicit None) - | Incomplete_proof i -> let _,_,_subst,p,_, _ = i.GrafiteTypes.proof in p - | Proof p -> let _,_,_subst,p,_, _ = p in p + | Incomplete_proof i -> + let _,_,_subst,p,_, _ = i.GrafiteTypes.proof in + Lazy.force p + | Proof p -> let _,_,_subst,p,_, _ = p in Lazy.force p | Intermediate _ -> assert false))); addDebugItem "Print current proof (natural language) to stderr" (fun _ -> @@ -181,9 +193,9 @@ let _ = | GrafiteTypes.No_proof -> assert false | Incomplete_proof i -> let _,m,_subst,p,ty, attrs = i.GrafiteTypes.proof in - Cic.CurrentProof ("current (incomplete) proof",m,p,ty,[],attrs) + Cic.CurrentProof ("current (incomplete) proof",m,Lazy.force p,ty,[],attrs) | Proof (_,m,_subst,p,ty, attrs) -> - Cic.CurrentProof ("current proof",m,p,ty,[],attrs) + Cic.CurrentProof ("current proof",m,Lazy.force p,ty,[],attrs) | Intermediate _ -> assert false))); (* addDebugItem "ask record choice" (fun _ -> @@ -229,9 +241,9 @@ let _ = *) addDebugSeparator (); addDebugItem "enable multiple disambiguation passes (default)" - (fun _ -> GrafiteDisambiguator.only_one_pass := false); + (fun _ -> MultiPassDisambiguator.only_one_pass := false); addDebugItem "enable only one disambiguation pass" - (fun _ -> GrafiteDisambiguator.only_one_pass := true); + (fun _ -> MultiPassDisambiguator.only_one_pass := true); addDebugItem "always show all disambiguation errors" (fun _ -> MatitaGui.all_disambiguation_passes := true); addDebugItem "prune disambiguation errors" @@ -268,8 +280,9 @@ let _ = ~doc:(HExtlib.unopt (mview ())#get_document) ~name:"matita.xml" ())); *) addDebugItem "load (sequent) MathML from matita.xml" (fun _ -> (mview ())#load_uri ~filename:"matita.xml"); - addDebugItem "autoWin" - (fun _ -> MatitaAutoGui.auto_dialog Auto.get_auto_status); + addDebugSeparator (); + addDebugItem "Expand virtuals" + (fun _ -> (MatitaScript.current ())#expandAllVirtuals); end (** Debugging }}} *)