let enriched_history_fragment =
MatitaEngine.eval_ast ~do_heavy_checks:(Helm_registry.get_bool
"matita.do_heavy_checks")
let enriched_history_fragment =
MatitaEngine.eval_ast ~do_heavy_checks:(Helm_registry.get_bool
"matita.do_heavy_checks")
* so that we can ensure the inclusion is performed after the included file
* is compiled (if needed). matitac does not need that, since it compiles files
* in the good order, here files may be compiled on demand. *)
* so that we can ensure the inclusion is performed after the included file
* is compiled (if needed). matitac does not need that, since it compiles files
* in the good order, here files may be compiled on demand. *)
| Cic.Const _ as t ->
PT.Ident (pp_t c t, None)
| Cic.Appl l -> PT.Appl (List.map (aux c) l)
| Cic.Const _ as t ->
PT.Ident (pp_t c t, None)
| Cic.Appl l -> PT.Appl (List.map (aux c) l)
| Cic.Lambda (Cic.Name n, s, t) ->
PT.Binder (`Lambda, (PT.Ident (n,None), Some (aux c s)),
aux (Some (Cic.Name n, Cic.Decl s)::c) t)
| Cic.Lambda (Cic.Name n, s, t) ->
PT.Binder (`Lambda, (PT.Ident (n,None), Some (aux c s)),
aux (Some (Cic.Name n, Cic.Decl s)::c) t)
| Cic.LetIn (Cic.Name n, s, ty, t) ->
PT.Binder (`Lambda, (PT.Ident (n,None), Some (aux c s)),
aux (Some (Cic.Name n, Cic.Def (s,ty))::c) t)
| Cic.LetIn (Cic.Name n, s, ty, t) ->
PT.Binder (`Lambda, (PT.Ident (n,None), Some (aux c s)),
aux (Some (Cic.Name n, Cic.Def (s,ty))::c) t)
| Cic.Sort (Cic.Type u) -> PT.Sort (`Type u)
| Cic.Sort Cic.Set -> PT.Sort `Set
| Cic.Sort (Cic.CProp u) -> PT.Sort (`CProp u)
| Cic.Sort (Cic.Type u) -> PT.Sort (`Type u)
| Cic.Sort Cic.Set -> PT.Sort `Set
| Cic.Sort (Cic.CProp u) -> PT.Sort (`CProp u)
let s = "(" ^ BoxPp.render_to_string
~map_unicode_to_tex:(Helm_registry.get_bool
"matita.paste_unicode_as_tex")
let s = "(" ^ BoxPp.render_to_string
~map_unicode_to_tex:(Helm_registry.get_bool
"matita.paste_unicode_as_tex")
(* no idea why ocaml wants this *)
let parsed_text_length = String.length parsed_text in
let dbd = LibraryDb.instance () in
(* no idea why ocaml wants this *)
let parsed_text_length = String.length parsed_text in
let dbd = LibraryDb.instance () in
let loc = HExtlib.floc_of_loc (0,text_len) in
let statement = `Ast (GrafiteParser.LSome (ast loc),text) in
let res,_,_parsed_text_len =
let loc = HExtlib.floc_of_loc (0,text_len) in
let statement = `Ast (GrafiteParser.LSome (ast loc),text) in
let res,_,_parsed_text_len =
in
let t_and_ty = Cic.Cast (term,ty) in
guistuff.mathviewer#show_entry (`Cic (t_and_ty,metasenv));
in
let t_and_ty = Cic.Cast (term,ty) in
guistuff.mathviewer#show_entry (`Cic (t_and_ty,metasenv));
- [({grafite_status with proof_status = No_proof},lexicon_status), parsed_text ],"",
+ [(grafite_status#set_proof_status No_proof), parsed_text ],"",
let (_,menv,subst,_,_,_), _ =
ProofEngineTypes.apply_tactic
(Auto.auto_tac ~dbd ~params
let (_,menv,subst,_,_,_), _ =
ProofEngineTypes.apply_tactic
(Auto.auto_tac ~dbd ~params
in
let text = comment parsed_text ^ "\n" ^ proof_script ^ trailer in
[],text,parsed_text_length
in
let text = comment parsed_text ^ "\n" ^ proof_script ^ trailer in
[],text,parsed_text_length
ProofEngineTypes.Fail _ as exn ->
raise exn
(* [], comment parsed_text ^ "\nfail.\n", parsed_text_length *))
ProofEngineTypes.Fail _ as exn ->
raise exn
(* [], comment parsed_text ^ "\nfail.\n", parsed_text_length *))
- | TA.Inline (_,style,suri,prefix,flavour) ->
- let str =
+ | TA.Inline (_, suri, params) ->
+ let str = "\n\n" ^
ApplyTransformation.txt_of_inline_macro
~map_unicode_to_tex:(Helm_registry.get_bool
"matita.paste_unicode_as_tex")
ApplyTransformation.txt_of_inline_macro
~map_unicode_to_tex:(Helm_registry.get_bool
"matita.paste_unicode_as_tex")
in
[], str, String.length parsed_text
and eval_executable include_paths (buffer : GText.buffer) guistuff
in
[], str, String.length parsed_text
and eval_executable include_paths (buffer : GText.buffer) guistuff
try
ignore (buffer#move_mark (`NAME "beginning_of_statement")
~where:((buffer#get_iter_at_mark (`NAME "locked"))#forward_chars
(Glib.Utf8.length skipped_txt))) ;
eval_with_engine include_paths
try
ignore (buffer#move_mark (`NAME "beginning_of_statement")
~where:((buffer#get_iter_at_mark (`NAME "locked"))#forward_chars
(Glib.Utf8.length skipped_txt))) ;
eval_with_engine include_paths
(TA.Executable (loc, ex))
with
MatitaTypes.Cancel -> [], "", 0
(TA.Executable (loc, ex))
with
MatitaTypes.Cancel -> [], "", 0
None -> []
| Some n -> GrafiteTypes.get_proof_context grafite_status n in
let grafite_status,macro = lazy_macro context in
None -> []
| Some n -> GrafiteTypes.get_proof_context grafite_status n in
let grafite_status,macro = lazy_macro context in
- | `Ast (st, text) -> (lexicon_status, st), text
+ | `Ast (st, text) -> (grafite_status, st), text
match st with
| GrafiteParser.LNone loc ->
let parsed_text, _, _, parsed_text_length = text_of_loc loc in
match st with
| GrafiteParser.LNone loc ->
let parsed_text, _, _, parsed_text_length = text_of_loc loc in
- [(grafite_status,lexicon_status),parsed_text],"",
+ [grafite_status,parsed_text],"",
parsed_text_length
| GrafiteParser.LSome (GrafiteAst.Comment (loc, _)) ->
let parsed_text, _, _, parsed_text_length = text_of_loc loc in
parsed_text_length
| GrafiteParser.LSome (GrafiteAst.Comment (loc, _)) ->
let parsed_text, _, _, parsed_text_length = text_of_loc loc in
grafite_status user_goal script (`Raw s)
with
HExtlib.Localized (floc, exn) ->
grafite_status user_goal script (`Raw s)
with
HExtlib.Localized (floc, exn) ->
let _, nonskipped, skipped, parsed_text_length =
text_of_loc loc
in
let _, nonskipped, skipped, parsed_text_length =
text_of_loc loc
in
(* history can't be empty, the invariant above grant that it contains at
* least the init grafite_status *)
(* history can't be empty, the invariant above grant that it contains at
* least the init grafite_status *)
- method grafite_status = match history with (s,_)::_ -> s | _ -> assert false
- method lexicon_status = match history with (_,ss)::_ -> ss | _ -> assert false
+ method grafite_status = match history with s::_ -> s | _ -> assert false
method private _advance ?statement () =
let s = match statement with Some s -> s | None -> self#getFuture in
method private _advance ?statement () =
let s = match statement with Some s -> s | None -> self#getFuture in
HLog.debug ("evaluating: " ^ first_line s ^ " ...");
let entries, newtext, parsed_len =
try
HLog.debug ("evaluating: " ^ first_line s ^ " ...");
let entries, newtext, parsed_len =
try
buffer#insert ~iter:(buffer#get_iter_at_mark (`MARK locked_mark)) newtext;
(* here we need to set the Goal in case we are going to cursor (or to
bottom) and we will face a macro *)
buffer#insert ~iter:(buffer#get_iter_at_mark (`MARK locked_mark)) newtext;
(* here we need to set the Goal in case we are going to cursor (or to
bottom) and we will face a macro *)
GrafiteSync.time_travel ~present:cur_grafite_status ~past:grafite_status;
statements <- new_statements;
history <- new_history;
GrafiteSync.time_travel ~present:cur_grafite_status ~past:grafite_status;
statements <- new_statements;
history <- new_history;
- let cmp,new_statements,new_history,(grafite_status,lexicon_status) =
+ let cmp,new_statements,new_history,grafite_status =
match statements,history with
stat::statements, _::(status::_ as history) ->
assert (Glib.Utf8.validate stat);
match statements,history with
stat::statements, _::(status::_ as history) ->
assert (Glib.Utf8.validate stat);
in
(* FIXME: this is not correct since there is no undo for
* library_objects.set_default... *)
GrafiteSync.time_travel ~present:self#grafite_status ~past:grafite_status;
in
(* FIXME: this is not correct since there is no undo for
* library_objects.set_default... *)
GrafiteSync.time_travel ~present:self#grafite_status ~past:grafite_status;
history
| statement::tl1, _::tl2 ->
back_until_cursor (len - MatitaGtkMisc.utf8_string_length statement) (tl1,tl2)
history
| statement::tl1, _::tl2 ->
back_until_cursor (len - MatitaGtkMisc.utf8_string_length statement) (tl1,tl2)
| No_proof | Proof _ -> false
| Incomplete_proof _ -> true
| Intermediate _ -> assert false
| No_proof | Proof _ -> false
| Incomplete_proof _ -> true
| Intermediate _ -> assert false