umath 0.1.0 → 0.2.1

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,729 @@
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 5: the 72 legacy
252
+ cases and the 675 external inputs, each as a raw-tree and a typed-model
253
+ row).
254
+ * The oracle specs compare the raw tree with captures of the Plurimath
255
+ parser.
256
+
257
+ [[utn28-coverage]]
258
+ == Coverage of UTN 28
259
+
260
+ The constructs are taken from
261
+ https://www.unicode.org/notes/tn28/tn28-6.html[UTN 28 version 3.2]
262
+ (April 13, 2023). The mapping from construct to rows is
263
+ `docs/utn28-coverage.yml`. `scripts/utn28_coverage.rb` parses every mapped
264
+ row, checks that its outcome is the one the row expects, and writes the
265
+ summary and the table below; `--check` fails when they are out of date. A
266
+ construct marked untested may still be read by the grammar: the table only
267
+ says what the corpus shows.
268
+
269
+ // BEGIN GENERATED utn28-summary
270
+ The table lists 82 constructs of UTN 28 version 3.2 with the rows that
271
+ exercise them, out of the 32 rows of `corpora/model/representative.yml` and
272
+ the 747 typed-model rows of plurimath-testsuite generation 5. Of the 82
273
+ constructs, 25 are covered, 1 is refused and 56 are untested.
274
+
275
+ Covered means that every row listed for the construct parses to the model
276
+ the row expects. Refused means that the rows give input UTN 28 defines and
277
+ that umath refuses it on purpose; this is the case for the alignment mark
278
+ `&` outside a matrix, `a&=b` (3.23). Untested means that no row exercises
279
+ the construct, so the corpus does not show whether umath reads it.
280
+
281
+ Of the rows, 51 give incomplete input, such as a trailing `/` or an unclosed
282
+ bracket, and umath refuses them. They are listed with their construct and do
283
+ not change its status. The rows `model-decimal-arabic`, `model-comment`,
284
+ `model-u-escape`, `empty-input`, `empty-label-only` and
285
+ `unicode-whitespace-only.model` belong to no UTN 28 construct. The 675 rows
286
+ of the testsuite payloads `model-external-*` are not mapped to constructs:
287
+ they are the typed models of the 675 external UnicodeMath inputs of
288
+ plurimath-testsuite `fixtures/unicode-expectations.yaml`, which the `corpus`
289
+ workflow replays on both engines; which UTN 28 constructs each one exercises
290
+ is not recorded yet, so they decide no status here. Sections 1, 4.2-4.4,
291
+ 4.7-4.9, 5, 6 and 7 define no notation and are left out.
292
+ // END GENERATED utn28-summary
293
+
294
+ // BEGIN GENERATED utn28-coverage
295
+ [cols="2,7,2,9",options="header"]
296
+ |===
297
+ |Section |Construct |Status |Rows
298
+
299
+ |2.1
300
+ |Fraction `a/b`
301
+ |covered
302
+ |`model-fraction` +
303
+ 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`
304
+
305
+ |2.1
306
+ |Outer parentheses of a numerator or denominator removed, `(a+c)/d`
307
+ |untested
308
+ |
309
+
310
+ |2.1
311
+ |Left-to-right association of `/`, `1+a/b/c/d`
312
+ |untested
313
+ |
314
+
315
+ |2.1
316
+ |Decimal point in a denominator, `1/3.1416`
317
+ |untested
318
+ |
319
+
320
+ |2.1
321
+ |Skewed fraction `⁄` (`\sdiv`)
322
+ |untested
323
+ |
324
+
325
+ |2.1
326
+ |Linear fraction `∕` (`\ldiv`)
327
+ |untested
328
+ |
329
+
330
+ |2.1
331
+ |Normal-size linear fraction `\/`
332
+ |untested
333
+ |
334
+
335
+ |2.1
336
+ |Stack `¦` (`\atop`)
337
+ |covered
338
+ |`model-binomial` +
339
+ incomplete input refused: `unicode-lone-broken-bar.model`, `unicode-trailing-broken-bar.model`, `unicode-greek-broken-bar.model`
340
+
341
+ |2.1
342
+ |Binomial `⒞` (`\choose`)
343
+ |untested
344
+ |
345
+
346
+ |2.2
347
+ |Subscript `_` and superscript `^`
348
+ |covered
349
+ |`model-sup`, `model-subsup`, `unicode-number-exponent.model` +
350
+ 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`
351
+
352
+ |2.2
353
+ |Nested scripts, associating right to left, `a_b_c`
354
+ |untested
355
+ |
356
+
357
+ |2.2
358
+ |Comma or period followed by a letter inside a subscript
359
+ |untested
360
+ |
361
+
362
+ |2.3
363
+ |Space ending an operand
364
+ |covered
365
+ |`model-nary`, `model-integral`
366
+
367
+ |2.3
368
+ |Space after `+` or `-` making it binary
369
+ |untested
370
+ |
371
+
372
+ |3.1
373
+ |Brackets `( )`, `[ ]`, `{ }`
374
+ |covered
375
+ |`unicode-fence-round.model`, `unicode-fence-square.model`, `unicode-fence-curly.model` +
376
+ 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`
377
+
378
+ |3.1
379
+ |Other bracket characters, such as `⟨ ⟩` and `⌈ ⌉`
380
+ |covered
381
+ |`unicode-fence-angle.model`, `unicode-fence-ceiling.model` +
382
+ incomplete input refused: `unicode-unclosed-angle.model`, `unicode-stray-close-angle.model`, `unicode-unclosed-ceiling.model`, `unicode-stray-close-ceiling.model`
383
+
384
+ |3.1
385
+ |Brackets of different kinds paired, `[a,b)`
386
+ |covered
387
+ |`model-parens`
388
+
389
+ |3.1
390
+ |`\open` `├` and `\close` `┤`
391
+ |untested
392
+ |incomplete input refused: `unicode-lone-right-tack.model`
393
+
394
+ |3.1
395
+ |Size digit after `├` or `┤`
396
+ |untested
397
+ |
398
+
399
+ |3.1
400
+ |Absolute value `\|x\|`
401
+ |untested
402
+ |incomplete input refused: `unicode-unclosed-vert.model`
403
+
404
+ |3.1
405
+ |`\abs` `⒜`
406
+ |untested
407
+ |incomplete input refused: `unicode-lone-parenthesized-letter.model`
408
+
409
+ |3.1
410
+ |Norm `‖x‖`
411
+ |untested
412
+ |
413
+
414
+ |3.1
415
+ |Separators `│` (`\vbar`), `∣` (`\mid`) and `\middle`
416
+ |untested
417
+ |
418
+
419
+ |3.1
420
+ |Cases `Ⓒ` (`\cases`)
421
+ |untested
422
+ |
423
+
424
+ |3.2
425
+ |Literal operator `\`, such as `\[`
426
+ |untested
427
+ |
428
+
429
+ |3.3
430
+ |Prescripts `(_c^b)a`
431
+ |untested
432
+ |
433
+
434
+ |3.3
435
+ |Prescripts written before the base, `_c^b a`
436
+ |untested
437
+ |
438
+
439
+ |3.3
440
+ |Below script `┬` and above script `┴`
441
+ |untested
442
+ |incomplete input refused: `unicode-trailing-down-tack.model`
443
+
444
+ |3.3
445
+ |Below limit with `_` after `lim`, `max` and similar
446
+ |untested
447
+ |
448
+
449
+ |3.4
450
+ |n-ary operators with limits, `∑_(i=1)^n i`
451
+ |covered
452
+ |`model-nary`, `model-integral`
453
+
454
+ |3.4
455
+ |n-aryand operator `▒` (`\naryand`, `\of`)
456
+ |untested
457
+ |incomplete input refused: `unicode-lone-naryand.model`
458
+
459
+ |3.4
460
+ |Limit placement digit after an n-ary operator
461
+ |untested
462
+ |
463
+
464
+ |3.5
465
+ |Function names, `sin x`
466
+ |covered
467
+ |`model-function`
468
+
469
+ |3.5
470
+ |Function apply `⁡` (U+2061, `\funcapply`)
471
+ |untested
472
+ |incomplete input refused: `unicode-lone-function-apply.model`, `unicode-trailing-function-apply.model`, `unicode-greek-function-apply.model`
473
+
474
+ |3.5
475
+ |Scripted function name, `sin^2 x`
476
+ |untested
477
+ |
478
+
479
+ |3.5
480
+ |Function name with a no-break space, `lim sup`
481
+ |untested
482
+ |
483
+
484
+ |3.6
485
+ |Square root `√`
486
+ |covered
487
+ |`model-sqrt`
488
+
489
+ |3.6
490
+ |Cube root `∛` and fourth root `∜`
491
+ |untested
492
+ |
493
+
494
+ |3.6
495
+ |n-th root `√(n&a)`
496
+ |covered
497
+ |`model-nthroot`
498
+
499
+ |3.6
500
+ |`\root n\of(a)`
501
+ |untested
502
+ |
503
+
504
+ |3.7
505
+ |Rectangle `▭` (`\rect`)
506
+ |untested
507
+ |
508
+
509
+ |3.7
510
+ |Enclosure with a border mask, `▭(n&x)`
511
+ |untested
512
+ |
513
+
514
+ |3.7
515
+ |Overbar `¯` and underbar `▁`
516
+ |untested
517
+ |
518
+
519
+ |3.7
520
+ |Other enclosure characters, such as `▢` and `⬭`
521
+ |untested
522
+ |
523
+
524
+ |3.7
525
+ |Abstract box `□`, `□(n&x)`
526
+ |untested
527
+ |
528
+
529
+ |3.8
530
+ |Horizontal brackets `⏜ ⏝ ⏞ ⏟ ⏠ ⏡ ⎴ ⎵`
531
+ |covered
532
+ |`model-overbrace`
533
+
534
+ |3.8
535
+ |Stretchy character over or under text, `(a+b)┴→`
536
+ |untested
537
+ |
538
+
539
+ |3.9
540
+ |Matrix `■(a&b@c&d)`
541
+ |covered
542
+ |`model-matrix` +
543
+ incomplete input refused: `unicode-matrix-unclosed.model`, `unicode-lone-at.model`, `unicode-at-operator.model`, `unicode-greek-at-operator.model`
544
+
545
+ |3.9
546
+ |Bracketed matrices `ⓢ ⒨ ⒱ Ⓢ ⒩`
547
+ |untested
548
+ |
549
+
550
+ |3.9
551
+ |Identity matrix, a matrix character and a digit
552
+ |untested
553
+ |
554
+
555
+ |3.9
556
+ |Empty matrix, `2×3⒨`
557
+ |untested
558
+ |
559
+
560
+ |3.10
561
+ |Primes `′`
562
+ |covered
563
+ |`model-primes`
564
+
565
+ |3.10
566
+ |Combining accent after an operand, such as `x̂`
567
+ |untested
568
+ |
569
+
570
+ |3.10
571
+ |Combining accent after a parenthesized expression, `(a+b)̂`
572
+ |untested
573
+ |
574
+
575
+ |3.10
576
+ |Asterisk in a script, `a^*2`
577
+ |untested
578
+ |
579
+
580
+ |3.11
581
+ |Double-struck `ⅅ ⅆ ⅇ ⅈ ⅉ`
582
+ |untested
583
+ |
584
+
585
+ |3.12
586
+ |Subscript and superscript characters, `x²`, `y₁`
587
+ |covered
588
+ |`model-mini-scripts`
589
+
590
+ |3.13
591
+ |Binary and relational operators
592
+ |covered
593
+ |`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`
594
+
595
+ |3.14
596
+ |Numbers, with `.` or `,` between digits
597
+ |covered
598
+ |`unicode-number-integer.model`, `unicode-number-decimal.model`, `unicode-number-decimal-comma.model`, `model-decimal-dot`, `model-decimal-comma`
599
+
600
+ |3.14
601
+ |Comma as punctuation, `a,b`
602
+ |covered
603
+ |`model-parens`
604
+
605
+ |3.14
606
+ |Leading decimal point, `.5`
607
+ |untested
608
+ |
609
+
610
+ |3.14
611
+ |Colon after a space, read as ratio
612
+ |untested
613
+ |
614
+
615
+ |3.15
616
+ |Ordinary text in double quotes
617
+ |covered
618
+ |`model-text` +
619
+ incomplete input refused: `unicode-unclosed-quote.model`, `unicode-greek-unclosed-quote.model`
620
+
621
+ |3.15
622
+ |Escaped quote `\"` inside text
623
+ |untested
624
+ |
625
+
626
+ |3.16
627
+ |Space characters U+00A0, U+2000 to U+200B, U+202F, U+205F
628
+ |untested
629
+ |
630
+
631
+ |3.17
632
+ |Phantoms and smashes `⟡ ⬄ ⇳ ⬍ ⬆ ⬇ ⬌`, `\phantom(n&x)`
633
+ |untested
634
+ |
635
+
636
+ |3.18
637
+ |Invisible grouping `〖 〗` (`\begin`, `\end`)
638
+ |untested
639
+ |
640
+
641
+ |3.19
642
+ |Equation array `█` (`\eqarray`)
643
+ |untested
644
+ |
645
+
646
+ |3.20
647
+ |Math zone delimiters `⁅ ⁆`
648
+ |untested
649
+ |
650
+
651
+ |3.21
652
+ |Equation number `#`
653
+ |covered
654
+ |`model-label`
655
+
656
+ |3.22
657
+ |Letters, digits and operand symbols such as `∞` and `∅`
658
+ |covered
659
+ |`unicode-symbol-greek-alpha.model`, `unicode-symbol-greek-pi.model`, `unicode-symbol-infinity.model`, `unicode-symbol-empty-set.model`, `model-greek-unicode`, `model-accent`
660
+
661
+ |3.22
662
+ |Mathematical alphanumeric and letterlike characters, `𝐀`, `ℂ`
663
+ |covered
664
+ |`model-font`
665
+
666
+ |3.22
667
+ |Factorial `!`
668
+ |untested
669
+ |
670
+
671
+ |3.23
672
+ |Soft break `⁢` (U+2062, `\itimes`)
673
+ |untested
674
+ |
675
+
676
+ |3.23
677
+ |Alignment mark `&` outside a matrix, `a&=b`
678
+ |refused
679
+ |`unicode-ampersand-operator.model`, `unicode-greek-ampersand.model` +
680
+ incomplete input refused: `unicode-lone-ampersand.model`
681
+
682
+ |3.24
683
+ |Size override `Ⅎ`
684
+ |untested
685
+ |
686
+
687
+ |3.25
688
+ |Text colour `✎(red&x)`
689
+ |covered
690
+ |`model-color`
691
+
692
+ |3.25
693
+ |Background colour `☁(lime&x)`
694
+ |untested
695
+ |
696
+
697
+ |4.1
698
+ |Negated operators with `/`, such as `/=`
699
+ |covered
700
+ |`model-negated`
701
+
702
+ |4.1
703
+ |ASCII pairs such as `+-`, `<=`, `->`
704
+ |untested
705
+ |
706
+
707
+ |4.5, 4.6, App. B
708
+ |Symbol control words, such as `\alpha`
709
+ |covered
710
+ |`model-greek-control-word`
711
+
712
+ |4.6, App. B
713
+ |Structure control words, such as `\sqrt`, `\rect`, `\matrix`
714
+ |untested
715
+ |
716
+ |===
717
+ // END GENERATED utn28-coverage
718
+
719
+ == Open questions
720
+
721
+ * The grammar spells `\cbrt` for both the cube root and the fourth root
722
+ (rules `cbrt_symbols` and `qdrt_symbols`), so the fourth root has no
723
+ command name of its own. Whether that is intended: not specified.
724
+ * When these examples were generated, parsing `(`, `a/` and `\cbrt x` did
725
+ not finish within several minutes, so this page shows no refusal example
726
+ and no result for `\cbrt`. Whether these inputs are expected to be slow:
727
+ not specified.
728
+ * Labels: parts between the first and the last `#` are dropped. Whether that
729
+ is intended: not specified.