Home / Computer science / Zebra puzzle / Computation
Constraints: Fact 2
The Spaniard owns the dog.
Using
\begin{align*} a & = x_{5, i, 4} \\ b & = x_{1, i, 1} \\ \end{align*}derive the conjunctive normal form as in Fact 1
\begin{equation*} \forall i \quad (\lnot a \lor b) \end{equation*}and compute
for i in range(m):
a = x[Attribute.NATION, i, Nation.SPANISH]
b = x[Attribute.ANIMAL, i, Animal.DOG]
model.add_bool_or(a.Not(), b)