]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/grafite_engine/grafiteEngine.ml
- non_punctuational_tacticals ported to NG
[helm.git] / helm / software / components / grafite_engine / grafiteEngine.ml
index b1cedb077bec99b5132da5d5f87cab8db0cacea6..89f50c8fd39324eecfdec735cbbc67f6c5abef66 100644 (file)
@@ -583,6 +583,13 @@ let eval_ng_punct (_text, _prefix_len, punct) =
   | GrafiteAst.Merge _ -> NTactics.merge_tac 
 ;;
 
+let eval_ng_non_punct (_text, _prefix_len, punct) =
+  match punct with
+  | GrafiteAst.Focus (_,l) -> NTactics.focus_tac l
+  | GrafiteAst.Unfocus _ -> NTactics.unfocus_tac
+  | GrafiteAst.Skip _ -> NTactics.skip_tac
+;;
+
 let eval_ng_tac (text, prefix_len, tac) =
   match tac with
   | GrafiteAst.NApply (_loc, t) -> NTactics.apply_tac (text,prefix_len,t) 
@@ -758,14 +765,24 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status
              else
               let obj =
 prerr_endline "CSC: here we should fix the height!!!";
-               uri,height,[],[],
-                NCicUntrusted.map_obj_kind (NCicUntrusted.apply_subst subst) obj
+               (uri,height,[],[],
+                NCicUntrusted.map_obj_kind (NCicUntrusted.apply_subst subst)
+                 obj) in
+              NCicTypeChecker.typecheck_obj obj;
+              NCicLibrary.add_obj uri obj;
+              let objs = NCicElim.mk_elims obj in
+              let uris =
+               uri::
+                List.map
+                 (fun (uri,_,_,_,_) as obj ->
+                   NCicTypeChecker.typecheck_obj obj;
+                   NCicLibrary.add_obj uri obj;
+                   uri
+                 ) objs
               in
-               NCicTypeChecker.typecheck_obj obj;
-               NCicLibrary.add_obj uri obj;
                {status with 
                  GrafiteTypes.ng_status = 
-                  GrafiteTypes.CommandMode lexicon_status },`New [uri]
+                  GrafiteTypes.CommandMode lexicon_status },`New uris
        | _ -> raise (GrafiteTypes.Command_error "Not in proof mode"))
   | GrafiteAst.Relation (loc, id, a, aeq, refl, sym, trans) -> 
      Setoids.add_relation id a aeq refl sym trans;
@@ -900,6 +917,15 @@ prerr_endline "CSC: here we should fix the height!!!";
      in
       eval_tactical status
        (punctuation_tactical_of_ast (text,prefix_len,punct)),`Old []
+  | GrafiteAst.NNonPunctuationTactical (_, non_punct, punct) ->
+     (match status.GrafiteTypes.ng_status with
+     | GrafiteTypes.CommandMode _ -> assert false
+     | GrafiteTypes.ProofMode nstatus ->
+        let nstatus = eval_ng_non_punct (text,prefix_len,non_punct) nstatus in
+        let nstatus = eval_ng_punct (text,prefix_len,punct) nstatus in
+        NTacStatus.pp_tac_status nstatus;
+        { status with GrafiteTypes.ng_status= GrafiteTypes.ProofMode nstatus },
+        `New [])
   | GrafiteAst.Command (_, cmd) ->
       eval_command.ec_go ~disambiguate_command opts status (text,prefix_len,cmd)
   | GrafiteAst.Macro (loc, macro) ->