Converting Natural Language Problem to CNF

63 Views Asked by At

I'm struggling in converting this problem to Conjunctive Normal Form. I'd appreciate any help or guiding.

There are $n$ stones in the river. Every stones has two states: above or below the water. There are $m$ switches. Every switch has two states: open and close. These switches can control the states of the stones. Every time you change the state of a switch, the states of the corresponding stones also change. Each switch control one or two stones.

First of all, I use $P_1$ to $P_n$ to denote stone states and $Q_1$ to $Q_m$ to denote switch states.

The problem is I don't know how should I interpret switch control the states of the stone relationship to proposition logic.

Thank so much in advance!

1

There are 1 best solutions below

1
On BEST ANSWER

Say switch $i$ controls stones $j$ and $k$. In particular, suppose that if switch $i$ is open then stone $j$ goes above water, and stone $k$ goes under water, and when we close switch $i$, then stone $j$ goes under water, and stone $k$ goes above water.

Let's use $P_j$ for stone $j$ being above water, $\neg P_k$ for stone $k$ being under water, and $S_i$ for switch $i$ being open.

Then we have:

$$(S_i \to (P_j \land \neg P_k)) \land (\neg S_i \to (\neg P_j \land P_k))$$

which transforms to CNF:

$$(\neg S_i \lor (P_j \land \neg P_k)) \land (S_i \lor (\neg P_j \land P_k)) = (\neg S_i \lor P_j) \land (\neg S_i \lor \neg P_k)) \land (S_i \lor \neg P_j) \land (S_i \lor P_k))$$