How to convert a formula to a disjunctive normal form?

Say the formula

(t1> = 2 or t2> = 3) and (t3> = 1)

I want to get its disjunctive normal form (t1> = 2 and t3> = 1) or (t2> = 3 and t3> = 1)

How to achieve this in Z3?

+5
source share
1 answer

Z3 does not have APIs or tactics for converting formulas to DNF. However, he maintains the goal break in many sub-goals using tactics split-clause. Given the input formula in CNF, if we apply this tactic exhaustively, each output sub-goal can be seen as a big conjunction. Here is an example of how to do this.

http://rise4fun.com/Z3/zMjO

Here is the command:

(apply (then simplify (repeat (or-else split-clause skip))))

repeat , . split-clause , . or-else skip ( ). , , (, simplify, solve-eqs) .

, script , CNF.

+6

All Articles