简体   繁体   English

如何最小化此逻辑(或门CNF)?

[英]how to minimize this logic (or-gate CNF)?

I'm writing down the truth table for the OR-gate in a circuit satisfiability problem (this has to do with reduction of the 3-satisfiability problem). 我正在写电路可满足性问题中“或”门的真值表(这与减少3可满足性问题有关)。

I have: 我有:

a  b  c    c = (a OR b)
1  1  1    1
1  1  0    0
1  0  1    1
1  0  0    0
0  1  1    1
0  1  0    0
0  0  1    0
0  0  0    1

So if I take the rows with 0 in the column c = (a OR b), and negate the a,b,c then i get the four clauses: 因此,如果我在列c =(a OR b)中使用0,则对a,b,c求反,那么我得到了四个子句:

!a AND !b AND c
a AND !b AND !c
a AND !b and c
a AND b AND !c

I'm trying to minimize these clauses. 我试图最小化这些条款。 I know that the right answer is: 我知道正确的答案是:

c OR !a
c OR !b
c OR !a or !b

How do I minimize those four clauses? 如何最小化这四个条款? is there a program online? 在线有程序吗? I used wolfram, but it didn't output the right answer, so if anyone has a second to help that would be amazing 我使用了Wolfram,但是它没有输出正确的答案,因此,如果有人有帮助的话,那就太好了

It is easy to see that the last column is almost the same as c column except two last rows. 很容易看出,除了最后两行外,最后一列与c列几乎相同。 And for the two last rows it have values from column c swapped. 对于最后两行,它交换了c列中的值。 So we can write as: 所以我们可以这样写:

if (a ∨ b) then c else ¬c

if c then t else f can be represented as CNF (c ∨ t) ∧ (¬c ∨ f) so the formula above will look like: if c then t else f可以表示为CNF (c ∨ t) ∧ (¬c ∨ f)因此上面的公式将如下所示:

(a ∨ b ∨ ¬c) ∧ (¬(a ∨ b) ∨ c)
= (a ∨ b ∨ ¬c) ∧ ((¬a ∧ ¬b) ∨ c)
= (a ∨ b ∨ ¬c) ∧ (¬a ∨ c) ∧ (¬b ∨ c)

And the last one is exactly what you want. 最后一个正是您想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM