math-stratum / README.md
tailot's picture
publish math-stratum bundle
e9dac18 verified
|
Raw History Blame Contribute Delete
20.9 kB
metadata
language:
  - it
  - en
  - es
  - zh
  - hi
  - ar
tags:
  - multilingual
  - mathematical-word-problems
  - natural-language-to-formal-language
  - multi-agent-systems
  - benchmark
  - conversational-interfaces
  - formal-verification
  - semantic-parsing
pretty_name: >-
  LingoLOGOS math-stratum: a question in six written varieties, the answer of
  the math stratum, and an assurance that includes the reading
configs:
  - config_name: corpus
    data_files:
      - split: train
        path: problems/corpus.jsonl
size_categories:
  - n<1K

LingoLOGOS math-stratum topology

A conversational layer over the math topology: a person asks in one of six written varieties, and gets the answer of the math stratum back in that same language, at an assurance that includes the fallibility of the reading. The layer never decides a problem and never raises a verdict; the only direction it can move the assurance of the math stratum is down.

python tools/ask.py --lang it "risolvi x^2 - 5*x + 6 = 0 per x"
Reading state         : AGREED
Assurance shown       : 2 (reading ceiling 2, math assurance 3)
Math layer status     : VERIFIED
Orchestrator Z3 check : 8 of 8 envelopes confirmed

Answer in the language of the question (italiano):
  Stato: accordata: due lettori indipendenti piu il vincolo SMT
  Problema capito (solve): solve x^2-5*x+6=0 for x
  Risposta: {2, 3}
  livello 2 di 3
  strato matematico: VERIFIED
  Controllo SMT dello strato : 8 di 8 buste confermate

This dataset is the math-stratum/ folder of the LingoLOGOS project published as it stands: 67 files, code and data together, plus this card in place of their README. Only the standard library and z3-solver are required, and pytest for the tests; both are named in requirements.txt. Every command below is written from inside the folder. The mathematics is not part of this dataset: it lives in the math bundle, published at https://huggingface.co/datasets/tailot/lingologos-math, and section 10 says how to point this folder at a copy of it.

1. What the stratum is, and what it refuses

The certainty of a translation cannot be verified the way the certainty of a proof can: there is no SMT check that says that a sentence of Hindi was read correctly. That is the definition this bundle works with, and it is why the topology is built the way it is: two readers that reach their sentence by different roads, an SMT claim about what each reading kept, a referee that rechecks every envelope, and a decision that is re-derived from the transcript instead of being trusted from the arbiter.

The rule the whole bundle exists to enforce:

assurance shown = min(assurance of the math stratum, ceiling of the reading)
Reading state ceiling when
AGREED 2 both readers produced the same sentence, and the math stratum is what decides it
PASSTHROUGH 2 the question was already a sentence of the math language: nothing was translated
SINGLE 1 one reader understood it and the other abstained: no witness, one level less
DISPUTED 0 the two readers produced different sentences, or a reading lost a number: the math stratum is not even asked
AMBIGUOUS 0 a reader reports that the question announces more than one problem, or leaves a slot with several readings: the person has to choose
NOT COVERED 0 neither reader found anything: this variety does not say it in a covered way
TAMPERED 0 the math stratum says it solved something other than the agreed sentence

Three is never shown. Level three belongs to the math stratum, whose two formalizers and two checkers work on a sentence they wrote themselves; a sentence in a human language adds one fallible step before that, and this layer is that step.

The ceiling is not the only thing that holds on its own. The count of literals is checked on a lone reading too: a reading that no longer holds the numbers the person wrote is a different problem, not a weaker reading of the same one, and it ends DISPUTED even when it is the only reader that understood the question. A single witness therefore answers at level one only when it kept every number.

2. The eight nodes

The session runs through the orchestrator (src/lingologos_orchestrator) with the same envelope protocol as the math topology: a marker @@DOSSIER@@ inside payload.naturalLanguage, and payload.smtConstraints carrying what each node claims about its own output, which the referee of every node recomputes with Z3. The seed sits in the arbiter; maxTurns is the number of arcs.

