X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fgrafite%2FgrafiteAst.ml;h=e96cf1bbcb8b9cf04b28f14c61613c9cdcaee9a3;hb=6114cb246d344e93b0dfeae4d273dc4422633ecb;hp=173912e1f1a918586dcf03f45580707ccca8f935;hpb=cd664aefb80554952ed9b010f0c5199ce3a6f8f2;p=helm.git diff --git a/matita/components/grafite/grafiteAst.ml b/matita/components/grafite/grafiteAst.ml index 173912e1f..e96cf1bbc 100644 --- a/matita/components/grafite/grafiteAst.ml +++ b/matita/components/grafite/grafiteAst.ml @@ -29,33 +29,36 @@ type direction = [ `LeftToRight | `RightToLeft ] type loc = Stdpp.location +type nterm = NotationPt.term + type npattern = - NotationPt.term option * (string * NotationPt.term) list * NotationPt.term option + nterm option * (string * nterm) list * nterm option -type auto_params = NotationPt.term list option * (string*string) list +type auto_params = nterm list option * (string*string) list type ntactic = - | NApply of loc * NotationPt.term - | NSmartApply of loc * NotationPt.term - | NAssert of loc * ((string * [`Decl of NotationPt.term | `Def of NotationPt.term * NotationPt.term]) list * NotationPt.term) list - | NCases of loc * NotationPt.term * npattern + | NApply of loc * nterm + | NSmartApply of loc * nterm + | NAssert of loc * ((string * [`Decl of nterm | `Def of nterm * nterm]) list * nterm) list + | NCases of loc * nterm * npattern | NCase1 of loc * string - | NChange of loc * npattern * NotationPt.term - | NConstructor of loc * int option * NotationPt.term list - | NCut of loc * NotationPt.term -(* | NDiscriminate of loc * NotationPt.term - | NSubst of loc * NotationPt.term *) + | NChange of loc * npattern * nterm + | NClear of loc * string list + | NConstructor of loc * int option * nterm list + | NCut of loc * nterm +(* | NDiscriminate of loc * nterm + | NSubst of loc * nterm *) | NDestruct of loc * string list option * string list - | NElim of loc * NotationPt.term * npattern + | NElim of loc * nterm * npattern | NGeneralize of loc * npattern | NId of loc | NIntro of loc * string | NIntros of loc * string list - | NInversion of loc * NotationPt.term * npattern - | NLApply of loc * NotationPt.term - | NLetIn of loc * npattern * NotationPt.term * string + | NInversion of loc * nterm * npattern + | NLApply of loc * nterm + | NLetIn of loc * npattern * nterm * string | NReduce of loc * [ `Normalize of bool | `Whd of bool ] * npattern - | NRewrite of loc * direction * NotationPt.term * npattern + | NRewrite of loc * direction * nterm * npattern | NAuto of loc * auto_params | NDot of loc | NSemicolon of loc @@ -74,46 +77,40 @@ type ntactic = | NBlock of loc * ntactic list type nmacro = - | NCheck of loc * NotationPt.term + | NCheck of loc * nterm | Screenshot of loc * string | NAutoInteractive of loc * auto_params | NIntroGuess of loc (** To be increased each time the command type below changes, used for "safe" * marshalling *) -let magic = 35 +let magic = 36 (* composed magic: term + command magics. No need to change this value *) let magic = magic + 10000 * NotationPt.magic -type command = - | Set of loc * string * string - | Print of loc * string - type alias_spec = | Ident_alias of string * string (* identifier, uri *) | Symbol_alias of string * int * string (* name, instance no, description *) | Number_alias of int * string (* instance no, description *) -type inclusion_mode = WithPreferences | WithoutPreferences (* aka aliases *) +type inclusion_mode = WithPreferences | WithoutPreferences | OnlyPreferences (* aka aliases *) -type ncommand = +type command = | Include of loc * inclusion_mode * string (* _,buri,_,path *) - | UnificationHint of loc * NotationPt.term * int (* term, precedence *) - | NObj of loc * NotationPt.term NotationPt.obj - | NDiscriminator of loc * NotationPt.term - | NInverter of loc * string * NotationPt.term * bool list option * NotationPt.term option + | UnificationHint of loc * nterm * int (* term, precedence *) + | NObj of loc * nterm NotationPt.obj + | NDiscriminator of loc * nterm + | NInverter of loc * string * nterm * bool list option * nterm option | NUnivConstraint of loc * NUri.uri * NUri.uri | NCopy of loc * string * NUri.uri * (NUri.uri * NUri.uri) list - | NCoercion of loc * string * - NotationPt.term * NotationPt.term * - (string * NotationPt.term) * NotationPt.term - | NQed of loc + | NCoercion of loc * string * bool * nterm * nterm * (string * nterm) * nterm + | NQed of loc * bool (* ex lexicon commands *) | Alias of loc * alias_spec (** parameters, name, type, fields *) - | Notation of loc * direction option * NotationPt.term * Gramext.g_assoc * - int * NotationPt.term + | Notation of loc * direction option * nterm * Gramext.g_assoc * + int * nterm (* direction, l1 pattern, associativity, precedence, l2 pattern *) | Interpretation of loc * string * (string * NotationPt.argument_pattern list) * @@ -121,8 +118,7 @@ type ncommand = (* description (i.e. id), symbol, arg pattern, appl pattern *) type code = - | Command of loc * command - | NCommand of loc * ncommand + | NCommand of loc * command | NMacro of loc * nmacro | NTactic of loc * ntactic list