diff --git a/assignments/a2/a2.tex b/assignments/a2/a2.tex index 2d072ec..d3e251e 100644 --- a/assignments/a2/a2.tex +++ b/assignments/a2/a2.tex @@ -111,7 +111,7 @@ $\forall s \in sc.sections,~ ...$ % TODO: fill in the predicate definition for two meeting times conflicting \begin{align*} -MeetingTimesConflict(m_1, m_2) : TODO +MeetingTimesConflict(m_1, m_2) : m_1[0] == m_2[0] \land m_1[2] > m_2[1] \land m_2[2] > m_1[1] \qquad \text{where $m_1, m_2 \in M$} \end{align*} @@ -122,7 +122,8 @@ MeetingTimesConflict(m_1, m_2) : TODO % Use the MeetingTimesConflict predicate in your response. \begin{align*} -SectionsConflict(s_1, s_2) : TODO +SectionsConflict(s_1, s_2) : ('Y' \in \{s_1[1], s_2[1]\} \lor s_1[1] = s_2[1]) \Rightarrow \\ +\exists m_1 \in s_1[2], \text{ s.t. } \exists m_2 \in s_2[2], \text { s.t. } MeetingTimesConflict(m_1, m_2) \qquad \text{where $s_1, s_2 \in S$} \end{align*} @@ -133,7 +134,7 @@ SectionsConflict(s_1, s_2) : TODO % Use the SectionsConflict predicate in your response. \begin{align*} -IsValidSchedule(sc) : TODO +IsValidSchedule(sc) : \forall s_1, s_2 \in sc.sections, SectionsConflict(s_1, s_2) \Rightarrow s_1 = s_2 \qquad \text{where $sc \in SC$} \end{align*} @@ -157,7 +158,7 @@ Note that a course $c \in C$ is a tuple, and $c[2]$ is a set of sections, and so % TODO: fill in the predicate definition for a section being compatible with a schedule. \begin{align*} -IsCompatibleSection(sc, s) : TODO +IsCompatibleSection(sc, s) : \forall s_1 \in sc.sections, \neg SectionsConflict(s, s_1) \qquad \text{where $sc \in SC, s \in S$} \end{align*} @@ -168,7 +169,7 @@ IsCompatibleSection(sc, s) : TODO % Use IsCompatibleSection in your response. \begin{align*} -IsCompatibleCourse(sc, c) : TODO +IsCompatibleCourse(sc, c) : \exists s \in c[2] \text{ s.t. } IsCompatibleSection(sc, s) \qquad \text{where $sc \in SC, c \in C$} \end{align*}