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.
- checksums.yaml +4 -4
- data/README.adoc +31 -10
- data/artifacts/umath.bindings.ruby.json +1 -1
- data/artifacts/umath.json +1 -1
- data/data/umath-symbols.json +1 -1
- data/docs/model-contract.adoc +1 -8
- data/docs/parser-contract.adoc +3 -3
- data/docs/testsuite-pin.adoc +14 -13
- data/docs/unicodemath.adoc +722 -0
- data/lib/umath/engine.rb +18 -7
- data/lib/umath/schema.rb +33 -0
- data/lib/umath/version.rb +1 -1
- data/schema/manifest.json +14 -0
- data/schema/umath.bundle.json +11270 -0
- metadata +7 -3
data/data/umath-symbols.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"lib/plurimath/math/symbols/paren.rb": "sha256:316dc4d8b5accb78ac8ca9ff5035a3eb42365492abb666c4589b12b0e677c837"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"source": "Plurimath::Utility.all_symbols_classes(:
|
|
14
|
+
"source": "Plurimath::Utility.all_symbols_classes(:unicodemath); value is the class's to_unicodemath, kind is paren for Math::Symbols::Paren classes",
|
|
15
15
|
"symbols": {
|
|
16
16
|
"\"P{!=}\"": {
|
|
17
17
|
"value": "≠",
|
data/docs/model-contract.adoc
CHANGED
|
@@ -167,14 +167,7 @@ parentheses, 100 nested fractions) was built and serialized without error.
|
|
|
167
167
|
`scripts/replay_corpus.rb --inventory ... --rows ...`, which checks raw
|
|
168
168
|
parity again and that the model holds the bound tree. A row the legacy
|
|
169
169
|
grammar refused must raise `ParseError`, and a row without a formula
|
|
170
|
-
must give an empty document.
|
|
171
|
-
On the native engine, the rows in
|
|
172
|
-
`spec/parser/fixtures/oracle/native-divergences.yml` give another tree
|
|
173
|
-
than legacy, because Parsanol's native engine takes another alternative
|
|
174
|
-
of the same grammar. The grammar before the shape normalization gives the
|
|
175
|
-
same native trees, so the normalization does not cause them. Both checks
|
|
176
|
-
require those rows to still differ, so a fixed engine shows up as a
|
|
177
|
-
failure that asks to shorten the list.
|
|
170
|
+
must give an empty document. Both checks hold on the native engine too.
|
|
178
171
|
* `scripts/verify_lml.rb` exports every model class with
|
|
179
172
|
`Lutaml::Model::Lml.export`, requires the committed
|
|
180
173
|
`model/umath.lml.json` and `model/umath.lml.checksums.txt` to
|
data/docs/parser-contract.adoc
CHANGED
|
@@ -102,7 +102,7 @@ in the encoded text.
|
|
|
102
102
|
|
|
103
103
|
The grammar is not self-contained: `ConstantsRules` builds alternations from
|
|
104
104
|
`Constants` when the grammar loads, and `Constants.wrapper_symbols` reads
|
|
105
|
-
Plurimath's symbol catalog (`Utility.symbols_hash(:
|
|
105
|
+
Plurimath's symbol catalog (`Utility.symbols_hash(:unicodemath)`). The
|
|
106
106
|
decimal-marker rule reads `Plurimath.configuration`. A gem grammar must take
|
|
107
107
|
these inputs from committed data, not from a live Plurimath.
|
|
108
108
|
|
|
@@ -112,7 +112,7 @@ these inputs from committed data, not from a live Plurimath.
|
|
|
112
112
|
`Plurimath::Math::Formula`. Grammar refusals and transform failures both
|
|
113
113
|
surface as `Plurimath::Math::ParseError`. The capture records the formula
|
|
114
114
|
object graph and the exact output of the `to_asciimath`, `to_latex`,
|
|
115
|
-
`to_mathml`, `
|
|
115
|
+
`to_mathml`, `to_unicodemath`, `to_omml` and `to_html` writers.
|
|
116
116
|
|
|
117
117
|
== What the gem must keep (syntax)
|
|
118
118
|
|
|
@@ -204,7 +204,7 @@ another artifact.
|
|
|
204
204
|
|
|
205
205
|
`data/umath-symbols.json` is the symbol catalog the legacy transform
|
|
206
206
|
uses: every UnicodeMath spelling of Plurimath's `Math::Symbols::Symbol` and
|
|
207
|
-
`Math::Symbols::Paren` classes, as `Plurimath::Utility.all_symbols_classes(:
|
|
207
|
+
`Math::Symbols::Paren` classes, as `Plurimath::Utility.all_symbols_classes(:unicodemath)`
|
|
208
208
|
returns them at the pinned commit. For each spelling it records the Unicode
|
|
209
209
|
text the class writes as UnicodeMath (`value`) and whether the class is a
|
|
210
210
|
symbol or a paren (`kind`). It has 3282 spellings, 64 of them parens.
|
data/docs/testsuite-pin.adoc
CHANGED
|
@@ -11,10 +11,10 @@ generations, named in `spec/fixtures/testsuite-pin.yml`:
|
|
|
11
11
|
----
|
|
12
12
|
schema: plurimath-stage/pin/1
|
|
13
13
|
repository: https://github.com/plurimath/plurimath-testsuite
|
|
14
|
-
commit:
|
|
14
|
+
commit: 85c7be8fd56f0cc64b4869e74716acc4f0dbe746
|
|
15
15
|
language: unicode
|
|
16
|
-
generation:
|
|
17
|
-
snapshot_digest: sha256:
|
|
16
|
+
generation: 4
|
|
17
|
+
snapshot_digest: sha256:cc02870fb6ee5a46c64271733b716f00469d0af46847851ad3db9249ad2571ed
|
|
18
18
|
----
|
|
19
19
|
|
|
20
20
|
Generation 2 keeps every case of generation 1 (the legacy corpus, produced by
|
|
@@ -22,6 +22,15 @@ Plurimath 0.11.12) byte for byte and adds a raw-tree row for each of its 72
|
|
|
22
22
|
cases, rejections included, written by `scripts/stage_cases.rb` at umath
|
|
23
23
|
1929f69.
|
|
24
24
|
|
|
25
|
+
Generation 3 keeps every payload of generation 2 byte for byte and adds
|
|
26
|
+
typed-model rows beside the raw-tree rows. The replay still compares the
|
|
27
|
+
raw-tree rows only.
|
|
28
|
+
|
|
29
|
+
Generation 4 keeps every payload of generation 3 byte for byte except the
|
|
30
|
+
five raw-tree payloads, which `scripts/stage_cases.rb` rewrote after the gem
|
|
31
|
+
was renamed to umath: their header comment and description name umath and
|
|
32
|
+
`Umath::RawParser`. No row changed.
|
|
33
|
+
|
|
25
34
|
== What CI checks
|
|
26
35
|
|
|
27
36
|
The `corpus` workflow checks out the testsuite at the pinned commit and then:
|
|
@@ -43,20 +52,12 @@ The `corpus` workflow checks out the testsuite at the pinned commit and then:
|
|
|
43
52
|
value in the canonical form of the testsuite's
|
|
44
53
|
`docs/tree-parity-contract.adoc`.
|
|
45
54
|
|
|
46
|
-
The rows whose source id is listed in
|
|
47
|
-
`spec/parser/fixtures/oracle/native-divergences.yml` are the exception on the
|
|
48
|
-
native engine: Parsanol's native engine takes another alternative of the same
|
|
49
|
-
grammar for those inputs, so their native result must still differ from the
|
|
50
|
-
expected value, and the replay fails once one of them matches, so the list
|
|
51
|
-
can be shortened. None of the listed inputs is in generation 2, whose rows
|
|
52
|
-
were written only where both engines agreed.
|
|
53
|
-
|
|
54
55
|
To run the replay locally:
|
|
55
56
|
|
|
56
57
|
[source,sh]
|
|
57
58
|
----
|
|
58
59
|
git clone https://github.com/plurimath/plurimath-testsuite tmp/testsuite
|
|
59
|
-
git -C tmp/testsuite checkout
|
|
60
|
+
git -C tmp/testsuite checkout 85c7be8fd56f0cc64b4869e74716acc4f0dbe746
|
|
60
61
|
bundle exec ruby scripts/replay_corpus.rb --testsuite tmp/testsuite --report tmp/replay.json
|
|
61
62
|
----
|
|
62
63
|
|
|
@@ -64,7 +65,7 @@ The `replay` workflow checks out the testsuite at the same commit and fails if
|
|
|
64
65
|
its commit and the pin's differ. The `stage-cases` workflow writes the
|
|
65
66
|
generation after the latest one of its source commit, so it still reads
|
|
66
67
|
generation 1 at b4520d8; it also checks out the pinned commit and requires the
|
|
67
|
-
|
|
68
|
+
payloads it writes to equal the pinned generation 4's byte for byte.
|
|
68
69
|
The same workflow also writes a typed-model generation (`scripts/stage_cases.rb
|
|
69
70
|
--boundary typed-model`) from the latest generation at 5e32851: every payload
|
|
70
71
|
copied byte for byte plus a `model-<group>.yaml` payload of typed models from
|