The LogicScript pipeline is unusual in that its behaviour is determined jointly by data (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AngelMoralesChazari/TautoTeacher-2.0/llms.txt
Use this file to discover all available pages before exploring further.
core.lgs) and code (NaturalLexer, SemanticMapper, EmitidorFormula). A single edit to any of those layers — even adding one lemma line — can silently break a sentence that previously translated correctly. LogicScriptRegressionHarness guards against that by recording the expected formula for every sentence the pipeline should handle, then asserting that the live pipeline still produces exactly those formulas after any change. Running the harness takes only a few seconds and requires no external test framework.
Running the harness
Compile the project (with resources copied), then run:0.
Failure — one or more cases deviate from the expected output:
1. Details for every failing case are printed to stderr, including the case ID, the expected and actual values, and (if translation failed unexpectedly) the error message.
In addition to the natural-language cases, the harness runs two diagnostic checks at startup:
verificarDiagnosticoCargaLgs— feeds a deliberately malformed.lgssnippet toLgsCargadorand asserts thatERROR_SINTAXISis returned with a message containing the line number.verificarLexruleCarga— parses a minimal in-memory.lgswith alexrule sufijorule and asserts thatNormalizadorMorfologicocorrectly reduces a test word.
What each case asserts
Every test case is a record with four fields:| Field | Type | Meaning |
|---|---|---|
id | String | Unique identifier used in failure messages |
entrada | String | The raw Spanish sentence to translate |
esperaExito | boolean | Whether isExito() should be true |
formulaEsperada | String | The exact formula string expected when esperaExito is true |
LogicScriptService.traducir(entrada) — the same facade used by the GUI and CLI — and checks:
result.isExito() == esperaExito- If success was expected:
result.getFormula().equals(formulaEsperada)
pasosDeAnalisis entries are asserted (they can be added later).
Test categories covered
Basic implication (si…entonces, si elíptico, cuando, siempre que)
Basic implication (si…entonces, si elíptico, cuando, siempre que)
The core
SI_ENTONCES pattern and its elliptical and alternative-keyword variants:si llueve entonces llevo paraguas→(p → q)si estudio apruebo→(p → q)(elliptical — noentonces)cuando llueve llevo paraguas→(p → q)siempre que trabajo entonces descanso→(p → q)llevo paraguas si llueve→(p → q)(consequent-first order)en caso de que llueva, llevo paraguas→(p → q)
Conjunction and disjunction
Conjunction and disjunction
Simple binary patterns and compound antecedent/consequent forms:
llueve y estudio→(p ∧ q)llueve o estudio→(p ∨ q)si estudio y practico entonces apruebo→((p ∧ q) → r)si llueve entonces llevo paraguas o gorra→(p → (q ∨ r))si llueve entonces llevo paraguas y gorra→(p → (q ∧ r))si llueve o solea entonces salgo→((p ∨ q) → r)
Special connectives (solo si, a menos que, si y solo si)
Special connectives (solo si, a menos que, si y solo si)
apruebo solo si estudio→(p → q)salgo a menos que llueva→(¬p → q)apruebo si y solo si estudio→(p ↔ q)practico si y solo si estudio→(p ↔ q)
Morphologically inflected sentences
Morphologically inflected sentences
Cases that exercise
lexrule suffix normalization and lemma mappings rather than exact surface forms:si duermo descanso—duermohandled byheuristica primera_personasi estudian aprueban— regular-ansuffix rulesi duerme descansa—lemma duerme -> dormirsi duermes descansas—lemma duermes -> dormirsi puede descansar—lemma puede -> podersi llego descanso— first-person-oheuristicpractico si y solo si estudio— first-person-oheuristic for both sides
Compound sentences with comma-separated clauses
Compound sentences with comma-separated clauses
Sentences that contain multiple independent clauses separated by commas, which the engine splits into blocks and joins with
∧:si estudio apruebo, si no estudio no apruebo→((p → q) ∧ (¬p → ¬q))si llueve entonces llevo paraguas, en caso de que estudio, apruebo→((p → q) ∧ (r → s))cuando llueve llevo paraguas, si estudio apruebo→((p → q) ∧ (r → s))
Error cases
Error cases
The harness verifies that the pipeline fails gracefully rather than crashing:
- Empty string
""— expectsisExito() == false - Whitespace-only input
" \t "— expectsisExito() == false
When to run the harness
Run the harness after any of the following changes:- Editing
core.lgs(adding or removinglemma,lexrule, orpatternentries) - Modifying
NaturalLexer(token recognition logic) - Modifying
SemanticMapper(pattern matching or fallback behaviour) - Modifying
EmitidorFormula(formula serialization or symbol assignment) - Modifying
NormalizadorMorfologicoorBaseConocimiento(canonicalization)