I need to convert a logical expression to not use parenthesis. Basically I need the disjunctive normal form.
String input: "(a | b) & c"
Output: a & c | b & c
I need to convert a logical expression to not use parenthesis. Basically I need the disjunctive normal form.
String input: "(a | b) & c"
Output: a & c | b & c
You can use pyeda to parse your expression and even convert it.
print(expr.expr("(a | b) & c").to_dnf())
Output
Or(And(a, c), And(b, c))