summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/schema/rng/mathml3-pragmatic.rng
blob: c137293e3ca832d44369e399613028eab47d739f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<?xml version="1.0" encoding="UTF-8"?>
<!--
      This is the Mathematical Markup Language (MathML) 3.0, an XML
      application for describing mathematical notation and capturing
      both its structure and content.
  
      Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
  
      Use and distribution of this code are permitted under the terms
      W3C Software Notice and License
      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  
  
      Revision:   $Id: mathml3-pragmatic.rnc 8515 2009-08-17 13:51:36Z kohlhase $
  
     Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
  
      This is the RelaxNG schema module for the pragmatic content part of 
      MathML (but without the presentation in token elements).
-->
<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0">
  <define name="sep">
    <a:documentation>the content of "cn" may have &lt;sep&gt; elements in it</a:documentation>
    <element name="sep">
      <empty/>
    </element>
  </define>
  <define name="cn.content" combine="choice">
    <zeroOrMore>
      <choice>
        <ref name="sep"/>
        <text/>
        <ref name="Glyph-alignmark"/>
      </choice>
    </zeroOrMore>
  </define>
  <define name="cn.type.vals" combine="choice">
    <choice>
      <value>e-notation</value>
      <value>rational</value>
      <value>complex-cartesian</value>
      <value>complex-polar</value>
      <value>constant</value>
    </choice>
  </define>
  <define name="degree">
    <a:documentation>allow degree in bvar</a:documentation>
    <element name="degree">
      <ref name="MathML.Common.attrib"/>
      <ref name="ContExp"/>
    </element>
  </define>
  <define name="logbase">
    <element name="logbase">
      <ref name="MathML.Common.attrib"/>
      <ref name="ContExp"/>
    </element>
  </define>
  <define name="momentabout">
    <element name="momentabout">
      <ref name="MathML.Common.attrib"/>
      <ref name="ContExp"/>
    </element>
  </define>
  <define name="bvar-head" combine="choice">
    <choice>
      <group>
        <optional>
          <ref name="degree"/>
        </optional>
        <ref name="ci"/>
      </group>
      <group>
        <ref name="ci"/>
        <optional>
          <ref name="degree"/>
        </optional>
      </group>
    </choice>
  </define>
  <define name="apply.content" combine="choice">
    <a:documentation>allow degree to modify &lt;root/&gt;</a:documentation>
    <ref name="root_arith1_elt"/>
    <ref name="degree"/>
    <zeroOrMore>
      <ref name="ContExp"/>
    </zeroOrMore>
  </define>
  <define name="apply.content" combine="choice">
    <ref name="moment_s_data1_elt"/>
    <interleave>
      <optional>
        <ref name="degree"/>
      </optional>
      <optional>
        <ref name="momentabout"/>
      </optional>
    </interleave>
    <zeroOrMore>
      <ref name="ContInPres"/>
    </zeroOrMore>
  </define>
  <define name="apply.content" combine="choice">
    <ref name="log_transc1_elt"/>
    <ref name="logbase"/>
    <zeroOrMore>
      <ref name="ContExp"/>
    </zeroOrMore>
  </define>
  <define name="apply.content" combine="choice">
    <a:documentation>allow apply to act as a binder</a:documentation>
    <ref name="bind.content"/>
  </define>
  <define name="domainofapplication">
    <element name="domainofapplication">
      <ref name="Definition.attrib"/>
      <ref name="MathML.Common.attrib"/>
      <optional>
        <ref name="cdbase.attrib"/>
      </optional>
      <ref name="ContExp"/>
    </element>
  </define>
  <define name="lowlimit">
    <element name="lowlimit">
      <ref name="Definition.attrib"/>
      <ref name="MathML.Common.attrib"/>
      <optional>
        <ref name="cdbase.attrib"/>
      </optional>
      <oneOrMore>
        <ref name="ContExp"/>
      </oneOrMore>
    </element>
  </define>
  <define name="uplimit">
    <element name="uplimit">
      <ref name="Definition.attrib"/>
      <ref name="MathML.Common.attrib"/>
      <optional>
        <ref name="cdbase.attrib"/>
      </optional>
      <oneOrMore>
        <ref name="ContExp"/>
      </oneOrMore>
    </element>
  </define>
  <define name="condition">
    <element name="condition">
      <ref name="Definition.attrib"/>
      <optional>
        <ref name="cdbase.attrib"/>
      </optional>
      <ref name="ContExp"/>
    </element>
  </define>
  <define name="qualifier" combine="choice">
    <a:documentation>allow the non-strict qualifiers</a:documentation>
    <choice>
      <ref name="domainofapplication"/>
      <group>
        <ref name="uplimit"/>
        <optional>
          <ref name="lowlimit"/>
        </optional>
      </group>
      <group>
        <ref name="lowlimit"/>
        <optional>
          <ref name="uplimit"/>
        </optional>
      </group>
      <ref name="degree"/>
      <ref name="condition"/>
    </choice>
  </define>
  <define name="opel.constant">
    <a:documentation>we collect the operator elements by role</a:documentation>
    <notAllowed/>
  </define>
  <define name="opel.binder">
    <notAllowed/>
  </define>
  <define name="opel.application">
    <notAllowed/>
  </define>
  <define name="opel.semantic-attribution">
    <notAllowed/>
  </define>
  <define name="opel.attribution">
    <notAllowed/>
  </define>
  <define name="opel.error">
    <notAllowed/>
  </define>
  <define name="opels">
    <choice>
      <ref name="opel.constant"/>
      <ref name="opel.binder"/>
      <ref name="opel.application"/>
      <ref name="opel.semantic-attribution"/>
      <ref name="opel.attribution"/>
      <ref name="opel.error"/>
    </choice>
  </define>
  <define name="container">
    <notAllowed/>
  </define>
  <define name="MathMLType" combine="choice">
    <a:documentation>the values of the MathML type attributes;  </a:documentation>
    <choice>
      <value>real</value>
      <value>complex</value>
      <value>function</value>
      <value>algebraic</value>
      <value>integer</value>
    </choice>
  </define>
  <define name="apply-binder-head">
    <a:documentation>we instantiate the strict content model by structure checking</a:documentation>
    <choice>
      <ref name="semantics-apply-binder"/>
      <ref name="opel.binder"/>
    </choice>
  </define>
  <define name="apply.content" combine="choice">
    <ref name="apply-binder-head"/>
    <zeroOrMore>
      <ref name="bvar"/>
    </zeroOrMore>
    <optional>
      <ref name="qualifier"/>
    </optional>
    <zeroOrMore>
      <ref name="ContExp"/>
    </zeroOrMore>
  </define>
  <define name="semantics-apply-binder">
    <element name="semantics">
      <ref name="semantics.attribs"/>
      <ref name="apply-binder-head"/>
      <zeroOrMore>
        <ref name="semantics-annotation"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="apply-head" combine="choice">
    <ref name="opel.application"/>
  </define>
  <define name="bind-head" combine="choice">
    <ref name="opel.binder"/>
  </define>
  <define name="cerror-head" combine="choice">
    <ref name="opel.error"/>
  </define>
  <define name="ContExp" combine="choice">
    <a:documentation>allow all functions, constants, and containers to be content expressions on their own</a:documentation>
    <choice>
      <ref name="opel.constant"/>
      <ref name="opel.application"/>
      <ref name="container"/>
    </choice>
  </define>
  <!-- allow no body -->
  <define name="bind.content" combine="choice">
    <ref name="bind-head"/>
    <zeroOrMore>
      <ref name="bvar"/>
    </zeroOrMore>
    <optional>
      <ref name="qualifier"/>
    </optional>
  </define>
  <!--
    not sure what a sequence of things is supposed to map to in strict/OM
    but is definitely allowed in pragmatic
    see Content/SequencesAndSeries/product/rec-product3
  -->
  <define name="math.content" combine="choice">
    <zeroOrMore>
      <ref name="ContExp"/>
    </zeroOrMore>
  </define>
  <define name="opel.content" combine="choice">
    <choice>
      <ref name="PresExp"/>
      <ref name="Glyph-alignmark"/>
    </choice>
  </define>
</grammar>