Exemple #1
0
    def minimize_clicked(self):
        if self.validate_input():
            self.bigEditor.clear()

            mts = self.mterm_edit.text().split(' ')

            #remove any duplicates from the list
            #remove any non integers from the list
            mts = list(set(filter(lambda x: self.representsInt(x), mts)))

            dcs = self.dcare_edit.text().split(' ')

            #remove any non integers from the list
            dcs = list(set(filter(lambda x: self.representsInt(x), dcs)))

            vs = self.v_edit.text().split(' ')
            vs = list(filter(lambda x: x, vs))

            qm = QM(mts, dcs, vs)
            pis = qm.pis()
            qm.primary_epis()
            self.bigEditor.append('Prime Implicants')

            print(qm.procedure)
            for pi in pis:
                self.bigEditor.append(qm.procedure)
                self.bigEditor.append('\n')
Exemple #2
0
 def test_primary_epis(self):
     minterms = [1, 2, 3, 4, 5, 6, 9, 11, 15]
     qm = QM(minterms)
     #expected pass test case
     self.assertEqual(qm.primary_epis(), [])