TautoTeacher 2.0 is structured around four independent layers, each housed in its own Java package family. The Core Logic Engine owns formula evaluation and truth table generation. The NLP Pipeline converts Spanish natural language into a token stream. The LogicScript layer provides a domain-specific language that ties the NLP output to the logic engine through an intermediate representation. The User Interface layer presents input controls and results through a Swing desktop window. No layer reaches across its boundary directly — all cross-layer communication flows through well-defined service classes.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.
Layer Overview
Core Logic Engine
Package:
tautoteacher2.core.logicaThe engine is the heart of TautoTeacher. It receives a propositional formula string (using Unicode connectives ∧ ∨ ¬ → ↔) and:- Parses it into an AST via
ParserLogicaandNodoAST, using the operator precedence defined inOperador. - Validates syntax with
ValidadorFormula(balanced parentheses, valid character set). - Evaluates all 2ⁿ truth-value combinations through
MotorLogico.esTautologia()andMotorLogico.tipoFormula(), returningTAUTOLOGÍA,CONTRADICCIÓN, orCONTINGENCIA. - Generates a full truth table via
TablaVerdad.construir()and the underlyingGeneradorTablaVerdad. - Builds an evaluation tree (
ConstructorArbolEvaluacion,NodoArbolEvaluacion) thatRenderizadorArbolEvaluacionrenders in the visualization panel. - Produces educational explanations with
ExplicacionEducativaBuilder, including a refutation-style proof for implication and equivalence formulas.
NLP Pipeline
Package:
tautoteacher2.nlpThe NLP pipeline processes a raw Spanish sentence through four sequential stages — none of which require a trained machine-learning model:- Text normalization (
NormalizadorTexto) — lowercase conversion, accent normalization, punctuation handling. - Lexer tokenization (
NaturalLexer,LexerNatural) — splits the normalized text into typed tokens (TipoToken,TipoTokenNatural), recognizing connective keywords, atomic-proposition spans, and negation markers. - Morphological normalization (
NormalizadorMorfologico) — applies suffix rules loaded fromcore.lgs(e.g.,-ado → -ar) to map inflected verb forms to their canonical infinitives, handled byConfiguracionMorfologiaLgsandReglaMorfologicaLgs. - Semantic mapping (
SemanticMapper,MapeadorSemantico) — matches the token sequence against structural patterns (PatronSemanticoLgs,ReglasPatron) to identify connective roles and map atomic spans to propositional variables viaRegistroProposiciones.
BaseConocimiento, Lexico, DiccionarioSinonimos) are loaded at startup from core.lgs by LgsCargador, which produces a ContenidoLgs object and reports loading errors through ResultadoCargaLgs and EstadoCargaLgs.LogicScript DSL
Package:
tautoteacher2.logicscriptLogicScript is TautoTeacher’s lightweight domain-specific language layer. It coordinates the NLP pipeline and the logic engine and exposes the translation result through a uniform LogicScriptResult value object (formula string, proposition map, analysis steps, success flag, and error message).Key components:LogicScriptEngine— orchestrates the full translation pipeline for a single natural-language input string.LogicScriptService— a thin facade that the UI and CLI both call; itstraducir(String)method is the single public entry point.LogicScriptCli— standalonemainclass for command-line use; prints the formula, proposition map, analysis steps, andMotorLogicoclassification.LogicScriptRegressionHarness— self-contained test runner with 40 cases; exits non-zero on any failure.- IR expressions (
tautoteacher2.logicscript.ir) —LogicExprinterface implemented byAtomExpr,NegExpr,AndExpr,OrExpr,ImpExpr, andEquivExpr;EmitidorFormulawalks the IR tree to emit the Unicode formula string. RegistroProposiciones— assigns and tracks single-letter variable names (p,q,r, …) for atomic proposition spans during a single translation run.
User Interface
Package:
tautoteacher2.uiThe UI layer is a pure Swing application with no direct references to the logic engine or NLP classes. It delegates all processing to LogicScriptService and MotorLogico through TautoTeacherApp:TautoTeacherApp— the application controller; wires panels together, handles the Procesar action, dispatches to formula mode or natural-language mode, and converts ASCII keyboard shortcuts to Unicode connectives vianormalizarSimbolosTeclado().VentanaPrincipal— the top-levelJFrame; hosts the input panel, result panel, educational content area, and visualization panel.PanelEntradaNatural— provides the mode toggle (formula vs. natural language) and text input fields.PanelResultadoLogico— displays the classification dictamen with color coding: green for tautology, red for contradiction, dark text for contingency.PanelVisualizacion— renders the truth table grid and evaluation tree using data fromTablaVerdadandConstructorArbolEvaluacion.IconosApp— loads the application icon fromresources/icons/app-icon.png.
Data Flow
The following diagram shows how a user input travels through the system to produce a classified result:TautoTeacherApp normalizes the raw input string, passes it directly to MotorLogico.tipoFormula(), and feeds the same formula to TablaVerdad.construir() and ExplicacionEducativaBuilder.construir().
In natural-language mode, the input first passes through LogicScriptService.traducir(), which runs the full NLP pipeline inside LogicScriptEngine. If translation succeeds, the resulting LogicScriptResult provides the formula string and a proposition map (Map<String, String>). Both are then forwarded to the same MotorLogico and visualization calls used in formula mode.
Service Facade Pattern
Neither the GUI nor the CLI calls the NLP or engine classes directly. Instead, both entry points go through a service layer:LogicScriptServicewrapsLogicScriptEngineand is the sole public API for NL-to-formula translation.TautoTeacherAppholds a singlefinalinstance of it;LogicScriptCliinstantiates one per invocation.ServicioTautoTeacher(intautoteacher2.servicio) is a stub class with an empty body. The package also contains typed DTOs (SolicitudAnalisis,ResultadoAnalisis) that reserve structure for a future higher-level facade, but no orchestration logic is implemented yet.
LogicScriptResult and the return value of MotorLogico.tipoFormula(), both of which are stable value types.
core.lgs is a plain-text resource file loaded at runtime from the classpath path logicscript/core.lgs. It contains the connective keyword definitions, synonym dictionary entries, morphological suffix rules (lexrule), and semantic patterns that drive the entire NLP pipeline. Because it is a resource file rather than compiled code, you can edit its rules and reload the application — or swap in a custom .lgs file — without recompiling any Java source.