]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/matitaScript.ml
Propagation of changes to grafiteAst.
[helm.git] / matita / matita / matitaScript.ml
index 1de645619c9af7b02678f18c71725e332c9aaf73..65fc0fcecef20545706e273a02313c866da7a98a 100644 (file)
@@ -124,9 +124,7 @@ let wrap_with_make include_paths (f : #LexiconEngine.status GrafiteParser.statem
       else raise (Failure ("Compiling: " ^ tgt))
 ;;
 
-let pp_eager_statement_ast =
-  GrafiteAstPp.pp_statement ~term_pp:NotationPp.pp_term
-    ~lazy_term_pp:(fun _ -> assert false) ~obj_pp:(fun _ -> assert false)
+let pp_eager_statement_ast = GrafiteAstPp.pp_statement 
 
 let eval_nmacro include_paths (buffer : GText.buffer) guistuff grafite_status user_goal unparsed_text parsed_text script mac =
   let parsed_text_length = String.length parsed_text in
@@ -190,41 +188,7 @@ let eval_nmacro include_paths (buffer : GText.buffer) guistuff grafite_status us
       [s, nl ^ trace ^ thms ^ ";"], "", parsed_text_length
   | TA.NAutoInteractive (_, (Some _,_)) -> assert false
 
-let rec eval_macro include_paths (buffer : GText.buffer) guistuff grafite_status user_goal unparsed_text parsed_text script mac =
-  (* no idea why ocaml wants this *)
-  let parsed_text_length = String.length parsed_text in
-  let dbd = LibraryDb.instance () in
-  match mac with
-  (* REAL macro *)
-  | TA.Hint (loc, rewrite) -> (* MATITA 1.0 *) assert false
-  | TA.Eval (_, kind, term) -> assert false (* MATITA 1.0
-      let metasenv = GrafiteTypes.get_proof_metasenv grafite_status in
-      let context =
-       match user_goal with
-          None -> []
-        | Some n -> GrafiteTypes.get_proof_context grafite_status n in
-      let ty,_ = CTC.type_of_aux' metasenv context term CicUniv.empty_ugraph in
-      let term = 
-        match kind with
-        | `Normalize ->
-             CicReduction.normalize ~delta:true ~subst:[] context term
-        | `Simpl -> 
-            ProofEngineReduction.simpl context term
-        | `Unfold None ->
-            ProofEngineReduction.unfold ?what:None context term
-        | `Unfold (Some lazy_term) ->
-             let what, _, _ = 
-               lazy_term context metasenv CicUniv.empty_ugraph in
-             ProofEngineReduction.unfold ~what context term
-        | `Whd ->
-            CicReduction.whd ~delta:true ~subst:[] context term
-      in
-      let t_and_ty = Cic.Cast (term,ty) in
-      guistuff.mathviewer#show_entry (`Cic (t_and_ty,metasenv));
-      [(grafite_status#set_proof_status No_proof), parsed_text ],"", 
-        parsed_text_length *)
-                                
-and eval_executable include_paths (buffer : GText.buffer) guistuff
+let rec eval_executable include_paths (buffer : GText.buffer) guistuff
 grafite_status user_goal unparsed_text skipped_txt nonskipped_txt
 script ex loc
 =
@@ -237,11 +201,6 @@ script ex loc
      (TA.Executable (loc, ex))
   with
      MatitaTypes.Cancel -> [], "", 0
-   | GrafiteEngine.Macro (_loc,lazy_macro) ->
-      let context = [] in
-      let grafite_status,macro = lazy_macro context in
-       eval_macro include_paths buffer guistuff grafite_status
-        user_goal unparsed_text (skipped_txt ^ nonskipped_txt) script macro
    | GrafiteEngine.NMacro (_loc,macro) ->
        eval_nmacro include_paths buffer guistuff grafite_status
         user_goal unparsed_text (skipped_txt ^ nonskipped_txt) script macro