public void GetDNFSimpleInfix() { ProcessProposition myProcessing = new ProcessProposition(); string input = "%(~(A),>(>(C,|(D,E)),~(B)))"; myProcessing.RootProp = myProcessing.InsertInBinaryTree(ref input); myProcessing.FillTheVariablesList(); ALE1.Truth_Table.TruthTable myTruthTable = new ALE1.Truth_Table.TruthTable(myProcessing.Variables); myProcessing.AssignRowValues(myTruthTable.GetRows()); Assert.AreEqual(myTruthTable.GetDNFSimple().Infix(), "(A | ((B & ~ C) | ((B & E) | (B & D))))"); }
public void Get_hash_code() { ProcessProposition myProcessing = new ProcessProposition(); string input = "|(B,>(&(|(A,C),|(C,>(A,A))),>(&(&(|(&(B,&(B,B)),~(B)),&(A,=(A,~(|(A,A))))),B),|(&(=(C,C),C),C))))"; myProcessing.RootProp = myProcessing.InsertInBinaryTree(ref input); myProcessing.FillTheVariablesList(); ALE1.Truth_Table.TruthTable myTruthTable = new ALE1.Truth_Table.TruthTable(myProcessing.Variables); myProcessing.AssignRowValues(myTruthTable.GetRows()); Assert.AreEqual(myTruthTable.GetHashCodeTB(), "FF"); }
public void GetDNFSimplePrefix() { ProcessProposition myProcessing = new ProcessProposition(); string input = "&(~(A),>(>(C,|(D,E)),~(B)))"; myProcessing.RootProp = myProcessing.InsertInBinaryTree(ref input); myProcessing.FillTheVariablesList(); ALE1.Truth_Table.TruthTable myTruthTable = new ALE1.Truth_Table.TruthTable(myProcessing.Variables); myTruthTable.SimplifiedTableToString(); myProcessing.AssignRowValues(myTruthTable.GetRows()); Assert.AreEqual(myTruthTable.GetDNFSimple().Prefix(), "|(&(~(A),~(B)),&(~(A),&(C,&(~(D),~(E)))))"); }
public void GetDNFInfix() { ProcessProposition myProcessing = new ProcessProposition(); string input = "|(B,>(&(|(A,C),|(C,>(A,A))),>(&(&(|(&(B,&(B,B)),~(B)),&(A,=(A,~(|(A,A))))),B),|(&(=(C,C),C),C))))"; myProcessing.RootProp = myProcessing.InsertInBinaryTree(ref input); myProcessing.FillTheVariablesList(); ALE1.Truth_Table.TruthTable myTruthTable = new ALE1.Truth_Table.TruthTable(myProcessing.Variables); myTruthTable.ToString(); myProcessing.AssignRowValues(myTruthTable.GetRows()); Assert.AreEqual(myTruthTable.GetDNF().Infix(), "((~ A & (~ B & ~ C)) | ((~ A & (~ B & C)) | ((~ A & (B & ~ C)) | ((~ A & (B & C)) | ((A & (~ B & ~ C)) | ((A & (~ B & C)) | ((A & (B & ~ C)) | (A & (B & C)))))))))"); }