Search code examples
javaboolean-expressionconjunctive-normal-formsat-solvers

how to convert boolean expression to cnf file?


i need to use sat solver for checking satisfiability of boolean expressions..

I have complex boolean expression like this

alt text

is there any automatic cnf file converter so that i can give it straight to sat solver?

I read the cnf format file.. but how to express this expression in .cnf file? i get confused when there is a conjunction inside the paranthesis and how to express --> and <-> ? please help me


Solution

  • There are a couple of solutions.

    Limboole is an open source tool which I believe includes a separate 'propositional logic to CNF' converter.

    More generally, you could also use a tool that supports propositional logic natively; some examples include Z3, CVC3, and Yices.