1
$\begingroup$

I have a problem where there are two traffic lights in a junction. If the red light $R_i$ in traffic light $i=1,2$ is on, then green either $R$ or yellow $Y$ is on the other light and vice versa. I think this can be expressed as

$$(R_1 \leftrightarrow (G_2 \lor Y_2)) \land (R_2 \leftrightarrow(G_1 \lor Y_1))$$

Also we need to enforce that two lights cannot be on simultaneously and one light exactly is on at each time,

\begin{align}\neg (G_i \land Y_i)\land \neg(G_i \land R_i) \land \neg (Y_i \land R_i)\land(G_i\lor Y_i \lor R_i)\end{align}

How would one proof with resolution that two red lights cannot be on simultaneously?

Obviously if $R_i=1$, then either $G_{i^\prime}$ or $Y_{i^\prime}$ is 1 ($i^\prime = 1$ if $i = 2$ and vice versa) because otherwise $R_i \leftrightarrow (G_{i^\prime} \lor Y_{i^\prime}) =0$. Thus because $G_{i^\prime}$ or $Y_{i^\prime}$ is 1, $R_{i^\prime}$ cannot be 1 simultaneously because we would violate the clauses that exactly one light is on (To be more specific either $\neg(G_i \land R_i) \land \neg (Y_i \lor R_i)=0$). It seems clear cut, but I cannot formulate the formal resolution proof. Any help?

  • 0
    You should add parenthesis in your first formula, like so: $(R_1 \leftrightarrow (G_1 \lor Y_1)) \land (R_2 \leftrightarrow(G_2 \lor Y_2))$. However, you mixed the indices somewhere. As for your second question, you can always explore all the possibilities in a table, and show that your formula is true iff the conditions you stated are respected.2017-01-18
  • 0
    @Mariuslp good catch I edited my question. Yes it is clear from the truth table that two red's cannot be on simultaneously but I would like to know how the resolution method can be applied to yield the same conclusion.2017-01-18
  • 0
    You need to clausify everything first when doing resolution. I suggest that you do that first. If you don't know, this fairly short video explains the INDO method of clasuification/conversion to clausal form: https://www.youtube.com/watch?v=sjKA-sbwh_M&list=PLn4qH88IZbYnW5jbzYYXCBDrghSJf06DN&index=192017-01-18

2 Answers 2

2

We have to write down all the clauses corresponding to the premises, with the negation of the sought conclusion.

If the conclusion is "that two red lights cannot be on simultaneously", we can formalize it as :

$\lnot (R_1 \land R_2)$.

There are four clauses produced from the second premise:

1) $¬G_1 ∨ ¬Y_1$

2) $¬G_1 ∨ ¬ R_1$

3) $¬Y_1 ∨ ¬R_1$

4) $G_1 ∨ Y_1 ∨ R_1$

and the same : 5)-8) for $i=2$.

From the other premise we have : $R_1 \to (G_2 ∨ Y_2)$ i.e.

9) $¬R_1 ∨ G_2 ∨ Y_2$

and : $¬(G_2 ∨ Y_2) ∨ R_1$ i.e.

10) $¬G_2 ∨ R_1$

11) $¬Y_2 ∨ R_1$

and the same : 12)-14) for $i=2$.

Finally, we have to add the negation of the conclusion:

15) $R_1$

16) $R_2$.

Finally, we apply the resolution procedure.

1

While @MauroALLEGRANZA has given the systematic solution, let me show a shortcut I'd use if I were to solve this problem with paper and pencil. These three clauses, which are part of your assumptions,

$$(\neg G_i \vee \neg R_i) \wedge (\neg Y_i \vee \neg R_i) \wedge (G_i \vee Y_i \vee R_i)$$

are easily verified to be the CNF equivalent of $(G_i \vee Y_i) \leftrightarrow (\neg R_i)$. By transitivity of equivalence you are done:

$$ R_i \leftrightarrow (G_{3-i} \vee Y_{3-i}) \leftrightarrow (\neg R_{3-i}) ~~~\text{ for } i \in \{1,2\} \enspace.$$

As an aside, real traffic lights may have simultaneous red lights for both intersecting roads, because the actual safety requirement they have to satisfy is the weaker

$$ (G_{3-i} \vee Y_{3-i}) \rightarrow R_i ~~~\text{ for } i \in \{1,2\} \enspace. $$