umath 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,722 @@
1
+ = UnicodeMath notation accepted by Umath
2
+ :toc:
3
+
4
+ This page describes the UnicodeMath that Umath reads: how the input is
5
+ prepared, which constructs the grammar accepts, and which part of the typed
6
+ model each construct becomes. It is part of the specification set tracked in
7
+ https://github.com/plurimath/plurimath/issues/525[plurimath#525].
8
+
9
+ UnicodeMath is the linear format described in
10
+ https://www.unicode.org/notes/tn28/[Unicode Technical Note 28]. Umath reads
11
+ the subset and the variations of it that Plurimath reads at commit
12
+ `e7ab4a5186c9be96f62d670574bc2c72f9365ad4` (Plurimath 0.11.17). It does not
13
+ read all of UTN 28; <<utn28-coverage>> lists the constructs of UTN 28
14
+ version 3.2 and, for each, whether the corpus shows umath reading it,
15
+ refusing it or neither.
16
+
17
+ Everything here is taken from three sources in this repository:
18
+
19
+ * the grammar, `grammars/umath.parg`, generated from the legacy grammar;
20
+ * the model, `model/umath.lml.json`, generated from that grammar;
21
+ * the specs under `spec/` and the stage corpus pinned in
22
+ `spec/fixtures/testsuite-pin.yml`.
23
+
24
+ How the grammar and the model are produced and checked is in
25
+ link:parser-contract.adoc[the parser contract] and
26
+ link:model-contract.adoc[the model contract]. This page describes the
27
+ notation.
28
+
29
+ == Before the grammar runs
30
+
31
+ The grammar reads a rewritten copy of the input. The steps are listed in the
32
+ parser contract. In short:
33
+
34
+ * A `#` starts an equation label. The text after the last `#` becomes the
35
+ document's `label`; a `#` inside `✎(...)` does not count.
36
+ * Every non-ASCII character becomes a hexadecimal character reference, so
37
+ `α` reaches the grammar as `&#x3b1;`. `&` and `"` stay as they are.
38
+ * Everything from the first `⫷` to the last `⫸` is a comment and is removed.
39
+ * `\\` becomes `\`, and `\uXXXX` escapes become the character they name.
40
+ * Leading and trailing whitespace is removed.
41
+
42
+ == Structure of a formula
43
+
44
+ The root rule is `expression`. An expression is a sequence of elements.
45
+ Elements may be separated by spaces, by relational symbols such as `=` or
46
+ `≤`, and by operators. An element is one of the constructs below, or a plain
47
+ operand: a letter, a number, a symbol or a bracketed group.
48
+
49
+ === Fractions
50
+
51
+ [cols="2,3"]
52
+ |===
53
+ |Form |Meaning
54
+
55
+ |`a/b`, `a\over b` |fraction (`Frac`, with `numerator` and `denominator`)
56
+ |`a⁄b`, `a\sdiv b`, `a\sfrac b` |bevelled fraction
57
+ |`a⊘b`, `a\ndiv b` |fraction not in display style
58
+ |`a∕b`, `a\ldiv b` |linear fraction
59
+ |`a¦b`, `a\atop b` |stack without a bar
60
+ |`a⒞b`, `a\choose b` |binomial
61
+ |`½`, `⅓` and the other vulgar fraction characters |a fraction symbol
62
+ |===
63
+
64
+ A superscript character, a fraction bar and a subscript character, such as
65
+ `ᵃ/ₙ`, make a small fraction (`mini_numerator`, `mini_denominator`).
66
+
67
+ === Scripts
68
+
69
+ `_` gives a subscript and `^` a superscript, in either order. A script is
70
+ one operand or a bracketed group; the brackets of `x_(i+1)` are not part of
71
+ the script. Unicode subscript and superscript characters, such as `x²` or
72
+ `xᵢ`, are read as scripts too. The grammar also has rules for scripts written before a base
73
+ (`pre_subsup`).
74
+
75
+ === Large operators
76
+
77
+ Characters such as `∑`, `∏`, `∫`, `∮`, `⋃` and `⋂`, and command names such
78
+ as `\sum`, `\bigcup` and `\amalg`, are n-ary operators (capture
79
+ `nary_class`). They take limits as scripts and an operand after them.
80
+
81
+ === Functions
82
+
83
+ The function names
84
+
85
+ `arccos arcsin arctan arg cos cosh cot csc csch def deg det dim erf exp gcd
86
+ hom Im inf ker lim ln log max min mod Pr Re sec sech sin sinh sup tan tanh tg`
87
+
88
+ are read as functions (capture `unary_functions`) and take the operand that
89
+ follows (class `UnarySubsup` for `sin x`).
90
+
91
+ === Roots
92
+
93
+ * `√x`, `\sqrt x` is a square root, `∛x` a cube root and `∜x` a fourth
94
+ root.
95
+ * `√(n&x)` is the `n`-th root of `x`.
96
+ * `⒭`, `\root` take the index and then the radicand.
97
+
98
+ === Matrices and arrays
99
+
100
+ `■(a&b@c&d)` is a matrix: `@` separates rows and `&` separates cells. The
101
+ grammar also reads the bracketed matrix characters `⒨`, `⒱`, `⒩`, `ⓢ`,
102
+ `Ⓢ`, `█` and `Ⓒ`, and `\array`. A matrix character followed by one digit,
103
+ such as `■3`, is an identity matrix of that size
104
+ (`identity_matrix_number`).
105
+
106
+ === Brackets
107
+
108
+ `(`, `[`, `{` and their closers make a bracketed group; so do commands such
109
+ as `\langle`, `\lceil`, `\lfloor`, `\lbrack` and `\begin`, with their
110
+ closers. A group may mix a bracket with `|`. In the model the brackets are
111
+ `open_paren` and `close_paren`, both of class `Paren`.
112
+
113
+ === Accents, enclosures and styling
114
+
115
+ * Combining accents after an operand, such as `x̂` or `x⃗`, are accents
116
+ (capture `accents`). Overlays and marks below are `diacritics_accents`.
117
+ * Horizontal brackets `⏞`, `⏟`, `⎴`, `⎵`, `⏜`, `⏝`, `⏠`, `⏡` take the
118
+ operand that follows (`hbrack`).
119
+ * `▭(...)`, `\rect(...)` is an enclosure, `⟡(...)`, `\phantom(...)` a
120
+ phantom. The grammar has a box rule for `□`, but it matches the raw
121
+ character, which preprocessing has already encoded, so `□a` is read as
122
+ the symbol `□` followed by `a` (see <<examples>>).
123
+ * `✎(colour&x)`, `\color(...)` sets a colour and `☁(...)`, `\backcolor(...)`
124
+ a background colour.
125
+ * `ⓘ(...)` carries an intent, and `ⓐ(...)` an argument function.
126
+ * Font commands such as `\mbf`, `\mit`, `\Bbb`, `\mscr`, `\mfrak`,
127
+ `\msans` and `\mtt` followed by a letter set a font. A mathematical
128
+ alphanumeric character such as `𝐱` is read as a Unicode symbol, not as a
129
+ font. `ᅲ(...)` is monospace text.
130
+
131
+ === Symbols and numbers
132
+
133
+ Each symbol in the model is a `MathSymbol` (or a `SymbolNode` or `Paren`)
134
+ with `spelling` (the text matched, such as `&#x3b1;` for `α` or `alpha` for
135
+ `\alpha`), `value` (its Unicode text from `data/umath-symbols.json`) and
136
+ `kind`. A spelling the catalog lacks has kind `unlisted`.
137
+
138
+ Numbers are kept as written. `1.5` is a `DecimalNumber` with `whole`,
139
+ `decimal` and `fractional`. The decimal marker is `.` unless the caller
140
+ passes `decimal: ","` or `decimal: "٫"`. Hexadecimal, binary and octal
141
+ numbers are separate forms.
142
+
143
+ == The typed model
144
+
145
+ `Umath.parse` returns a `Umath::Model::Document` with `expression`,
146
+ `label` and `decimal`. Input with no formula gives a document whose
147
+ `expression` is nil. The model has 74 generated classes plus `Document`;
148
+ captures that can hold a whole expression share the class
149
+ `Model::Expression`. Every field with its type is listed in
150
+ `model/umath.lml.json`.
151
+
152
+ [[examples]]
153
+ == Examples
154
+
155
+ These results were produced by parsing each input with `Umath.parse` at this
156
+ revision and printing the non-empty fields of the model. A symbol is shown as
157
+ `MathSymbol(spelling)`; the spelling is the encoded text the grammar matched.
158
+
159
+ [source]
160
+ ----
161
+ a/b
162
+ Expression(frac: Frac(denominator: Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("b")))),
163
+ numerator: Expression(atom: Atom(alphanumeric: MathSymbol("a")))))
164
+
165
+ x^2
166
+ Expression(sup_exp: SupExp(base: Expression(symbol: SymbolNode(spelling: "x")),
167
+ sup: Expression(sup_script: Expression(operand: Operand(factor: Expression(digit: Digit(number: "2")))))))
168
+
169
+ √x
170
+ Expression(factor: Expression(root: RootNode(first_value: Expression(factor: Expression(atom:
171
+ Atom(alphanumeric: MathSymbol("x")))), root_symbol: MathSymbol("&#x221a;"))))
172
+
173
+ √(3&x)
174
+ Expression(factor: Expression(root: RootNode(
175
+ first_value: Expression(expr: Expression(empty: "", factor: Expression(digit: Digit(number: "3")))),
176
+ second_value: SecondValue(expr: Expression(empty: "", factor: Expression(atom: Atom(alphanumeric: MathSymbol("x"))))))))
177
+
178
+ sin x
179
+ Expression(unary_subsup: UnarySubsup(first_value: Expression(factor: Expression(atom:
180
+ Atom(alphanumeric: MathSymbol("x")))), unary_functions: "sin"))
181
+
182
+ (a+b)
183
+ Expression(factor: Expression(intermediate_exp: Expression(close_paren: Paren(spelling: ")"),
184
+ exp: Expression(exp: Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("b")))),
185
+ operator: MathSymbol("+")), factor: Expression(atom: Atom(alphanumeric: MathSymbol("a"))),
186
+ open_paren: Paren(spelling: "("))))
187
+
188
+ ■(a&b@c&d)
189
+ Expression(table: Table(array: ArrayNode(
190
+ tr: Tr(td: Td(exp: Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("a"))))),
191
+ tds: Tds(td: Td(exp: Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("b"))))))),
192
+ trs: Trs(tr: Tr(td: Td(exp: Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("c"))))),
193
+ tds: Tds(td: Td(exp: Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("d"))))))))),
194
+ matrixs: "&#x25a0;"))
195
+
196
+ ■3
197
+ Expression(table: Table(identity_matrix_number: "3", matrixs: "&#x25a0;"))
198
+
199
+ ᵃ/ₙ
200
+ Expression(frac: Frac(mini_denominator: MiniDenominator(sub_alpha: "&#x2099;"),
201
+ mini_numerator: MiniNumerator(sup_alpha: "&#x1d43;")))
202
+
203
+ (a¦b)
204
+ Expression(factor: Expression(intermediate_exp: Expression(close_paren: Paren(spelling: ")"),
205
+ frac: Frac(atop: "&#xa6;", denominator: Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("b")))),
206
+ numerator: Expression(atom: Atom(alphanumeric: MathSymbol("a")))), open_paren: Paren(spelling: "("))))
207
+
208
+ x̂
209
+ Expression(accents: Accents(empty: "", first_value: Expression(atom: Atom(alphanumeric: MathSymbol("x"))),
210
+ list: [ListItem(accent_symbols: MathSymbol("&#x302;"))]))
211
+
212
+ □a
213
+ Expression(factor: Expression(ordinary_symbols: MathSymbol("&#x25a1;")),
214
+ operand: Operand(factor: Expression(atom: Atom(alphanumeric: MathSymbol("a")))))
215
+
216
+ α
217
+ Expression(factor: Expression(ordinary_symbols: MathSymbol("&#x3b1;")))
218
+
219
+ \alpha
220
+ Expression(factor: Expression(ordinary_symbols: MathSymbol("alpha")))
221
+
222
+ 𝐱
223
+ Expression(factor: Expression(atom: Atom(char: Char(unicode_symbols: MathSymbol("&#x1d431;")))))
224
+
225
+ 1.5
226
+ Expression(factor: Expression(decimal_number: DecimalNumber(decimal: ".",
227
+ fractional: Fractional(number: "5"), whole: Whole(number: "1"))))
228
+
229
+ a#(1)
230
+ Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("a")))), label "(1)"
231
+
232
+ ⫷c⫸x
233
+ Expression(factor: Expression(atom: Atom(alphanumeric: MathSymbol("x"))))
234
+ ----
235
+
236
+ Fields inside each class are printed in the order the class declares them,
237
+ not in input order.
238
+
239
+ == Errors
240
+
241
+ Input the grammar does not match raises `Umath::ParseError`, with
242
+ `char_offset` and `byte_offset` in the caller's text. The wording of the
243
+ message is not part of the contract. Input nested too deeply for the engine
244
+ raises `Umath::NestingTooDeep`.
245
+
246
+ == Conformance
247
+
248
+ * `spec/model/` checks construction of the model and its shape.
249
+ * `spec/corpus/replay_corpus_spec.rb` and `spec/stage_cases/` replay the
250
+ stage corpus generation pinned in `spec/fixtures/testsuite-pin.yml`
251
+ (plurimath-testsuite `stages/unicode/`, generation 4, 72 cases).
252
+ * The oracle specs compare the raw tree with captures of the Plurimath
253
+ parser.
254
+
255
+ [[utn28-coverage]]
256
+ == Coverage of UTN 28
257
+
258
+ The constructs are taken from
259
+ https://www.unicode.org/notes/tn28/tn28-6.html[UTN 28 version 3.2]
260
+ (April 13, 2023). The mapping from construct to rows is
261
+ `docs/utn28-coverage.yml`. `scripts/utn28_coverage.rb` parses every mapped
262
+ row, checks that its outcome is the one the row expects, and writes the
263
+ summary and the table below; `--check` fails when they are out of date. A
264
+ construct marked untested may still be read by the grammar: the table only
265
+ says what the corpus shows.
266
+
267
+ // BEGIN GENERATED utn28-summary
268
+ The table lists 82 constructs of UTN 28 version 3.2 with the rows that
269
+ exercise them, out of the 32 rows of `corpora/model/representative.yml` and
270
+ the 72 typed-model rows of plurimath-testsuite generation 4. Of the 82
271
+ constructs, 25 are covered, 1 is refused and 56 are untested.
272
+
273
+ Covered means that every row listed for the construct parses to the model
274
+ the row expects. Refused means that the rows give input UTN 28 defines and
275
+ that umath refuses it on purpose; this is the case for the alignment mark
276
+ `&` outside a matrix, `a&=b` (3.23). Untested means that no row exercises
277
+ the construct, so the corpus does not show whether umath reads it.
278
+
279
+ Of the rows, 51 give incomplete input, such as a trailing `/` or an unclosed
280
+ bracket, and umath refuses them. They are listed with their construct and do
281
+ not change its status. The rows `model-decimal-arabic`, `model-comment`,
282
+ `model-u-escape`, `empty-input`, `empty-label-only` and
283
+ `unicode-whitespace-only.model` belong to no UTN 28 construct. Sections 1,
284
+ 4.2-4.4, 4.7-4.9, 5, 6 and 7 define no notation and are left out.
285
+ // END GENERATED utn28-summary
286
+
287
+ // BEGIN GENERATED utn28-coverage
288
+ [cols="2,7,2,9",options="header"]
289
+ |===
290
+ |Section |Construct |Status |Rows
291
+
292
+ |2.1
293
+ |Fraction `a/b`
294
+ |covered
295
+ |`model-fraction` +
296
+ incomplete input refused: `unicode-lone-slash.model`, `unicode-trailing-slash.model`, `unicode-number-trailing-slash.model`, `unicode-leading-slash.model`, `unicode-greek-trailing-slash.model`, `unicode-double-trailing-slash.model`
297
+
298
+ |2.1
299
+ |Outer parentheses of a numerator or denominator removed, `(a+c)/d`
300
+ |untested
301
+ |
302
+
303
+ |2.1
304
+ |Left-to-right association of `/`, `1+a/b/c/d`
305
+ |untested
306
+ |
307
+
308
+ |2.1
309
+ |Decimal point in a denominator, `1/3.1416`
310
+ |untested
311
+ |
312
+
313
+ |2.1
314
+ |Skewed fraction `⁄` (`\sdiv`)
315
+ |untested
316
+ |
317
+
318
+ |2.1
319
+ |Linear fraction `∕` (`\ldiv`)
320
+ |untested
321
+ |
322
+
323
+ |2.1
324
+ |Normal-size linear fraction `\/`
325
+ |untested
326
+ |
327
+
328
+ |2.1
329
+ |Stack `¦` (`\atop`)
330
+ |covered
331
+ |`model-binomial` +
332
+ incomplete input refused: `unicode-lone-broken-bar.model`, `unicode-trailing-broken-bar.model`, `unicode-greek-broken-bar.model`
333
+
334
+ |2.1
335
+ |Binomial `⒞` (`\choose`)
336
+ |untested
337
+ |
338
+
339
+ |2.2
340
+ |Subscript `_` and superscript `^`
341
+ |covered
342
+ |`model-sup`, `model-subsup`, `unicode-number-exponent.model` +
343
+ incomplete input refused: `unicode-lone-sup.model`, `unicode-trailing-sup.model`, `unicode-greek-trailing-sup.model`, `unicode-lone-sub.model`, `unicode-trailing-sub.model`, `unicode-infinity-trailing-sub.model`, `unicode-doubled-sup.model`, `unicode-doubled-sub.model`, `unicode-sub-then-sup.model`
344
+
345
+ |2.2
346
+ |Nested scripts, associating right to left, `a_b_c`
347
+ |untested
348
+ |
349
+
350
+ |2.2
351
+ |Comma or period followed by a letter inside a subscript
352
+ |untested
353
+ |
354
+
355
+ |2.3
356
+ |Space ending an operand
357
+ |covered
358
+ |`model-nary`, `model-integral`
359
+
360
+ |2.3
361
+ |Space after `+` or `-` making it binary
362
+ |untested
363
+ |
364
+
365
+ |3.1
366
+ |Brackets `( )`, `[ ]`, `{ }`
367
+ |covered
368
+ |`unicode-fence-round.model`, `unicode-fence-square.model`, `unicode-fence-curly.model` +
369
+ incomplete input refused: `unicode-unclosed-paren.model`, `unicode-stray-close-paren.model`, `unicode-lone-close-paren.model`, `unicode-close-paren-mid.model`, `unicode-unclosed-paren-after-operator.model`, `unicode-close-paren-after-operator.model`, `unicode-unclosed-square.model`, `unicode-stray-close-square.model`, `unicode-unclosed-curly.model`, `unicode-stray-close-curly.model`, `unicode-greek-stray-close-paren.model`, `unicode-greek-unclosed-paren.model`, `refusal-close-paren`, `refusal-multibyte`
370
+
371
+ |3.1
372
+ |Other bracket characters, such as `⟨ ⟩` and `⌈ ⌉`
373
+ |covered
374
+ |`unicode-fence-angle.model`, `unicode-fence-ceiling.model` +
375
+ incomplete input refused: `unicode-unclosed-angle.model`, `unicode-stray-close-angle.model`, `unicode-unclosed-ceiling.model`, `unicode-stray-close-ceiling.model`
376
+
377
+ |3.1
378
+ |Brackets of different kinds paired, `[a,b)`
379
+ |covered
380
+ |`model-parens`
381
+
382
+ |3.1
383
+ |`\open` `├` and `\close` `┤`
384
+ |untested
385
+ |incomplete input refused: `unicode-lone-right-tack.model`
386
+
387
+ |3.1
388
+ |Size digit after `├` or `┤`
389
+ |untested
390
+ |
391
+
392
+ |3.1
393
+ |Absolute value `\|x\|`
394
+ |untested
395
+ |incomplete input refused: `unicode-unclosed-vert.model`
396
+
397
+ |3.1
398
+ |`\abs` `⒜`
399
+ |untested
400
+ |incomplete input refused: `unicode-lone-parenthesized-letter.model`
401
+
402
+ |3.1
403
+ |Norm `‖x‖`
404
+ |untested
405
+ |
406
+
407
+ |3.1
408
+ |Separators `│` (`\vbar`), `∣` (`\mid`) and `\middle`
409
+ |untested
410
+ |
411
+
412
+ |3.1
413
+ |Cases `Ⓒ` (`\cases`)
414
+ |untested
415
+ |
416
+
417
+ |3.2
418
+ |Literal operator `\`, such as `\[`
419
+ |untested
420
+ |
421
+
422
+ |3.3
423
+ |Prescripts `(_c^b)a`
424
+ |untested
425
+ |
426
+
427
+ |3.3
428
+ |Prescripts written before the base, `_c^b a`
429
+ |untested
430
+ |
431
+
432
+ |3.3
433
+ |Below script `┬` and above script `┴`
434
+ |untested
435
+ |incomplete input refused: `unicode-trailing-down-tack.model`
436
+
437
+ |3.3
438
+ |Below limit with `_` after `lim`, `max` and similar
439
+ |untested
440
+ |
441
+
442
+ |3.4
443
+ |n-ary operators with limits, `∑_(i=1)^n i`
444
+ |covered
445
+ |`model-nary`, `model-integral`
446
+
447
+ |3.4
448
+ |n-aryand operator `▒` (`\naryand`, `\of`)
449
+ |untested
450
+ |incomplete input refused: `unicode-lone-naryand.model`
451
+
452
+ |3.4
453
+ |Limit placement digit after an n-ary operator
454
+ |untested
455
+ |
456
+
457
+ |3.5
458
+ |Function names, `sin x`
459
+ |covered
460
+ |`model-function`
461
+
462
+ |3.5
463
+ |Function apply `⁡` (U+2061, `\funcapply`)
464
+ |untested
465
+ |incomplete input refused: `unicode-lone-function-apply.model`, `unicode-trailing-function-apply.model`, `unicode-greek-function-apply.model`
466
+
467
+ |3.5
468
+ |Scripted function name, `sin^2 x`
469
+ |untested
470
+ |
471
+
472
+ |3.5
473
+ |Function name with a no-break space, `lim sup`
474
+ |untested
475
+ |
476
+
477
+ |3.6
478
+ |Square root `√`
479
+ |covered
480
+ |`model-sqrt`
481
+
482
+ |3.6
483
+ |Cube root `∛` and fourth root `∜`
484
+ |untested
485
+ |
486
+
487
+ |3.6
488
+ |n-th root `√(n&a)`
489
+ |covered
490
+ |`model-nthroot`
491
+
492
+ |3.6
493
+ |`\root n\of(a)`
494
+ |untested
495
+ |
496
+
497
+ |3.7
498
+ |Rectangle `▭` (`\rect`)
499
+ |untested
500
+ |
501
+
502
+ |3.7
503
+ |Enclosure with a border mask, `▭(n&x)`
504
+ |untested
505
+ |
506
+
507
+ |3.7
508
+ |Overbar `¯` and underbar `▁`
509
+ |untested
510
+ |
511
+
512
+ |3.7
513
+ |Other enclosure characters, such as `▢` and `⬭`
514
+ |untested
515
+ |
516
+
517
+ |3.7
518
+ |Abstract box `□`, `□(n&x)`
519
+ |untested
520
+ |
521
+
522
+ |3.8
523
+ |Horizontal brackets `⏜ ⏝ ⏞ ⏟ ⏠ ⏡ ⎴ ⎵`
524
+ |covered
525
+ |`model-overbrace`
526
+
527
+ |3.8
528
+ |Stretchy character over or under text, `(a+b)┴→`
529
+ |untested
530
+ |
531
+
532
+ |3.9
533
+ |Matrix `■(a&b@c&d)`
534
+ |covered
535
+ |`model-matrix` +
536
+ incomplete input refused: `unicode-matrix-unclosed.model`, `unicode-lone-at.model`, `unicode-at-operator.model`, `unicode-greek-at-operator.model`
537
+
538
+ |3.9
539
+ |Bracketed matrices `ⓢ ⒨ ⒱ Ⓢ ⒩`
540
+ |untested
541
+ |
542
+
543
+ |3.9
544
+ |Identity matrix, a matrix character and a digit
545
+ |untested
546
+ |
547
+
548
+ |3.9
549
+ |Empty matrix, `2×3⒨`
550
+ |untested
551
+ |
552
+
553
+ |3.10
554
+ |Primes `′`
555
+ |covered
556
+ |`model-primes`
557
+
558
+ |3.10
559
+ |Combining accent after an operand, such as `x̂`
560
+ |untested
561
+ |
562
+
563
+ |3.10
564
+ |Combining accent after a parenthesized expression, `(a+b)̂`
565
+ |untested
566
+ |
567
+
568
+ |3.10
569
+ |Asterisk in a script, `a^*2`
570
+ |untested
571
+ |
572
+
573
+ |3.11
574
+ |Double-struck `ⅅ ⅆ ⅇ ⅈ ⅉ`
575
+ |untested
576
+ |
577
+
578
+ |3.12
579
+ |Subscript and superscript characters, `x²`, `y₁`
580
+ |covered
581
+ |`model-mini-scripts`
582
+
583
+ |3.13
584
+ |Binary and relational operators
585
+ |covered
586
+ |`model-operators`, `unicode-operator-plus.model`, `unicode-operator-times.model`, `unicode-operator-leq.model`, `unicode-operator-equiv.model`, `unicode-operator-plus-minus.model`, `unicode-operator-minus-plus.model`, `unicode-number-negative.model`
587
+
588
+ |3.14
589
+ |Numbers, with `.` or `,` between digits
590
+ |covered
591
+ |`unicode-number-integer.model`, `unicode-number-decimal.model`, `unicode-number-decimal-comma.model`, `model-decimal-dot`, `model-decimal-comma`
592
+
593
+ |3.14
594
+ |Comma as punctuation, `a,b`
595
+ |covered
596
+ |`model-parens`
597
+
598
+ |3.14
599
+ |Leading decimal point, `.5`
600
+ |untested
601
+ |
602
+
603
+ |3.14
604
+ |Colon after a space, read as ratio
605
+ |untested
606
+ |
607
+
608
+ |3.15
609
+ |Ordinary text in double quotes
610
+ |covered
611
+ |`model-text` +
612
+ incomplete input refused: `unicode-unclosed-quote.model`, `unicode-greek-unclosed-quote.model`
613
+
614
+ |3.15
615
+ |Escaped quote `\"` inside text
616
+ |untested
617
+ |
618
+
619
+ |3.16
620
+ |Space characters U+00A0, U+2000 to U+200B, U+202F, U+205F
621
+ |untested
622
+ |
623
+
624
+ |3.17
625
+ |Phantoms and smashes `⟡ ⬄ ⇳ ⬍ ⬆ ⬇ ⬌`, `\phantom(n&x)`
626
+ |untested
627
+ |
628
+
629
+ |3.18
630
+ |Invisible grouping `〖 〗` (`\begin`, `\end`)
631
+ |untested
632
+ |
633
+
634
+ |3.19
635
+ |Equation array `█` (`\eqarray`)
636
+ |untested
637
+ |
638
+
639
+ |3.20
640
+ |Math zone delimiters `⁅ ⁆`
641
+ |untested
642
+ |
643
+
644
+ |3.21
645
+ |Equation number `#`
646
+ |covered
647
+ |`model-label`
648
+
649
+ |3.22
650
+ |Letters, digits and operand symbols such as `∞` and `∅`
651
+ |covered
652
+ |`unicode-symbol-greek-alpha.model`, `unicode-symbol-greek-pi.model`, `unicode-symbol-infinity.model`, `unicode-symbol-empty-set.model`, `model-greek-unicode`, `model-accent`
653
+
654
+ |3.22
655
+ |Mathematical alphanumeric and letterlike characters, `𝐀`, `ℂ`
656
+ |covered
657
+ |`model-font`
658
+
659
+ |3.22
660
+ |Factorial `!`
661
+ |untested
662
+ |
663
+
664
+ |3.23
665
+ |Soft break `⁢` (U+2062, `\itimes`)
666
+ |untested
667
+ |
668
+
669
+ |3.23
670
+ |Alignment mark `&` outside a matrix, `a&=b`
671
+ |refused
672
+ |`unicode-ampersand-operator.model`, `unicode-greek-ampersand.model` +
673
+ incomplete input refused: `unicode-lone-ampersand.model`
674
+
675
+ |3.24
676
+ |Size override `Ⅎ`
677
+ |untested
678
+ |
679
+
680
+ |3.25
681
+ |Text colour `✎(red&x)`
682
+ |covered
683
+ |`model-color`
684
+
685
+ |3.25
686
+ |Background colour `☁(lime&x)`
687
+ |untested
688
+ |
689
+
690
+ |4.1
691
+ |Negated operators with `/`, such as `/=`
692
+ |covered
693
+ |`model-negated`
694
+
695
+ |4.1
696
+ |ASCII pairs such as `+-`, `<=`, `->`
697
+ |untested
698
+ |
699
+
700
+ |4.5, 4.6, App. B
701
+ |Symbol control words, such as `\alpha`
702
+ |covered
703
+ |`model-greek-control-word`
704
+
705
+ |4.6, App. B
706
+ |Structure control words, such as `\sqrt`, `\rect`, `\matrix`
707
+ |untested
708
+ |
709
+ |===
710
+ // END GENERATED utn28-coverage
711
+
712
+ == Open questions
713
+
714
+ * The grammar spells `\cbrt` for both the cube root and the fourth root
715
+ (rules `cbrt_symbols` and `qdrt_symbols`), so the fourth root has no
716
+ command name of its own. Whether that is intended: not specified.
717
+ * When these examples were generated, parsing `(`, `a/` and `\cbrt x` did
718
+ not finish within several minutes, so this page shows no refusal example
719
+ and no result for `\cbrt`. Whether these inputs are expected to be slow:
720
+ not specified.
721
+ * Labels: parts between the first and the last `#` are dropped. Whether that
722
+ is intended: not specified.