\documentclass[11pt]{article}


\title{CS243 Homework Assignment 2}
\date{Due Tuesday, September 18}


\begin{document}
\maketitle

 Please hand in a hard copy of your solutions before class on the due date. The answers to the homework assignment should be your own individual work. You may discuss problems with  other students in the class; however, your write-up must mention the names of these individuals. 
 
\begin{enumerate} 
\item (20 points, 4 points each) Consider domain $D = \{ \star, \circ \}$,  binary predicate $p$, and  unary predicate $q$ with the following interpretation $I$:

\begin{itemize}
\item $q(\star) = {\rm false}$, $q(\circ) = {\rm true}$
\item $p(\star, \star) = {\rm true}$, $p(\star, \circ) = {\rm false}$, $p(\circ, \star) = {\rm false}$,
$p(\circ, \circ) = {\rm true}$
\end{itemize}

For each of the first-order logic formulas below, state their truth value under domain $D$ and interpretation $I$ given above. For each question, explain your reasoning.

\begin{enumerate}
\item $\forall x. \exists y. p(x,y)$
\item $\exists x. \forall y. p(x,y)$
\item $\forall x. (q(x) \rightarrow (\exists y. p(x,y)))$
\item $\forall x. \forall y. (p(x,y) \rightarrow q(x))$
\item $\exists x. (q(x) \rightarrow (\forall y. p(x,y)))$
\end{enumerate} 

\item (20 points, 4 points each) Consider the following predicates:
\begin{itemize}
\item ${\rm girl}(x)$, which represents $x$ is a girl
\item ${\rm guy}(x)$, which represents $x$ is a guy
\item ${\rm likes}(x,y)$, which represents $x$ likes $y$
\item ${\rm goodlooking}(x)$, which represents $x$ is goodlooking 
\end{itemize}

Translate the following English sentences into first-order logic:
\begin{enumerate}
\item Every guy likes a girl.
\item Some guys like all girls.
\item Every girl likes all goodlooking guys.
\item There are some girls who don't like any guys.
\item Every goodlooking girl is liked by some guy.
\end{enumerate}

\item (10 points) Prove that the following formula is contingent:
\[
\forall x. \forall y. (p(x,y) \rightarrow p(y,x))
\]
\item (10 points) Prove that the following formulas $F_1$ and $F_2$ are equivalent:
\[
\begin{array}{ll}
F_1: & \neg (\exists x. (p(x) \land (\exists y. (q(y) \land \neg r(x,y)) ) ) ) \\
F_2: & \forall x. (p(x) \rightarrow (\forall y. (q(y) \rightarrow r(x,y)) ) )
\end{array}
\]
Clearly label each equivalence used in your proof.


\item (15 points) Consider the following hypotheses:
\[
\begin{array}{ll}
{\rm H1:} & \exists x. (p(x) \land q(x) ) \\
{\rm H2:} & \forall x. (q(x) \rightarrow r(x)) 
\end{array}
\]
Use rules of inference to prove that the following conclusion follows from these hypotheses:
\[
{\rm C:} \ \ \exists x. (p(x) \land r(x))
\]
Clearly label the inference rules used at every step of your proof.

\item (15 points) Consider the following hypotheses:
\[
\begin{array}{ll}
{\rm H1:} & \forall x. (\neg C(x) \rightarrow \neg A(x) ) \\
{\rm H2:} & \forall x. ( A(x) \rightarrow \forall y. B(y) ) \\
{\rm H3:} & \exists x. A(x)
\end{array}
\] 
Use rules of inference to prove that the following conclusion follows from these hypotheses:
\[
{\rm C:} \ \ \exists x. (B(x) \land C(x))
\]
Clearly label the inference rules used at every step of your proof.

\end{enumerate}
\end{document}
