= Solution
The condition about taking the course restricts which students the <first-order sentence> talks about. Within that condition we need both an inclusive <logical disjunction> and a prohibition on satisfying both alternatives:
$$
\boxed{\forall x\Bigl((\mathit{Student}(x)\land\mathit{Takes}(x,\mathit{KRR},2015))\to\bigl((\mathit{Undergrad}(x)\lor\mathit{Masters}(x))\land\neg(\mathit{Undergrad}(x)\land\mathit{Masters}(x))\bigr)\Bigr).}
$$
The <logical conjunction> on the right expresses exactly one of the two categories. It does not prohibit unrelated individuals from belonging to both categories: the restriction applies to the students in the antecedent.
Back to article page