eval_add_constraint status [`Type,u1] [`Type,u2]
;;
-let eval_comment ~disambiguate_command opts status (text,prefix_len,c) =
- status, []
+let eval_comment opts status (text,prefix_len,c) = status, []
-let rec eval_command ~disambiguate_command opts status (text,prefix_len,cmd) =
- let status,cmd = disambiguate_command status (text,prefix_len,cmd) in
+let rec eval_command opts status (text,prefix_len,cmd) =
let status,uris =
match cmd with
| GrafiteAst.Include (loc, baseuri) ->
in
status,uris
-and eval_executable ~disambiguate_command opts status (text,prefix_len,ex) =
+and eval_executable opts status (text,prefix_len,ex) =
match ex with
| GrafiteAst.NTactic (_(*loc*), tacl) ->
if status#ng_mode <> `ProofMode then
in
status,[]
| GrafiteAst.Command (_, cmd) ->
- eval_command ~disambiguate_command opts status (text,prefix_len,cmd)
+ eval_command opts status (text,prefix_len,cmd)
| GrafiteAst.NCommand (_, cmd) ->
eval_ncommand opts status (text,prefix_len,cmd)
| GrafiteAst.NMacro (loc, macro) ->
raise (NMacro (loc,macro))
-and eval_ast ~disambiguate_command ?(do_heavy_checks=false) status
-(text,prefix_len,st)
-=
+and eval_ast ?(do_heavy_checks=false) status (text,prefix_len,st) =
let opts = { do_heavy_checks = do_heavy_checks ; } in
match st with
| GrafiteAst.Executable (_,ex) ->
- eval_executable ~disambiguate_command opts status (text,prefix_len,ex)
+ eval_executable opts status (text,prefix_len,ex)
| GrafiteAst.Comment (_,c) ->
- eval_comment ~disambiguate_command opts status (text,prefix_len,c)
+ eval_comment opts status (text,prefix_len,c)
;;
type 'a disambiguator_input = string * int * 'a
val eval_ast :
- disambiguate_command:
- (GrafiteTypes.status ->
- GrafiteAst.command disambiguator_input ->
- GrafiteTypes.status * GrafiteAst.command) ->
-
?do_heavy_checks:bool ->
GrafiteTypes.status ->
GrafiteAst.statement disambiguator_input ->
(* Warning: #stack and #obj are meaningful iff #ng_mode is `ProofMode *)
inherit ([Continuationals.Stack.t] NTacStatus.status fake_obj (Continuationals.Stack.empty))
inherit NCicLibrary.dumpable_status
+ inherit NCicLibrary.status
val baseuri = b
val ng_mode = (`CommandMode : [`CommandMode | `ProofMode])
method baseuri = baseuri
(* Warning: #stack and #obj are meaningful iff #ng_mode is `ProofMode *)
inherit NTacStatus.tac_status
inherit NCicLibrary.dumpable_status
+ inherit NCicLibrary.status
method baseuri: string
method set_baseuri: string -> 'self
method ng_mode: [`ProofMode | `CommandMode]
status,uris
;;
-let eval_ncoercion status name t ty (id,src) tgt =
-
+let eval_ncoercion (status: #GrafiteTypes.status) name t ty (id,src) tgt =
let metasenv,subst,status,ty =
GrafiteDisambiguate.disambiguate_nterm None status [] [] [] ("",0,ty) in
assert (metasenv=[]);
GrafiteDisambiguate.disambiguate_nterm (Some ty) status [] [] [] ("",0,t) in
assert (metasenv=[]);
let t = NCicUntrusted.apply_subst subst [] t in
-
let status, src, tgt, cpos, arity =
src_tgt_cpos_arity_of_ty_id_src_tgt status ty id src tgt in
let status, uris =
(* $Id$ *)
-class g_status =
+class type g_status =
object
inherit LexiconEngine.g_status
inherit NCicCoercion.g_status
exception BaseUriNotSetYet
-class g_status :
- object
+class type g_status =
+ object
inherit LexiconEngine.g_status
inherit NCicCoercion.g_status
- end
+ end
class status :
- object
+ object ('self)
inherit LexiconEngine.status
inherit NCicCoercion.status
method set_grafite_disambiguate_status: #g_status -> 'self
let init = load_db;;
-class type g_status =
- object
- method timestamp: timestamp
- end
-
class status =
object(self)
val timestamp = (time0 : timestamp)
method timestamp = timestamp
method set_timestamp v = {< timestamp = v >}
- method set_library_status
- : 'status. #g_status as 'status -> 'self
- = fun o -> self#set_timestamp o#timestamp
end
let time_travel status =
type timestamp
-class type g_status =
- object
- method timestamp: timestamp
- end
-
class status :
object ('self)
- inherit g_status
+ method timestamp: timestamp
method set_timestamp: timestamp -> 'self
- method set_library_status: #g_status -> 'self
end
(* it also checks it and add it to the environment *)
let exec tac (low_status : #lowtac_status) g =
let stack = [ [0,Open g], [], [], `NoTag ] in
let status =
- (new NTacStatus.status low_status#obj stack)#set_estatus low_status
+ (new NTacStatus.status low_status#obj stack)#set_pstatus low_status
in
let status = tac status in
- (low_status#set_estatus status)#set_obj status#obj
+ (low_status#set_pstatus status)#set_obj status#obj
;;
let distribute_tac tac (status : #tac_status) =
in
aux s go gc loc_tl
in
- let s0 = (new NTacStatus.status status#obj ())#set_estatus status in
+ let s0 = (new NTacStatus.status status#obj ())#set_pstatus status in
let s0, go0, gc0 = s0, [], [] in
let sn, gon, gcn = aux s0 go0 gc0 g in
debug_print (lazy ("opened: "
let stack =
(zero_pos gon, t @~- gcn, k @~- gcn, tag) :: deep_close gcn s
in
- ((status#set_stack stack)#set_obj(sn:>lowtac_status)#obj)#set_estatus sn
+ ((status#set_stack stack)#set_obj(sn:>lowtac_status)#obj)#set_pstatus sn
;;
let atomic_tac htac: #tac_status as 'a -> 'a = distribute_tac (exec htac) ;;
-grafitetypes -> tac -> auto + eq + (grafitedisambiguate = lexicon +nciccoercion)
- |--> dumpable |
- |--> nciclibrary interpretation
+grafitetypes -> tac -> auto + eq + (grafitedisambiguate = lexicon+nciccoercion)
+ |--> dumpable | |
+ |--> nciclibrary interpretation unif_hint
-ntermciccontent -> nciccoercion+interpretation
+ntermciccontent = nciccoercion+interpretation
|
unif_hint
let debug = false ;;
let debug_print = if debug then prerr_endline else ignore ;;
-let disambiguate_command lexicon_status_ref grafite_status cmd =
- let lexicon_status,cmd =
- GrafiteDisambiguate.disambiguate_command !lexicon_status_ref cmd
- in
- lexicon_status_ref := lexicon_status;
- grafite_status,cmd
-
let eval_macro_screenshot (status : GrafiteTypes.status) name =
assert false (* MATITA 1.0
let _,_,metasenv,subst,_ = status#obj in
let lexicon_status_ref = ref (status :> LexiconEngine.status) in
let baseuri = status#baseuri in
let new_status,new_objs =
- GrafiteEngine.eval_ast
- ~disambiguate_command:(disambiguate_command lexicon_status_ref)
- ?do_heavy_checks status (text,prefix_len,ast)
+ GrafiteEngine.eval_ast ?do_heavy_checks status (text,prefix_len,ast)
in
let new_status =
if !lexicon_status_ref#lstatus != status#lstatus then
in
LexiconMarshal.save_lexicon lexicon_fname
grafite_status#lstatus.LexiconEngine.lexicon_content_rev;
- NCicLibrary.Serializer.serialize ~baseuri:(NUri.uri_of_string baseuri)
+ GrafiteTypes.Serializer.serialize ~baseuri:(NUri.uri_of_string baseuri)
grafite_status#dump
| _ -> clean_current_baseuri grafite_status
;;
| false -> main#toplevel#unfullscreen ());
main#fullscreenMenuItem#set_active false;
MatitaGtkMisc.toggle_callback ~check:main#ppNotationMenuItem
- ~callback:(function
- | true ->
- CicNotation.set_active_notations
- (List.map fst (CicNotation.get_all_notations ()))
- | false ->
- CicNotation.set_active_notations []);
+ ~callback:(
+ let s = s () in
+ let status =
+ Interpretations.toggle_active_interpretations s#grafite_status
+ in
+ assert false (* MATITA1.0 ???
+ s#set_grafite_status status*)
+ );
MatitaGtkMisc.toggle_callback ~check:main#hideCoercionsMenuItem
~callback:(fun enabled -> NTermCicContent.hide_coercions := enabled);
MatitaGtkMisc.toggle_callback ~check:main#unicodeAsTexMenuItem
(** load a sequent and render it into parent widget *)
method nload_sequent:
- #NCicCoercion.status -> NCic.metasenv -> NCic.substitution -> int -> unit
+ #NTermCicContent.status -> NCic.metasenv -> NCic.substitution -> int -> unit
- method load_nobject: #NCicCoercion.status -> NCic.obj -> unit
+ method load_nobject: #NTermCicContent.status -> NCic.obj -> unit
end
class type sequentsViewer =
method load_logo_with_qed: unit
method nload_sequents: #NTacStatus.tac_status -> unit
method goto_sequent:
- #NCicCoercion.status -> int -> unit (* to be called _after_ load_sequents *)
+ #NTermCicContent.status -> int -> unit (* to be called _after_ load_sequents *)
method cicMathView: cicMathView
end
(if Helm_registry.get_bool "matita.moo" then begin
(* FG: we do not generate .moo when dumping .mma files *)
LexiconMarshal.save_lexicon lexicon_fname lexicon_content_rev;
- NCicLibrary.Serializer.serialize ~baseuri:(NUri.uri_of_string baseuri)
+ GrafiteTypes.Serializer.serialize ~baseuri:(NUri.uri_of_string baseuri)
grafite_status#dump
end;
let tm = Unix.gmtime elapsed in