Node What it does The claim it carries
reader_a reads the question against the frames written in the lexicon the numerals of the question are still in my sentence
reader_b reads it by following the joints of the math language the same, independently
equivalence proves the two sentences the same, slot by slot and then with SMT not (A = B) is unsatisfiable
coverage counts that every literal the person wrote survived into the sentence conjunction of the element equalities
invoker asks the math stratum, in a separate process, the agreed sentence the sentence I sent equals the one that came back
boundary checks the echo of the math stratum instead of trusting it elementwise on the echo, or the empty claim
adversary re-derives the bound and writes its negation shown > ceiling is unsatisfiable
arbiter runs the decision and renders the answer in the language of the question the same inequality

3. Two readers, one lexicon

read_a.py matches the shapes stored in lexicon/<lang>.json (patterns: one template per kind of problem, with slots). read_b.py never looks at those shapes: it finds the verb that announces a problem, then walks the joints of the math language (for, over Z, from ... to, subject to, wrt) and cuts the slots out of the gaps between them. They share only the lexicon, the atomizer (segment.py) and the templates of the math language (canonical.py).

That sharing is deliberate and it is also the known blind spot: a wrong description of a variety is a wrong description for both readers, and the topology cannot see it. What shows it is the corpus of section 5, whose questions were written and checked by a person. When the two readers disagree the assurance goes down, never up: DISPUTED does not even consult the math stratum.

4. Talking to the math stratum

invoker.py is the only door. It launches python <root>/tools/solve.py --json <sentence> as a separate process and reads its JSON verdict back; nothing in this folder imports the solver of the math stratum to decide anything here. The referee then checks the echo: the sentence the math stratum says it solved has to be the sentence the readers agreed on, otherwise the session is TAMPERED.

Variable Meaning
LGSTRATUM_MATH_ROOT where the math bundle is (default: the sibling folder datasets/math)
LGSTRATUM_MATH_BACKEND subprocess (default), or none to disable the math layer entirely
LGSTRATUM_FAULTS comma separated node:fault pairs, experiments only

A disabled math layer is not tampering: the reading stands, the assurance falls to zero because there is no math assurance to take the minimum with, and no answer is shown.

5. The corpus

problems/corpus.jsonl holds 73 questions: 12 kinds of problem in 6 varieties, plus items that mix varieties, full width digits, unspelled matrices, gibberish, questions with an empty slot and questions whose mathematics is out of reach of the math stratum. Each line carries what the answer has to look like (state, sentence, answer_contains, min_assurance, max_assurance, no_answer, referee_clean) and a why that says why, including the cases where the expected outcome is an abstention.

Graded against the in-process pipeline: 73 of 73 rows agree with their gold (lgstratum/corpus.py grades one row, tests/test_corpus.py runs all of them). With the math layer switched off the states come out 57 AGREED, 2 SINGLE, 11 NOT COVERED, 3 PASSTHROUGH; tools/coverage_report.py writes results/coverage.json and counts 57 questions read by both readers, 2 by reader_a alone and 14 by neither. Seven rows (it-13, en-11, en-12, es-09, zh-11, hi-11, ar-12) are agreed readings on which the math stratum abstains: assurance 0 and no answer, which is the layer refusing to add an availability it does not have. Two rows (hi-05, hi-10) stay at SINGLE, assurance 1, for the reason in section 7.

6. Commands

python tools/ask.py --lang it "quanto fa 2+2?"          # one session, eight processes
python tools/ask.py --lang en --json "solve x + 1 = 2 for x"
python tools/ask.py --lang ar --corpus problems/corpus.jsonl --limit 6
python tools/coverage_report.py --out results/coverage.json    # which frames each variety carries
python tools/ablation.py --probe 12 --out results/ablation.json

tools/ask.py prints the verdict it re-derives from the transcript, not the one the arbiter wrote, and exits with code 3 when that re-derivation disagrees with a node about its own envelope, with code 2 when the assurance is zero, and with code 1 in corpus mode when a gold expectation fails. tools/ablation.py walks the configurations of the topology one node at a time, injects every fault of the catalogue singly and in pairs, and reports each cell as raised | lowered | masked | caught | abstained | silent_error: a cell counted raised is a violation of the rule of section 1, and the tool exits 1 if any happened. A caught cell is one where an answer was shown that the gold does not accept, but the session said so itself -- a claim fell to the referee of its node, or the assurance sits below the honest one because the configuration lost a node.

On this checkout --probe 6 (one question per variety) fills 147 cells and 882 sessions, the fault takes hold in 510 of them, and the totals are raised 0, lowered 0, silent_error 0, caught 18, abstained 366, masked 126 -- about fifteen minutes. Nothing was ever raised above the honest assurance, and the 18 caught cells all sit in the configuration without reader_b, where a rubber stamped verification node cannot buy back the level the missing witness costs.

