doc-src/TutorialI/Misc/document/prime_def.tex
author Walther Neuper <neuper@ist.tugraz.at>
Thu, 12 Aug 2010 15:03:34 +0200
branchisac-from-Isabelle2009-2
changeset 37913 20e3616b2d9c
parent 17187 45bee2f6e61f
child 40685 313a24b66a8d
permissions -rw-r--r--
prepare reactivation of isac-update-Isa09-2
     1 %
     2 \begin{isabellebody}%
     3 \def\isabellecontext{prime{\isacharunderscore}def}%
     4 %
     5 \isadelimtheory
     6 %
     7 \endisadelimtheory
     8 %
     9 \isatagtheory
    10 %
    11 \endisatagtheory
    12 {\isafoldtheory}%
    13 %
    14 \isadelimtheory
    15 %
    16 \endisadelimtheory
    17 %
    18 \begin{isamarkuptext}%
    19 \begin{warn}
    20 A common mistake when writing definitions is to introduce extra free
    21 variables on the right-hand side.  Consider the following, flawed definition
    22 (where \isa{dvd} means ``divides''):
    23 \begin{isabelle}%
    24 \ \ \ \ \ {\isachardoublequote}prime\ p\ {\isasymequiv}\ {\isadigit{1}}\ {\isacharless}\ p\ {\isasymand}\ {\isacharparenleft}m\ dvd\ p\ {\isasymlongrightarrow}\ m\ {\isacharequal}\ {\isadigit{1}}\ {\isasymor}\ m\ {\isacharequal}\ p{\isacharparenright}{\isachardoublequote}%
    25 \end{isabelle}
    26 \par\noindent\hangindent=0pt
    27 Isabelle rejects this ``definition'' because of the extra \isa{m} on the
    28 right-hand side, which would introduce an inconsistency (why?). 
    29 The correct version is
    30 \begin{isabelle}%
    31 \ \ \ \ \ {\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}%
    32 \end{isabelle}
    33 \end{warn}%
    34 \end{isamarkuptext}%
    35 \isamarkuptrue%
    36 %
    37 \isadelimtheory
    38 %
    39 \endisadelimtheory
    40 %
    41 \isatagtheory
    42 %
    43 \endisatagtheory
    44 {\isafoldtheory}%
    45 %
    46 \isadelimtheory
    47 %
    48 \endisadelimtheory
    49 \end{isabellebody}%
    50 %%% Local Variables:
    51 %%% mode: latex
    52 %%% TeX-master: "root"
    53 %%% End: