Which of the following are possible (semantically and syntactically correct) first-order-logic translation of "Salma loves any class which is harder than every Algorithms class".
Is the following translation correct ? and Why ?
$\forall x \forall y[[Class(x) \land AlClass(y) \land Harder(x,y)] \to Loves(Salma,x)]$
My prof considered it as a wrong translation.
What you wrote means: For any $x$ and any $y$, if $x$ is a Class and $y$ is an Algorithm Class and $x$ is harder than $y$, then Salma loves $x$. That means, any $y$ will do, as long as it is Algorithm Class and $x$ is harder than it. Then, even if some $z$ is an Algorithm Class, but $x$ is not harder than $z$, Salma still loves $x$.
In fact, using the properties of quantifiers, you can transform your proposition into the following: $$\forall x\left[Class(x)\wedge\exists y\left[AlClass(y)\wedge Harder(x,y)\right]\rightarrow Loves(Salma,x)\right]\tag{1}$$ That means: for every $x$, if $x$ is a Class and there is a $y$, such that it is an Algorithm Class and $x$ is harder than it, then Salma loves $x$. To see that the above is equivalent to what you wrote, consider the following properties:
$$\forall y\left[P(y)\rightarrow Q\right]\leftrightarrow\left[\exists yP(y)\rightarrow Q\right]$$ $$\exists y\left[Q\wedge P(y)\right]\leftrightarrow\left[Q\wedge\exists yP(y)\right]$$
where $Q$ is any proposition with no free occurrence of "$y$". Applying these to your formula, together with the fact that $\wedge$ is associative, gives (1). This is not what the exercise is asking for. Salma should love a Class $x$, if $x$ is harder than every Algorithm Class.