/// <summary> /// Returns a truth table based off the root /// </summary> /// <param name="root"></param> /// <returns></returns> public TruthTable.TruthTable DetermineTruthTable(Node root) { TruthTable.TruthTable truth = new TruthTable.TruthTable(); truth.CreateTruthTable(root); truthTable = truth; return(truth); }
public void GenerateSixTruths(string input, RichTextBox outputTextBox) { ProcessStringInput(input); string hexadecimals = ""; outputTextBox.Text = ""; // normal inputted tree var truthTable = DetermineTruthTable(root); hexadecimals += "Normal tree: " + GenerateHexaDecimal(truthTable); hexadecimals += "\n" + new string('-', 15) + "\n"; // dnf tree string disjunctivePrefixForm = truthTable.DisjunctiveForm(); ProcessStringInput(disjunctivePrefixForm); truthTable = DetermineTruthTable(root); hexadecimals += "Disjunctive tree: " + GenerateHexaDecimal(truthTable); hexadecimals += "\n" + new string('-', 15) + "\n"; // nandified root = Nandify(root); truthTable = DetermineTruthTable(root); hexadecimals += "Nandified: " + GenerateHexaDecimal(truthTable); outputTextBox.Text = hexadecimals; }
public string GenerateHexaDecimal(TruthTable.TruthTable truth) { return(truth.GetHexaDecimal()); }
public TruthTable.TruthTable SimplifyTruthTable(TruthTable.TruthTable table) { table.Simplify(); return(table); }