doc-src/Locales/Locales/document/Examples3.tex
changeset 30780 c3f1e8a9e0b5
parent 30751 36a255c2e428
child 30782 38e477e8524f
equal deleted inserted replaced
30779:492ca5d4f235 30780:c3f1e8a9e0b5
    39 %
    39 %
    40 \endisadelimvisible
    40 \endisadelimvisible
    41 %
    41 %
    42 \isatagvisible
    42 \isatagvisible
    43 \isacommand{interpretation}\isamarkupfalse%
    43 \isacommand{interpretation}\isamarkupfalse%
    44 \ nat{\isacharbang}{\isacharcolon}\ partial{\isacharunderscore}order\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
    44 \ nat{\isacharcolon}\ partial{\isacharunderscore}order\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
    45 \ \ \isakeyword{where}\ {\isachardoublequoteopen}partial{\isacharunderscore}order{\isachardot}less\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ {\isacharparenleft}x\ {\isacharless}\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
    45 \ \ \isakeyword{where}\ {\isachardoublequoteopen}partial{\isacharunderscore}order{\isachardot}less\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ {\isacharparenleft}x\ {\isacharless}\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
    46 \isacommand{proof}\isamarkupfalse%
    46 \isacommand{proof}\isamarkupfalse%
    47 \ {\isacharminus}\isanewline
    47 \ {\isacharminus}\isanewline
    48 \ \ \isacommand{show}\isamarkupfalse%
    48 \ \ \isacommand{show}\isamarkupfalse%
    49 \ {\isachardoublequoteopen}partial{\isacharunderscore}order\ {\isacharparenleft}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isacharparenright}{\isachardoublequoteclose}\isanewline
    49 \ {\isachardoublequoteopen}partial{\isacharunderscore}order\ {\isacharparenleft}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isacharparenright}{\isachardoublequoteclose}\isanewline
   102 %
   102 %
   103 \endisadelimvisible
   103 \endisadelimvisible
   104 %
   104 %
   105 \isatagvisible
   105 \isatagvisible
   106 \isacommand{interpretation}\isamarkupfalse%
   106 \isacommand{interpretation}\isamarkupfalse%
   107 \ nat{\isacharbang}{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   107 \ nat{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   108 \ \ \isakeyword{where}\ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ min\ x\ y{\isachardoublequoteclose}\isanewline
   108 \ \ \isakeyword{where}\ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ min\ x\ y{\isachardoublequoteclose}\isanewline
   109 \ \ \ \ \isakeyword{and}\ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ max\ x\ y{\isachardoublequoteclose}\isanewline
   109 \ \ \ \ \isakeyword{and}\ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ max\ x\ y{\isachardoublequoteclose}\isanewline
   110 \isacommand{proof}\isamarkupfalse%
   110 \isacommand{proof}\isamarkupfalse%
   111 \ {\isacharminus}\isanewline
   111 \ {\isacharminus}\isanewline
   112 \ \ \isacommand{show}\isamarkupfalse%
   112 \ \ \isacommand{show}\isamarkupfalse%
   172 %
   172 %
   173 \endisadelimvisible
   173 \endisadelimvisible
   174 %
   174 %
   175 \isatagvisible
   175 \isatagvisible
   176 \isacommand{interpretation}\isamarkupfalse%
   176 \isacommand{interpretation}\isamarkupfalse%
   177 \ nat{\isacharbang}{\isacharcolon}\ total{\isacharunderscore}order\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   177 \ nat{\isacharcolon}\ total{\isacharunderscore}order\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   178 \ \ \isacommand{by}\isamarkupfalse%
   178 \ \ \isacommand{by}\isamarkupfalse%
   179 \ unfold{\isacharunderscore}locales\ arith%
   179 \ unfold{\isacharunderscore}locales\ arith%
   180 \endisatagvisible
   180 \endisatagvisible
   181 {\isafoldvisible}%
   181 {\isafoldvisible}%
   182 %
   182 %
   283 Note that in Isabelle/HOL there is no symbol for strict
   283 Note that in Isabelle/HOL there is no symbol for strict
   284   divisibility.  Instead, interpretation substitutes \isa{x\ dvd\ y\ {\isasymand}\ x\ {\isasymnoteq}\ y}.%
   284   divisibility.  Instead, interpretation substitutes \isa{x\ dvd\ y\ {\isasymand}\ x\ {\isasymnoteq}\ y}.%
   285 \end{isamarkuptext}%
   285 \end{isamarkuptext}%
   286 \isamarkuptrue%
   286 \isamarkuptrue%
   287 \isacommand{interpretation}\isamarkupfalse%
   287 \isacommand{interpretation}\isamarkupfalse%
   288 \ nat{\isacharunderscore}dvd{\isacharbang}{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   288 \ nat{\isacharunderscore}dvd{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   289 \ \ \isakeyword{where}\ nat{\isacharunderscore}dvd{\isacharunderscore}meet{\isacharunderscore}eq{\isacharcolon}\isanewline
   289 \ \ \isakeyword{where}\ nat{\isacharunderscore}dvd{\isacharunderscore}meet{\isacharunderscore}eq{\isacharcolon}\isanewline
   290 \ \ \ \ \ \ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ dvd\ {\isacharequal}\ gcd{\isachardoublequoteclose}\isanewline
   290 \ \ \ \ \ \ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ dvd\ {\isacharequal}\ gcd{\isachardoublequoteclose}\isanewline
   291 \ \ \ \ \isakeyword{and}\ nat{\isacharunderscore}dvd{\isacharunderscore}join{\isacharunderscore}eq{\isacharcolon}\isanewline
   291 \ \ \ \ \isakeyword{and}\ nat{\isacharunderscore}dvd{\isacharunderscore}join{\isacharunderscore}eq{\isacharcolon}\isanewline
   292 \ \ \ \ \ \ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ dvd\ {\isacharequal}\ lcm{\isachardoublequoteclose}\isanewline
   292 \ \ \ \ \ \ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ dvd\ {\isacharequal}\ lcm{\isachardoublequoteclose}\isanewline
   293 %
   293 %
   379 %
   379 %
   380 \endisadelimvisible
   380 \endisadelimvisible
   381 %
   381 %
   382 \isatagvisible
   382 \isatagvisible
   383 \isacommand{interpretation}\isamarkupfalse%
   383 \isacommand{interpretation}\isamarkupfalse%
   384 \ nat{\isacharunderscore}dvd{\isacharbang}{\isacharcolon}\isanewline
   384 \ nat{\isacharunderscore}dvd{\isacharcolon}\isanewline
   385 \ \ distrib{\isacharunderscore}lattice\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   385 \ \ distrib{\isacharunderscore}lattice\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
   386 \ \ \isacommand{apply}\isamarkupfalse%
   386 \ \ \isacommand{apply}\isamarkupfalse%
   387 \ unfold{\isacharunderscore}locales%
   387 \ unfold{\isacharunderscore}locales%
   388 \begin{isamarkuptxt}%
   388 \begin{isamarkuptxt}%
   389 \begin{isabelle}%
   389 \begin{isabelle}%
   491   assumptions of the instances.  The conclusions of a sequence of
   491   assumptions of the instances.  The conclusions of a sequence of
   492   instances are obtained by appending the conclusions of the
   492   instances are obtained by appending the conclusions of the
   493   instances in the order of the sequence.
   493   instances in the order of the sequence.
   494 
   494 
   495   The qualifiers in the expression are already a familiar concept from
   495   The qualifiers in the expression are already a familiar concept from
   496   the \isakeyword{interpretation} command.  They serve to distinguish
   496   the \isakeyword{interpretation} command
   497   names (in particular theorem names) for the two partial orders
   497   (Section~\ref{sec:po-first}).  Here, they serve to distinguish names
   498   within the locale.  Qualifiers in the \isakeyword{locale} command
   498   (in particular theorem names) for the two partial orders within the
   499   default to optional.  Here are examples of theorems in locale \isa{order{\isacharunderscore}preserving}:%
   499   locale.  Qualifiers in the \isakeyword{locale} command (and in
       
   500   \isakeyword{sublocale}) default to optional --- that is, they need
       
   501   not occur in references to the qualified names.  Here are examples
       
   502   of theorems in locale \isa{order{\isacharunderscore}preserving}:%
   500 \end{isamarkuptext}%
   503 \end{isamarkuptext}%
   501 \isamarkuptrue%
   504 \isamarkuptrue%
   502 %
   505 %
   503 \isadeliminvisible
   506 \isadeliminvisible
   504 %
   507 %
   608 \isamarkuptrue%
   611 \isamarkuptrue%
   609 \ \ \isacommand{locale}\isamarkupfalse%
   612 \ \ \isacommand{locale}\isamarkupfalse%
   610 \ lattice{\isacharunderscore}end\ {\isacharequal}\ lattice{\isacharunderscore}hom\ {\isacharunderscore}\ le%
   613 \ lattice{\isacharunderscore}end\ {\isacharequal}\ lattice{\isacharunderscore}hom\ {\isacharunderscore}\ le%
   611 \begin{isamarkuptext}%
   614 \begin{isamarkuptext}%
   612 In this declaration, the first parameter of \isa{lattice{\isacharunderscore}hom}, \isa{le}, is untouched and then used to instantiate
   615 In this declaration, the first parameter of \isa{lattice{\isacharunderscore}hom}, \isa{le}, is untouched and then used to instantiate
   613   the second parameter.  Its concrete syntax is preseverd.%
   616   the second parameter.  Its concrete syntax is preserved.%
   614 \end{isamarkuptext}%
   617 \end{isamarkuptext}%
   615 \isamarkuptrue%
   618 \isamarkuptrue%
   616 %
   619 %
   617 \begin{isamarkuptext}%
   620 \begin{isamarkuptext}%
   618 The inheritance diagram of the situation we have now is shown
   621 The inheritance diagram of the situation we have now is shown