示例#1
0
 /// <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);
 }
示例#2
0
        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;
        }
示例#3
0
 public string GenerateHexaDecimal(TruthTable.TruthTable truth)
 {
     return(truth.GetHexaDecimal());
 }
示例#4
0
 public TruthTable.TruthTable SimplifyTruthTable(TruthTable.TruthTable table)
 {
     table.Simplify();
     return(table);
 }