9722
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
10267
|
3 |
\def\isabellecontext{prime{\isacharunderscore}def}%
|
9844
|
4 |
%
|
8749
|
5 |
\begin{isamarkuptext}%
|
9844
|
6 |
\begin{warn}
|
|
7 |
A common mistake when writing definitions is to introduce extra free
|
11456
|
8 |
variables on the right-hand side. Consider the following, flawed definition
|
|
9 |
(where \isa{dvd} means ``divides''):
|
9844
|
10 |
\begin{isabelle}%
|
10187
|
11 |
\ \ \ \ \ {\isachardoublequote}prime\ p\ {\isasymequiv}\ {\isadigit{1}}\ {\isacharless}\ p\ {\isasymand}\ {\isacharparenleft}m\ dvd\ p\ {\isasymlongrightarrow}\ m\ {\isacharequal}\ {\isadigit{1}}\ {\isasymor}\ m\ {\isacharequal}\ p{\isacharparenright}{\isachardoublequote}%
|
9924
|
12 |
\end{isabelle}
|
11457
|
13 |
\par\noindent\hangindent=0pt
|
8749
|
14 |
Isabelle rejects this ``definition'' because of the extra \isa{m} on the
|
11456
|
15 |
right-hand side, which would introduce an inconsistency (why?).
|
|
16 |
The correct version is
|
9844
|
17 |
\begin{isabelle}%
|
10187
|
18 |
\ \ \ \ \ {\isachardoublequote}prime\ p\ {\isasymequiv}\ {\isadigit{1}}\ {\isacharless}\ p\ {\isasymand}\ {\isacharparenleft}{\isasymforall}m{\isachardot}\ m\ dvd\ p\ {\isasymlongrightarrow}\ m\ {\isacharequal}\ {\isadigit{1}}\ {\isasymor}\ m\ {\isacharequal}\ p{\isacharparenright}{\isachardoublequote}%
|
9924
|
19 |
\end{isabelle}
|
9844
|
20 |
\end{warn}%
|
8749
|
21 |
\end{isamarkuptext}%
|
9844
|
22 |
\end{isabellebody}%
|
9145
|
23 |
%%% Local Variables:
|
|
24 |
%%% mode: latex
|
|
25 |
%%% TeX-master: "root"
|
|
26 |
%%% End:
|