boolean expression from truth table

376 Views Asked by At

I want to convert truth table to boolean expression : for example , this is the table

a    b         a+b>0
0    1           1         
1    0           1      

I want to get the following output: (¬a ^b ) ∨ (a ^¬b)

I am thinking about using replace, :

if (value == str(0)):
    table= table(str(value), 'not x')
else:
    table= table.replace(str(value), ' x')

it is not correct ,,

how can I replace the value with the column name and then check if the value is 0 or 1 ?

I am using python

1

There are 1 best solutions below

0
smichr On

How did you use SOPform? I get

enter image description here