7. Limits that are written down, not hidden

  • Two varieties place their joints after the slot instead of before it. reader_b cannot cut the slots there, so those questions are read by one reader only and stay at SINGLE, assurance 1 (hi-05, hi-10). tools/coverage_report.py shows them as one of two readers.
  • A missing written accent can collide with a connective: qual e il determinante di ... is not read, because the folded copula is the same atom as the conjunction e.
  • The fragment of the math stratum is unchanged here: powers inside integer terms and non linear programs end in UNKNOWN, so the assurance is zero even when the reading is agreed. The corpus keeps those questions as probes (it-13, en-11, en-12, es-09, zh-11, hi-11, ar-12).
  • The two readers share their data, so a systematic error in the description of a variety is invisible to the topology and can only be found in the corpus.

8. Tests

From the repository root:

python -m pytest -q datasets/math-stratum/tests

The suite is 290 tests: 121 on the two readers against every row of the corpus, 79 on the corpus itself, 38 on the pinned invariant, 14 on the topology file, 13 on the faults, 13 on the decision table, 10 on the lexicons and 2 end-to-end sessions. It checks the topology file against the node order, the shape and the completeness of the lexicons, both readers against the corpus, the decision table, the faults, and every gold answer of the corpus; tests/test_pinned_invariant.py runs the same questions through every node configuration and every fault and asserts that the verdict of the math stratum does not move, and that nothing is ever shown above it. tests/test_orchestrator_e2e.py runs two real sessions through the orchestrator and is skipped when lingologos_orchestrator is not importable. The corpus and the invariant tests call the solver of the math stratum as subprocesses, which here means a copy of the math dataset named by LGSTRATUM_MATH_ROOT (section 10); the suite took 3 minutes 52 seconds inside a LingoLOGOS checkout, and the two end to end tests skip on their own when lingologos_orchestrator is not importable.

Real sessions, measured: risolvi x^2 - 5*x + 6 = 0 per x comes back AGREED at assurance 2 against a math assurance of 3, with 8 of 8 envelope claims confirmed by the referee of the session, and python tools/ask.py --corpus problems/corpus.jsonl --limit 8 grades 8 of 8 real sessions against gold. One question per variety outside Italian (zh-01, ar-01, hi-03, es-02) comes back the same way: AGREED, assurance 2, the math stratum VERIFIED, 8 of 8 claims confirmed, nothing detected -- and the block the person reads is written in the language of the question (48, 97 and 104 non-ASCII characters in the Chinese, Arabic and Hindi replies).

A gate in tests/test_topology.py keeps every Python source of this bundle ASCII only, and pins that lgmath may be imported for its SMT plumbing by lgstratum/compare.py alone.

9. Language policy

