Skip to content
Snippets Groups Projects
Commit 69788631 authored by Steven Palmer's avatar Steven Palmer
Browse files

Fix to formal spec in T11

parent cf0efd75
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
...@@ -8,12 +8,25 @@ ...@@ -8,12 +8,25 @@
\newcommand\tab[1][0.8cm]{\hspace*{#1}} \newcommand\tab[1][0.8cm]{\hspace*{#1}}
\begin{document} \begin{document}
\begin{eqnarray*} \noindent
\lefteqn{\forall (i, j: \mathbb{N} | 0 \leq i < SIZE \wedge 0 \leq j < SIZE :}\\ $\forall (i, j: \mathbb{N} ~|~ 0 \leq i < SIZE \wedge 0 \leq j < SIZE : \newline
&& \exists(k, l: \mathbb{N} | 0 \leq k < SIZE \wedge 0 \leq l < SIZE \wedge (k \neq i \wedge l \neq j) : \\ ~\qquad \mbox{checkHoriz}(i, j) \lor \mbox{checkVert}(i, j) \lor \mbox{checkDiag}(i, j))$\\
&& \tab \exists(m, n: \mathbb{N} | 0 \leq m < SIZE \wedge 0 \leq n < SIZE
\wedge (m \neq k \wedge n \neq j) \\ \noindent{\bf local functions}\\
&& \tab \wedge i - k = -( i - m) \wedge j - l = -( j - n) ) : \\ checkHoriz: $\mathbb{N} \times \mathbb{N} \rightarrow \mathbb{B}$\\
&& \tab \tab board[i][j] = board[k][l] = board[m][n] ) $\mbox{checkHoriz}(i, j) \equiv (\newline
\end{eqnarray*} ~\qquad i + 2 \geq SIZE \Rightarrow \mbox{false} ~|\newline
~\qquad \mbox{true} \Rightarrow board[i][j] = board[i+1][j] \land board[i][j] = board[i+2][j] \newline
)$\\[\baselineskip]
checkHoriz: $\mathbb{N} \times \mathbb{N} \rightarrow \mathbb{B}$\\
$\mbox{checkHoriz}(i, j) \equiv (\newline
~\qquad j + 2 \geq SIZE \Rightarrow \mbox{false} ~|\newline
~\qquad \mbox{true} \Rightarrow board[i][j] = board[i][j+1] \land board[i][j] = board[i][j+2] \newline
)$\\[\baselineskip]
checkDiag: $\mathbb{N} \times \mathbb{N} \rightarrow \mathbb{B}$\\
$\mbox{checkHoriz}(i, j) \equiv (\newline
~\qquad i + 2 \geq SIZE \Rightarrow \mbox{false} ~|\newline
~\qquad j + 2 \geq SIZE \Rightarrow \mbox{false} ~|\newline
~\qquad \mbox{true} \Rightarrow board[i][j] = board[i+1][j+1] \land board[i][j] = board[i+2][j+2] \newline
)$
\end{document} \end{document}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment