Say I have a boolean formula
a or (b and c)
I would wish to convert it to CNF
i.e.
(a and b) or (a and c)
Is there any existing library that could achieve this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to implement it yourself, here is an example of how to play with Linq Expressions formulas. The sample program derivates and simplifies formulas, which isn’t exactly what you want to do, but is near enough to be useful.
P.S..: If I remember my logic correctly, there are multiple ways to express the same formula in either CNF or DNF given a starting formula. You might want to normalize it someway, to get something that it’s always consistent.