The prose of this folder -- code, docstrings, comments, tool output, test messages -- is English, and the Python sources are ASCII, as the repository requires. The exception is the language under study, and it is confined to data: lexicon/*.json (the words, frames, joints and labels of the six varieties), problems/corpus.jsonl (the questions and their gold answers), and the answer block that tools/ask.py shows a person, which is written in the language of the question because that block is the object this bundle measures.

10. Putting this dataset back into a LingoLOGOS checkout

This dataset is 67 files plus this card: 73 questions in one corpus file, the six lexicons, the eight node definitions, the two readers, the decision rule of section 1, the corpus grading and fault results under results/, and the fault catalogue of section 6. To run the mathematics it needs the math bundle: download https://huggingface.co/datasets/tailot/lingologos-math somewhere, set LGSTRATUM_MATH_ROOT to that copy, and the invoker node calls tools/solve.py there as a separate process, which is the only door through which this bundle ever reaches a solver. Inside a LingoLOGOS checkout the folder sits at datasets/math-stratum, finds datasets/math by itself, and needs src/lingologos_orchestrator importable for the two end to end sessions of section 8. On the hub this README is rewritten as a dataset card whose sections 1 to 10 keep the wording and numbers of this file, and sections 11 to 14 are added there for readers who met the bundle on the hub rather than in a checkout: the fields of the corpus file, how to load it, rights and citation. Every file but this README was compared by sha256 after the upload: the hub holds one object per file of this folder plus .gitattributes, so the remote count is one above the number tools/publish_dataset.py prints here. What the LingoLOGOS repository carries is the link to this dataset in the table of published resources at the top of its README; the documentation of the asset lives here, in this card, and not in the technical documentation of the project. tools/publish_dataset.py in the folder of the project republishes a changed working copy with the token taken from an environment variable. Republishing is a separate step, never a side effect of a test run: tools/publish_dataset.py does it with the token taken from an environment variable and verifies the tree by sha256.

11. The corpus file

problems/corpus.jsonl holds 73 questions, one JSON object per line, written and checked by a person. It is a benchmark for the stratum: there is no prompt, no response pair and nothing to fine tune on. Each row says what the session has to end like, including the rows whose expected outcome is a refusal to answer, and a why that says why.

Field Type Meaning
id string unique; the prefix names the variety (it, en, es, zh, hi, ar), or mixed on the 5 rows that mix varieties, write digits in full width form or are gibberish
lang string one of it, en, es, zh, hi, ar: the variety the question is written in
kind string one of the 12 problem kinds, or negative (14 rows that must not be read) or passthrough (2 rows already written in the math language)
question string the question, between 5 and 53 characters, in the script of its variety
why string the reason the row behaves as it does, written by the person who wrote the row
expect object the expectation, described below
Variety (lang) Rows Id prefix Rows Kind Rows
it 13 it 13 evaluate 7
en 13 en 12 solve 6
es 10 es 9 solvez 3
zh 12 zh 11 prove 5
hi 12 hi 11 provez 8
ar 13 ar 12 derivative 4
mixed rows 5 mixed 5 integral 5
det, rank 3, 3
inverse 4
maximize, minimize 3, 6
negative 14
passthrough 2

The fields of expect are optional except referee_clean, which is present on every row.

Field Rows Meaning
state 65 the reading state the session must end in: AGREED 55, PASSTHROUGH 3, SINGLE 2, NOT COVERED 5
sentence 60 the sentence of the math language both readers have to produce, exactly
answer_contains 29 a substring the answer has to contain, exact rationals written as strings
min_assurance 51 the lowest assurance that is acceptable, on the scale of section 1
max_assurance 22 the highest assurance that is acceptable: this is what pins the probes that must not rise
no_answer 15 true where the row is graded by the refusal: no answer may be shown at all
referee_clean 73 every envelope claim of the session must match what the referee of its node recomputed

The eight rows with no state are graded on an assurance or on an answer instead: they check that the reading holds while the math stratum abstains, so the assurance must be 0 and no answer may appear. Seven of them are the agreed readings on which the mathematics is out of reach (it-13, en-11, en-12, es-09, zh-11, hi-11, ar-12), which is the stratum refusing to add an availability it does not have.

12. Loading it

Load the file with the datasets library, or with one json.loads per line, which needs no dependency:

from datasets import load_dataset
rows = load_dataset("tailot/math-stratum", "corpus", split="train")
print(rows[0])

This is the same file tools/ask.py --corpus walks over, and lgstratum/corpus.py plus tests/test_corpus.py read it to grade the stratum against the gold. Graded on this checkout: 73 of 73 rows agree with what they expect.

13. Rights

No license is declared for this dataset, its lexicons, its corpus or its code: reuse is not granted by this page. The six lexicons, the 73 questions with their gold expectations, the grammar specifications, the node data and the Python sources were written by hand as part of the LingoLOGOS project. Ask before redistributing or building on them, and expect the answer to be yes for academic work with attribution. Z3 is a separate product with its own license and is not redistributed here; z3-solver is only named as a dependency in requirements.txt. The lexicons of Hindi, Arabic and Chinese describe written varieties as this project needs them for arithmetic questions: they are not a general purpose dictionary of those languages.

14. Citation

@misc{lingologos_math_stratum,
  title  = {LingoLOGOS math-stratum: a question in six written varieties, the answer of the math stratum, and an assurance that includes the reading},
  author = {LingoLOGOS project},
  year   = {2026},
  url    = {https://huggingface.co/datasets/tailot/math-stratum},
  note   = {bundle of the math-stratum folder of the LingoLOGOS repository: 73 questions in six written
            varieties, six lexicons, two independent readers, eight node definitions with SMT claims, the
            assurance rule min(math, reading) with the reading capped at 2, fault catalogue and ablation
            over the node configurations, 290 tests}
}