예제 #1
0
파일: Processor.cs 프로젝트: droft1312/lpp
 /// <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
파일: Processor.cs 프로젝트: droft1312/lpp
        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
파일: Processor.cs 프로젝트: droft1312/lpp
 public string GenerateHexaDecimal(TruthTable.TruthTable truth)
 {
     return(truth.GetHexaDecimal());
 }
예제 #4
0
파일: Processor.cs 프로젝트: droft1312/lpp
 public TruthTable.TruthTable SimplifyTruthTable(TruthTable.TruthTable table)
 {
     table.Simplify();
     return(table);
 }