Exemplo n.º 1
0
 def test_equality(self):
   ttconstructor = TruthTableConstructor()
   ttconstructor.build("p <-> q")
   assert ttconstructor.table[0] == LogicalValue("p <-> q", [1, 0, 0, 1])
Exemplo n.º 2
0
 def test_implication(self):
   ttconstructor = TruthTableConstructor()
   ttconstructor.build("p -> q")
   assert ttconstructor.table[0] == LogicalValue("p -> q", [1, 1, 0, 1])
Exemplo n.º 3
0
 def testNOT(self):
   ttconstructor = TruthTableConstructor()
   ttconstructor.build("NOT p")
   assert ttconstructor.table[0] == LogicalValue("NOT p", [0, 1])
Exemplo n.º 4
0
 def test_group(self):
   ttconstructor = TruthTableConstructor()
   ttconstructor.build("p AND (q OR r)")
   assert ttconstructor.table[1] == LogicalValue("p AND (q OR r)", [0, 0, 0, 0, 0, 1, 1, 1])
Exemplo n.º 5
0
 def testOR(self):
   ttconstructor = TruthTableConstructor()
   ttconstructor.build("p OR q")
   assert ttconstructor.table[0] == LogicalValue("p OR q", [0, 1, 1, 1])