TautoTeacher 2.0 builds a full evaluation tree for every truth assignment a student selects in the truth table panel, letting them see exactly why a formula evaluates toDocumentation 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.
true or false for a given row — not just the final answer. The tree decomposes the formula recursively by operator precedence, labelling each internal node with its logical operator and its computed value, and each leaf node with the assigned boolean value of the variable. This visual walkthrough is one of the core pedagogical features that distinguishes TautoTeacher from a plain formula checker.
Classes
NodoArbolEvaluacion
The building block of the tree. Each node stores:
String etiqueta— the operator symbol (∧,∨,¬,→,↔) for internal nodes, or"V"/"F"for leaf nodes that represent substituted variable values.boolean valor— the truth value computed for this node’s sub-expression.List<NodoArbolEvaluacion> hijos— immutable list of child nodes (empty for leaves, one child for negation, two for binary operators).
etiqueta(), valor(), hijos(), and esHoja() (returns true when hijos is empty).ConstructorArbolEvaluacion
A
final utility class with a single public static method:construir(String formula, Map<String, Boolean> valores) — normalises Unicode symbols to their keyword-alias equivalents, replaces every variable in the formula with its assigned "true" or "false" literal using a word-boundary regex, then recursively builds the tree by finding the lowest-precedence operator at the top level (depth 0 with respect to parentheses) and splitting there.RenderizadorArbolEvaluacion
Renders a
NodoArbolEvaluacion tree as an ASCII diagram for display in the UI’s text panel. Each node is printed as V : <etiqueta> or F : <etiqueta>, with tree-drawing characters (├──, └──, │) representing the branch structure. The root line is preceded by a "Árbol de evaluación" header, and the output ends with "Resultado raíz: V" or "Resultado raíz: F".Operator precedence
ConstructorArbolEvaluacion scans for operators from lowest to highest binding power, so the first operator found at depth 0 becomes the root of the current sub-tree. The precedence order (lowest first) used during tree construction is:
| Priority | Operator | Symbol |
|---|---|---|
| 1 (lowest) | Biconditional | <-> → ↔ |
| 2 | Implication | -> → → |
| 3 | Disjunction | || → ∨ |
| 4 | Conjunction | && → ∧ |
| 5 (highest) | Negation | ! → ¬ |
Example tree
For the formulap→q with the assignment p = true, q = false, the tree looks like this:
→ and the value false, because true → false is false. Its two children are the leaf nodes for p (etiqueta "V", value true) and q (etiqueta "F", value false). Because variables are substituted to the literals true/false before the tree is built, leaf etiquetas are always "V" or "F", not the original variable names.
Code example
(p→q)∧(q→r)→(p→r) the same pattern applies — the constructor recurses into each parenthesised sub-expression, producing a fully annotated tree that the student can inspect level by level.