1 (* Copyright (C) 2004, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
28 type direction = [ `LeftToRight | `RightToLeft ]
30 type loc = Stdpp.location
33 NotationPt.term option * (string * NotationPt.term) list * NotationPt.term option
35 type auto_params = NotationPt.term list option * (string*string) list
38 | NApply of loc * NotationPt.term
39 | NSmartApply of loc * NotationPt.term
40 | NAssert of loc * ((string * [`Decl of NotationPt.term | `Def of NotationPt.term * NotationPt.term]) list * NotationPt.term) list
41 | NCases of loc * NotationPt.term * npattern
42 | NCase1 of loc * string
43 | NChange of loc * npattern * NotationPt.term
44 | NClear of loc * string list
45 | NConstructor of loc * int option * NotationPt.term list
46 | NCut of loc * NotationPt.term
47 (* | NDiscriminate of loc * NotationPt.term
48 | NSubst of loc * NotationPt.term *)
49 | NDestruct of loc * string list option * string list
50 | NElim of loc * NotationPt.term * npattern
51 | NGeneralize of loc * npattern
53 | NIntro of loc * string
54 | NIntros of loc * string list
55 | NInversion of loc * NotationPt.term * npattern
56 | NLApply of loc * NotationPt.term
57 | NLetIn of loc * npattern * NotationPt.term * string
58 | NReduce of loc * [ `Normalize of bool | `Whd of bool ] * npattern
59 | NRewrite of loc * direction * NotationPt.term * npattern
60 | NAuto of loc * auto_params
65 | NPos of loc * int list
66 | NPosbyname of loc * string
70 | NFocus of loc * int list
72 | NTry of loc * ntactic
74 | NRepeat of loc * ntactic
75 | NBlock of loc * ntactic list
78 | NCheck of loc * NotationPt.term
79 | Screenshot of loc * string
80 | NAutoInteractive of loc * auto_params
83 (** To be increased each time the command type below changes, used for "safe"
87 (* composed magic: term + command magics. No need to change this value *)
88 let magic = magic + 10000 * NotationPt.magic
91 | Ident_alias of string * string (* identifier, uri *)
92 | Symbol_alias of string * string option * string (* name, uri, description *)
93 | Number_alias of string option * string (* uri, description *)
95 type inclusion_mode = WithPreferences | WithoutPreferences | OnlyPreferences (* aka aliases *)
98 | Include of loc * inclusion_mode * string (* _,buri,_,path *)
99 | UnificationHint of loc * NotationPt.term * int (* term, precedence *)
100 | NObj of loc * NotationPt.term NotationPt.obj
101 | NDiscriminator of loc * NotationPt.term
102 | NInverter of loc * string * NotationPt.term * bool list option * NotationPt.term option
103 | NUnivConstraint of loc * NUri.uri * NUri.uri
104 | NCopy of loc * string * NUri.uri * (NUri.uri * NUri.uri) list
105 | NCoercion of loc * string *
106 NotationPt.term * NotationPt.term *
107 (string * NotationPt.term) * NotationPt.term
109 (* ex lexicon commands *)
110 | Alias of loc * alias_spec
111 (** parameters, name, type, fields *)
112 | Notation of loc * direction option * NotationPt.term * Gramext.g_assoc *
113 int * NotationPt.term
114 (* direction, l1 pattern, associativity, precedence, l2 pattern *)
115 | Interpretation of loc *
116 string * (string * NotationPt.argument_pattern list) *
117 NotationPt.cic_appl_pattern
118 (* description (i.e. id), symbol, arg pattern, appl pattern *)
121 | NCommand of loc * command
122 | NMacro of loc * nmacro
123 | NTactic of loc * ntactic list
126 | Note of loc * string
130 | Executable of loc * code
131 | Comment of loc * comment
133 let description_of_alias =
136 | Symbol_alias (_,_,desc)
137 | Number_alias (_,desc) -> desc