]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/grafite/grafiteAst.ml
- nrewrite ((very?) rough implementation)
[helm.git] / helm / software / components / grafite / grafiteAst.ml
index c861a1a45657f937f1d158a50f2a0f19c1ec8e18..a83023140b3eb3d65fa1cd8652cfdab54848bc89 100644 (file)
@@ -32,6 +32,9 @@ type loc = Stdpp.location
 type ('term, 'lazy_term, 'ident) pattern =
   'lazy_term option * ('ident * 'term) list * 'term option
 
+type npattern = 
+ CicNotationPt.term option * (string * CicNotationPt.term) list * CicNotationPt.term option
+
 type 'lazy_term reduction =
   [ `Normalize
   | `Simpl
@@ -46,6 +49,16 @@ type 'term just =
  [ `Term of 'term
  | `Auto of 'term auto_params ]
 
+type ntactic =
+   | NApply of loc * CicNotationPt.term
+   | NCases of loc * CicNotationPt.term * npattern  
+   | NCase1 of loc * string
+   | NChange of loc * npattern * CicNotationPt.term
+   | NElim of loc * CicNotationPt.term * npattern  
+   | NId of loc
+   | NIntro of loc * string
+   | NRewrite of loc * direction * CicNotationPt.term * npattern
+
 type ('term, 'lazy_term, 'reduction, 'ident) tactic =
   (* Higher order tactics (i.e. tacticals) *)
   | Do of loc * int * ('term, 'lazy_term, 'reduction, 'ident) tactic
@@ -150,13 +163,14 @@ type ('term,'lazy_term) macro =
 
 (** To be increased each time the command type below changes, used for "safe"
  * marshalling *)
-let magic = 14
+let magic = 17
 
 type ('term,'obj) command =
   | Index of loc * 'term option (* key *) * UriManager.uri (* value *)
   | Coercion of loc * 'term * bool (* add_obj *) *
      int (* arity *) * int (* saturations *)
-  | UnificationHint of (loc * 'term)
+  | PreferCoercion of loc * 'term
+  | UnificationHint of loc * 'term * int (* term, precedence *)
   | Default of loc * string * UriManager.uri list
   | Drop of loc
   | Include of loc * string
@@ -166,8 +180,9 @@ type ('term,'obj) command =
   | Set of loc * string * string
   | Print of loc * string
   | Qed of loc
+  | NObj of loc * CicNotationPt.term CicNotationPt.obj
 
-type ('term, 'lazy_term, 'reduction, 'ident) punctuation_tactical =
+type punctuation_tactical =
   | Dot of loc
   | Semicolon of loc
   | Branch of loc
@@ -176,7 +191,7 @@ type ('term, 'lazy_term, 'reduction, 'ident) punctuation_tactical =
   | Wildcard of loc
   | Merge of loc
 
-type ('term,'lazy_term,'reduction,'ident) non_punctuation_tactical =
+type non_punctuation_tactical =
   | Focus of loc * int list
   | Unfocus of loc
   | Skip of loc
@@ -184,11 +199,11 @@ type ('term,'lazy_term,'reduction,'ident) non_punctuation_tactical =
 type ('term, 'lazy_term, 'reduction, 'obj, 'ident) code =
   | Command of loc * ('term, 'obj) command
   | Macro of loc * ('term,'lazy_term) macro 
+  | NTactic of loc * ntactic * punctuation_tactical
   | Tactic of loc * ('term, 'lazy_term, 'reduction, 'ident) tactic option
-      * ('term, 'lazy_term, 'reduction, 'ident) punctuation_tactical
-  | NonPunctuationTactical of loc
-      * ('term, 'lazy_term, 'reduction, 'ident) non_punctuation_tactical
-      * ('term, 'lazy_term, 'reduction, 'ident) punctuation_tactical
+      * punctuation_tactical
+  | NonPunctuationTactical of loc * non_punctuation_tactical
+      * punctuation_tactical
              
 type ('term, 'lazy_term, 'reduction, 'obj, 'ident) comment =
   | Note of loc * string