doc-src/Locales/Locales/document/Examples3.tex
author ballarin
Sat, 28 Mar 2009 00:11:02 +0100
changeset 30751 36a255c2e428
parent 30750 3779e2158dad
child 30780 c3f1e8a9e0b5
permissions -rw-r--r--
Corrections to locale syntax.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     1
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     2
\begin{isabellebody}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     3
\def\isabellecontext{Examples{\isadigit{3}}}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     4
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     5
\isadelimtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     6
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     7
\endisadelimtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     8
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
     9
\isatagtheory
27080
0ee385433247 updated generated file;
wenzelm
parents: 27079
diff changeset
    10
\isacommand{theory}\isamarkupfalse%
0ee385433247 updated generated file;
wenzelm
parents: 27079
diff changeset
    11
\ Examples{\isadigit{3}}\isanewline
0ee385433247 updated generated file;
wenzelm
parents: 27079
diff changeset
    12
\isakeyword{imports}\ Examples\isanewline
0ee385433247 updated generated file;
wenzelm
parents: 27079
diff changeset
    13
\isakeyword{begin}%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    14
\endisatagtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    15
{\isafoldtheory}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    16
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    17
\isadelimtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    18
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    19
\endisadelimtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    20
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    21
\isamarkupsubsection{Third Version: Local Interpretation%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    22
}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    23
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    24
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    25
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    26
In the above example, the fact that \isa{{\isasymle}} is a partial
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    27
  order for the natural numbers was used in the proof of the
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    28
  second goal.  In general, proofs of the equations may involve
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    29
  theorems implied by the fact the assumptions of the instantiated
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    30
  locale hold for the instantiating structure.  If these theorems have
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    31
  been shown abstractly in the locale they can be made available
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    32
  conveniently in the context through an auxiliary local interpretation (keyword
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    33
  \isakeyword{interpret}).  This interpretation is inside the proof of the global
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    34
  interpretation.  The third revision of the example illustrates this.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    35
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    36
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    37
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    38
\isadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    39
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    40
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    41
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    42
\isatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    43
\isacommand{interpretation}\isamarkupfalse%
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
    44
\ nat{\isacharbang}{\isacharcolon}\ partial{\isacharunderscore}order\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
    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
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    46
\isacommand{proof}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    47
\ {\isacharminus}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    48
\ \ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    49
\ {\isachardoublequoteopen}partial{\isacharunderscore}order\ {\isacharparenleft}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isacharparenright}{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    50
\ \ \ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    51
\ unfold{\isacharunderscore}locales\ auto\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    52
\ \ \isacommand{then}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    53
\ \isacommand{interpret}\isamarkupfalse%
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
    54
\ nat{\isacharcolon}\ partial{\isacharunderscore}order\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ {\isacharbrackleft}nat{\isacharcomma}\ nat{\isacharbrackright}\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\ \isacommand{{\isachardot}}\isamarkupfalse%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    55
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    56
\ \ \isacommand{show}\isamarkupfalse%
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
    57
\ {\isachardoublequoteopen}partial{\isacharunderscore}order{\isachardot}less\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ {\isacharparenleft}x\ {\isacharless}\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    58
\ \ \ \ \isacommand{unfolding}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    59
\ nat{\isachardot}less{\isacharunderscore}def\ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    60
\ auto\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    61
\isacommand{qed}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    62
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    63
\endisatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    64
{\isafoldvisible}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    65
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    66
\isadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    67
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    68
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    69
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    70
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    71
The inner interpretation does not require an
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    72
  elaborate new proof, it is immediate from the preceeding fact and
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
    73
  proved with ``.''.  Strict qualifiers are normally not necessary for
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
    74
  interpretations inside proofs, since these have only limited scope.
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
    75
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
    76
  The above interpretation enriches the local proof context by
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    77
  the very theorems also obtained in the interpretation from
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    78
  Section~\ref{sec:po-first}, and \isa{nat{\isachardot}less{\isacharunderscore}def} may directly be
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    79
  used to unfold the definition.  Theorems from the local
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    80
  interpretation disappear after leaving the proof context --- that
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    81
  is, after the closing \isakeyword{qed} --- and are
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    82
  then replaced by those with the desired substitutions of the strict
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    83
  order.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    84
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    85
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    86
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    87
\isamarkupsubsection{Further Interpretations%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    88
}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    89
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    90
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    91
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    92
Further interpretations are necessary to reuse theorems from
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    93
  the other locales.  In \isa{lattice} the operations \isa{{\isasymsqinter}} and
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
    94
  \isa{{\isasymsqunion}} are substituted by \isa{min} and
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
    95
  \isa{max}.  The entire proof for the
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    96
  interpretation is reproduced in order to give an example of a more
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    97
  elaborate interpretation proof.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    98
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
    99
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   100
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   101
\isadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   102
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   103
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   104
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   105
\isatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   106
\isacommand{interpretation}\isamarkupfalse%
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   107
\ nat{\isacharbang}{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   108
\ \ \isakeyword{where}\ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ min\ x\ y{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   109
\ \ \ \ \isakeyword{and}\ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ max\ x\ y{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   110
\isacommand{proof}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   111
\ {\isacharminus}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   112
\ \ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   113
\ {\isachardoublequoteopen}lattice\ {\isacharparenleft}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isacharparenright}{\isachardoublequoteclose}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   114
\begin{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   115
We have already shown that this is a partial order,%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   116
\end{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   117
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   118
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   119
\ unfold{\isacharunderscore}locales%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   120
\begin{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   121
hence only the lattice axioms remain to be shown: \begin{isabelle}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   122
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ y{\isachardot}\ {\isasymexists}inf{\isachardot}\ partial{\isacharunderscore}order{\isachardot}is{\isacharunderscore}inf\ op\ {\isasymle}\ x\ y\ inf\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   123
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}x\ y{\isachardot}\ {\isasymexists}sup{\isachardot}\ partial{\isacharunderscore}order{\isachardot}is{\isacharunderscore}sup\ op\ {\isasymle}\ x\ y\ sup%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   124
\end{isabelle}  After unfolding \isa{is{\isacharunderscore}inf} and \isa{is{\isacharunderscore}sup},%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   125
\end{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   126
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   127
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   128
\ {\isacharparenleft}unfold\ nat{\isachardot}is{\isacharunderscore}inf{\isacharunderscore}def\ nat{\isachardot}is{\isacharunderscore}sup{\isacharunderscore}def{\isacharparenright}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   129
\begin{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   130
the goals become \begin{isabelle}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   131
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ y{\isachardot}\ {\isasymexists}inf{\isasymle}x{\isachardot}\ inf\ {\isasymle}\ y\ {\isasymand}\ {\isacharparenleft}{\isasymforall}z{\isachardot}\ z\ {\isasymle}\ x\ {\isasymand}\ z\ {\isasymle}\ y\ {\isasymlongrightarrow}\ z\ {\isasymle}\ inf{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   132
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}x\ y{\isachardot}\ {\isasymexists}sup{\isasymge}x{\isachardot}\ y\ {\isasymle}\ sup\ {\isasymand}\ {\isacharparenleft}{\isasymforall}z{\isachardot}\ x\ {\isasymle}\ z\ {\isasymand}\ y\ {\isasymle}\ z\ {\isasymlongrightarrow}\ sup\ {\isasymle}\ z{\isacharparenright}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   133
\end{isabelle} which can be solved
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   134
      by Presburger arithmetic.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   135
\end{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   136
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   137
\ \ \ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   138
\ arith{\isacharplus}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   139
\begin{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   140
In order to show the equations, we put ourselves in a
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   141
    situation where the lattice theorems can be used in a convenient way.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   142
\end{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   143
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   144
\ \ \isacommand{then}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   145
\ \isacommand{interpret}\isamarkupfalse%
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   146
\ nat{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\ \isacommand{{\isachardot}}\isamarkupfalse%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   147
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   148
\ \ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   149
\ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ min\ x\ y{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   150
\ \ \ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   151
\ {\isacharparenleft}bestsimp\ simp{\isacharcolon}\ nat{\isachardot}meet{\isacharunderscore}def\ nat{\isachardot}is{\isacharunderscore}inf{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   152
\ \ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   153
\ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ {\isasymle}\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ max\ x\ y{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   154
\ \ \ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   155
\ {\isacharparenleft}bestsimp\ simp{\isacharcolon}\ nat{\isachardot}join{\isacharunderscore}def\ nat{\isachardot}is{\isacharunderscore}sup{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   156
\isacommand{qed}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   157
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   158
\endisatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   159
{\isafoldvisible}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   160
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   161
\isadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   162
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   163
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   164
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   165
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   166
That the relation \isa{{\isasymle}} is a total order completes this
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   167
  sequence of interpretations.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   168
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   169
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   170
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   171
\isadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   172
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   173
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   174
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   175
\isatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   176
\isacommand{interpretation}\isamarkupfalse%
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   177
\ nat{\isacharbang}{\isacharcolon}\ total{\isacharunderscore}order\ {\isachardoublequoteopen}op\ {\isasymle}\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   178
\ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   179
\ unfold{\isacharunderscore}locales\ arith%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   180
\endisatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   181
{\isafoldvisible}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   182
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   183
\isadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   184
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   185
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   186
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   187
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   188
Theorems that are available in the theory at this point are shown in
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   189
  Table~\ref{tab:nat-lattice}.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   190
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   191
\begin{table}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   192
\hrule
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   193
\vspace{2ex}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   194
\begin{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   195
\begin{tabular}{l}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   196
  \isa{nat{\isachardot}less{\isacharunderscore}def} from locale \isa{partial{\isacharunderscore}order}: \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   197
  \quad \isa{{\isacharparenleft}{\isacharquery}x\ {\isacharless}\ {\isacharquery}y{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}{\isacharquery}x\ {\isasymle}\ {\isacharquery}y\ {\isasymand}\ {\isacharquery}x\ {\isasymnoteq}\ {\isacharquery}y{\isacharparenright}} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   198
  \isa{nat{\isachardot}meet{\isacharunderscore}left} from locale \isa{lattice}: \\
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   199
  \quad \isa{min\ {\isacharquery}x\ {\isacharquery}y\ {\isasymle}\ {\isacharquery}x} \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   200
  \isa{nat{\isachardot}join{\isacharunderscore}distr} from locale \isa{distrib{\isacharunderscore}lattice}: \\
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   201
  \quad \isa{lattice{\isachardot}join\ op\ {\isasymle}\ {\isacharquery}x\ {\isacharparenleft}lattice{\isachardot}meet\ op\ {\isasymle}\ {\isacharquery}y\ {\isacharquery}z{\isacharparenright}\ {\isacharequal}\ lattice{\isachardot}meet\ op\ {\isasymle}\ {\isacharparenleft}lattice{\isachardot}join\ op\ {\isasymle}\ {\isacharquery}x\ {\isacharquery}y{\isacharparenright}\ {\isacharparenleft}lattice{\isachardot}join\ op\ {\isasymle}\ {\isacharquery}x\ {\isacharquery}z{\isacharparenright}} \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   202
  \isa{nat{\isachardot}less{\isacharunderscore}total} from locale \isa{total{\isacharunderscore}order}: \\
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   203
  \quad \isa{partial{\isacharunderscore}order{\isachardot}less\ op\ {\isasymle}\ {\isacharquery}x\ {\isacharquery}y\ {\isasymor}\ {\isacharquery}x\ {\isacharequal}\ {\isacharquery}y\ {\isasymor}\ partial{\isacharunderscore}order{\isachardot}less\ op\ {\isasymle}\ {\isacharquery}y\ {\isacharquery}x}
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   204
\end{tabular}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   205
\end{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   206
\hrule
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   207
\caption{Interpreted theorems for \isa{{\isasymle}} on the natural numbers.}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   208
\label{tab:nat-lattice}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   209
\end{table}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   210
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   211
  Note that since the locale hierarchy reflects that total orders are
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   212
  distributive lattices, an explicit interpretation of distributive
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   213
  lattices for the order relation on natural numbers is not neccessary.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   214
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   215
  Why not push this idea further and just give the last interpretation
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   216
  as a single interpretation instead of the sequence of three?  The
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   217
  reasons for this are twofold:
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   218
\begin{itemize}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   219
\item
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   220
  Often it is easier to work in an incremental fashion, because later
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   221
  interpretations require theorems provided by earlier
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   222
  interpretations.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   223
\item
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   224
  Assume that a definition is made in some locale $l_1$, and that $l_2$
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   225
  imports $l_1$.  Let an equation for the definition be
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   226
  proved in an interpretation of $l_2$.  The equation will be unfolded
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   227
  in interpretations of theorems added to $l_2$ or below in the import
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   228
  hierarchy, but not for theorems added above $l_2$.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   229
  Hence, an equation interpreting a definition should always be given in
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   230
  an interpretation of the locale where the definition is made, not in
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   231
  an interpretation of a locale further down the hierarchy.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   232
\end{itemize}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   233
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   234
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   235
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   236
\isamarkupsubsection{Lattice \isa{dvd} on \isa{nat}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   237
}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   238
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   239
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   240
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   241
Divisibility on the natural numbers is a distributive lattice
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   242
  but not a total order.  Interpretation again proceeds
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   243
  incrementally.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   244
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   245
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   246
\isacommand{interpretation}\isamarkupfalse%
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   247
\ nat{\isacharunderscore}dvd{\isacharcolon}\ partial{\isacharunderscore}order\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   248
\ \ \isakeyword{where}\ {\isachardoublequoteopen}partial{\isacharunderscore}order{\isachardot}less\ op\ dvd\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ {\isacharparenleft}x\ dvd\ y\ {\isasymand}\ x\ {\isasymnoteq}\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   249
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   250
\isadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   251
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   252
\endisadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   253
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   254
\isatagproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   255
\isacommand{proof}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   256
\ {\isacharminus}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   257
\ \ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   258
\ {\isachardoublequoteopen}partial{\isacharunderscore}order\ {\isacharparenleft}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isacharparenright}{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   259
\ \ \ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   260
\ unfold{\isacharunderscore}locales\ {\isacharparenleft}auto\ simp{\isacharcolon}\ dvd{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   261
\ \ \isacommand{then}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   262
\ \isacommand{interpret}\isamarkupfalse%
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   263
\ nat{\isacharunderscore}dvd{\isacharcolon}\ partial{\isacharunderscore}order\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\ \isacommand{{\isachardot}}\isamarkupfalse%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   264
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   265
\ \ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   266
\ {\isachardoublequoteopen}partial{\isacharunderscore}order{\isachardot}less\ op\ dvd\ {\isacharparenleft}x{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ y\ {\isacharequal}\ {\isacharparenleft}x\ dvd\ y\ {\isasymand}\ x\ {\isasymnoteq}\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   267
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   268
\ {\isacharparenleft}unfold\ nat{\isacharunderscore}dvd{\isachardot}less{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   269
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   270
\ auto\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   271
\ \ \ \ \isacommand{done}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   272
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   273
\isacommand{qed}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   274
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   275
\endisatagproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   276
{\isafoldproof}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   277
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   278
\isadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   279
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   280
\endisadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   281
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   282
\begin{isamarkuptext}%
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   283
Note that in Isabelle/HOL there is no symbol for strict
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   284
  divisibility.  Instead, interpretation substitutes \isa{x\ dvd\ y\ {\isasymand}\ x\ {\isasymnoteq}\ y}.%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   285
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   286
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   287
\isacommand{interpretation}\isamarkupfalse%
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   288
\ nat{\isacharunderscore}dvd{\isacharbang}{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   289
\ \ \isakeyword{where}\ nat{\isacharunderscore}dvd{\isacharunderscore}meet{\isacharunderscore}eq{\isacharcolon}\isanewline
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   290
\ \ \ \ \ \ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ dvd\ {\isacharequal}\ gcd{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   291
\ \ \ \ \isakeyword{and}\ nat{\isacharunderscore}dvd{\isacharunderscore}join{\isacharunderscore}eq{\isacharcolon}\isanewline
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   292
\ \ \ \ \ \ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ dvd\ {\isacharequal}\ lcm{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   293
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   294
\isadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   295
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   296
\endisadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   297
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   298
\isatagproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   299
\isacommand{proof}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   300
\ {\isacharminus}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   301
\ \ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   302
\ {\isachardoublequoteopen}lattice\ {\isacharparenleft}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isacharparenright}{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   303
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   304
\ unfold{\isacharunderscore}locales\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   305
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   306
\ {\isacharparenleft}unfold\ nat{\isacharunderscore}dvd{\isachardot}is{\isacharunderscore}inf{\isacharunderscore}def\ nat{\isacharunderscore}dvd{\isachardot}is{\isacharunderscore}sup{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   307
\ \ \ \ \isacommand{apply}\isamarkupfalse%
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   308
\ {\isacharparenleft}rule{\isacharunderscore}tac\ x\ {\isacharequal}\ {\isachardoublequoteopen}gcd\ x\ y{\isachardoublequoteclose}\ \isakeyword{in}\ exI{\isacharparenright}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   309
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   310
\ auto\ {\isacharbrackleft}{\isadigit{1}}{\isacharbrackright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   311
\ \ \ \ \isacommand{apply}\isamarkupfalse%
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   312
\ {\isacharparenleft}rule{\isacharunderscore}tac\ x\ {\isacharequal}\ {\isachardoublequoteopen}lcm\ x\ y{\isachardoublequoteclose}\ \isakeyword{in}\ exI{\isacharparenright}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   313
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   314
\ {\isacharparenleft}auto\ intro{\isacharcolon}\ lcm{\isacharunderscore}dvd{\isadigit{1}}\ lcm{\isacharunderscore}dvd{\isadigit{2}}\ lcm{\isacharunderscore}least{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   315
\ \ \ \ \isacommand{done}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   316
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   317
\ \ \isacommand{then}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   318
\ \isacommand{interpret}\isamarkupfalse%
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   319
\ nat{\isacharunderscore}dvd{\isacharcolon}\ lattice\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\ \isacommand{{\isachardot}}\isamarkupfalse%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   320
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   321
\ \ \isacommand{show}\isamarkupfalse%
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   322
\ {\isachardoublequoteopen}lattice{\isachardot}meet\ op\ dvd\ {\isacharequal}\ gcd{\isachardoublequoteclose}\isanewline
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   323
\ \ \ \ \isacommand{apply}\isamarkupfalse%
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   324
\ {\isacharparenleft}auto\ simp\ add{\isacharcolon}\ expand{\isacharunderscore}fun{\isacharunderscore}eq{\isacharparenright}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   325
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   326
\ {\isacharparenleft}unfold\ nat{\isacharunderscore}dvd{\isachardot}meet{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   327
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   328
\ {\isacharparenleft}rule\ the{\isacharunderscore}equality{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   329
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   330
\ {\isacharparenleft}unfold\ nat{\isacharunderscore}dvd{\isachardot}is{\isacharunderscore}inf{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   331
\ \ \ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   332
\ auto\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   333
\ \ \isacommand{show}\isamarkupfalse%
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   334
\ {\isachardoublequoteopen}lattice{\isachardot}join\ op\ dvd\ {\isacharequal}\ lcm{\isachardoublequoteclose}\isanewline
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   335
\ \ \ \ \isacommand{apply}\isamarkupfalse%
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   336
\ {\isacharparenleft}auto\ simp\ add{\isacharcolon}\ expand{\isacharunderscore}fun{\isacharunderscore}eq{\isacharparenright}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   337
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   338
\ {\isacharparenleft}unfold\ nat{\isacharunderscore}dvd{\isachardot}join{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   339
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   340
\ {\isacharparenleft}rule\ the{\isacharunderscore}equality{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   341
\ \ \ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   342
\ {\isacharparenleft}unfold\ nat{\isacharunderscore}dvd{\isachardot}is{\isacharunderscore}sup{\isacharunderscore}def{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   343
\ \ \ \ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   344
\ {\isacharparenleft}auto\ intro{\isacharcolon}\ lcm{\isacharunderscore}dvd{\isadigit{1}}\ lcm{\isacharunderscore}dvd{\isadigit{2}}\ lcm{\isacharunderscore}least{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   345
\isacommand{qed}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   346
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   347
\endisatagproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   348
{\isafoldproof}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   349
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   350
\isadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   351
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   352
\endisadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   353
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   354
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   355
Equations \isa{nat{\isacharunderscore}dvd{\isacharunderscore}meet{\isacharunderscore}eq} and \isa{nat{\isacharunderscore}dvd{\isacharunderscore}join{\isacharunderscore}eq} are named since they are handy in the proof of
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   356
  the subsequent interpretation.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   357
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   358
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   359
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   360
\isadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   361
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   362
\endisadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   363
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   364
\isataginvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   365
\isacommand{lemma}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   366
\ gcd{\isacharunderscore}lcm{\isacharunderscore}distr{\isacharcolon}\isanewline
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   367
\ \ {\isachardoublequoteopen}gcd\ x\ {\isacharparenleft}lcm\ y\ z{\isacharparenright}\ {\isacharequal}\ lcm\ {\isacharparenleft}gcd\ x\ y{\isacharparenright}\ {\isacharparenleft}gcd\ x\ z{\isacharparenright}{\isachardoublequoteclose}\ \isacommand{sorry}\isamarkupfalse%
29568
ba144750086d more robust handling of quick_and_dirty;
wenzelm
parents: 29567
diff changeset
   368
%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   369
\endisataginvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   370
{\isafoldinvisible}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   371
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   372
\isadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   373
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   374
\endisadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   375
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   376
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   377
\isadelimvisible
29568
ba144750086d more robust handling of quick_and_dirty;
wenzelm
parents: 29567
diff changeset
   378
\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   379
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   380
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   381
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   382
\isatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   383
\isacommand{interpretation}\isamarkupfalse%
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   384
\ nat{\isacharunderscore}dvd{\isacharbang}{\isacharcolon}\isanewline
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   385
\ \ distrib{\isacharunderscore}lattice\ {\isachardoublequoteopen}op\ dvd\ {\isacharcolon}{\isacharcolon}\ nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   386
\ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   387
\ unfold{\isacharunderscore}locales%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   388
\begin{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   389
\begin{isabelle}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   390
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ y\ z{\isachardot}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   391
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }lattice{\isachardot}meet\ op\ dvd\ x\ {\isacharparenleft}lattice{\isachardot}join\ op\ dvd\ y\ z{\isacharparenright}\ {\isacharequal}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   392
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ }lattice{\isachardot}join\ op\ dvd\ {\isacharparenleft}lattice{\isachardot}meet\ op\ dvd\ x\ y{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   393
\isaindent{\ {\isadigit{1}}{\isachardot}\ \ \ \ \ }{\isacharparenleft}lattice{\isachardot}meet\ op\ dvd\ x\ z{\isacharparenright}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   394
\end{isabelle}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   395
\end{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   396
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   397
\ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   398
\ {\isacharparenleft}unfold\ nat{\isacharunderscore}dvd{\isacharunderscore}meet{\isacharunderscore}eq\ nat{\isacharunderscore}dvd{\isacharunderscore}join{\isacharunderscore}eq{\isacharparenright}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   399
\begin{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   400
\begin{isabelle}%
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   401
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ y\ z{\isachardot}\ gcd\ x\ {\isacharparenleft}lcm\ y\ z{\isacharparenright}\ {\isacharequal}\ lcm\ {\isacharparenleft}gcd\ x\ y{\isacharparenright}\ {\isacharparenleft}gcd\ x\ z{\isacharparenright}%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   402
\end{isabelle}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   403
\end{isamarkuptxt}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   404
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   405
\ \ \isacommand{apply}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   406
\ {\isacharparenleft}rule\ gcd{\isacharunderscore}lcm{\isacharunderscore}distr{\isacharparenright}\ \isacommand{done}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   407
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   408
\endisatagvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   409
{\isafoldvisible}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   410
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   411
\isadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   412
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   413
\endisadelimvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   414
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   415
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   416
Theorems that are available in the theory after these
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   417
  interpretations are shown in Table~\ref{tab:nat-dvd-lattice}.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   418
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   419
\begin{table}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   420
\hrule
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   421
\vspace{2ex}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   422
\begin{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   423
\begin{tabular}{l}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   424
  \isa{nat{\isacharunderscore}dvd{\isachardot}less{\isacharunderscore}def} from locale \isa{partial{\isacharunderscore}order}: \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   425
  \quad \isa{{\isacharparenleft}{\isacharquery}x\ dvd\ {\isacharquery}y\ {\isasymand}\ {\isacharquery}x\ {\isasymnoteq}\ {\isacharquery}y{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}{\isacharquery}x\ dvd\ {\isacharquery}y\ {\isasymand}\ {\isacharquery}x\ {\isasymnoteq}\ {\isacharquery}y{\isacharparenright}} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   426
  \isa{nat{\isacharunderscore}dvd{\isachardot}meet{\isacharunderscore}left} from locale \isa{lattice}: \\
27595
3ac9e3cd1fa3 curried gcd
haftmann
parents: 27506
diff changeset
   427
  \quad \isa{gcd\ {\isacharquery}x\ {\isacharquery}y\ dvd\ {\isacharquery}x} \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   428
  \isa{nat{\isacharunderscore}dvd{\isachardot}join{\isacharunderscore}distr} from locale \isa{distrib{\isacharunderscore}lattice}: \\
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   429
  \quad \isa{lattice{\isachardot}join\ op\ dvd\ {\isacharquery}x\ {\isacharparenleft}lattice{\isachardot}meet\ op\ dvd\ {\isacharquery}y\ {\isacharquery}z{\isacharparenright}\ {\isacharequal}\ lattice{\isachardot}meet\ op\ dvd\ {\isacharparenleft}lattice{\isachardot}join\ op\ dvd\ {\isacharquery}x\ {\isacharquery}y{\isacharparenright}\ {\isacharparenleft}lattice{\isachardot}join\ op\ dvd\ {\isacharquery}x\ {\isacharquery}z{\isacharparenright}} \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   430
\end{tabular}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   431
\end{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   432
\hrule
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   433
\caption{Interpreted theorems for \isa{dvd} on the natural numbers.}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   434
\label{tab:nat-dvd-lattice}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   435
\end{table}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   436
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   437
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   438
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   439
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   440
The full syntax of the interpretation commands is shown in
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   441
  Table~\ref{tab:commands}.  The grammar refers to
30580
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   442
  \textit{expression}, which stands for a \emph{locale} expression.
cc5a55d7a5be Updated chapters 1-5 to locale reimplementation.
ballarin
parents: 30393
diff changeset
   443
  Locale expressions are discussed in the following section.%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   444
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   445
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   446
%
27079
61ac01ff0aa9 updated generated file;
wenzelm
parents: 27075
diff changeset
   447
\isamarkupsection{Locale Expressions \label{sec:expressions}%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   448
}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   449
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   450
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   451
\begin{isamarkuptext}%
27079
61ac01ff0aa9 updated generated file;
wenzelm
parents: 27075
diff changeset
   452
A map \isa{{\isasymphi}} between partial orders \isa{{\isasymsqsubseteq}} and \isa{{\isasympreceq}}
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   453
  is called order preserving if \isa{x\ {\isasymsqsubseteq}\ y} implies \isa{{\isasymphi}\ x\ {\isasympreceq}\ {\isasymphi}\ y}.  This situation is more complex than those encountered so
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   454
  far: it involves two partial orders, and it is desirable to use the
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   455
  existing locale for both.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   456
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   457
  Inspecting the grammar of locale commands in
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   458
  Table~\ref{tab:commands} reveals that the import of a locale can be
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   459
  more than just a single locale.  In general, the import is a
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   460
  \emph{locale expression}.  These enable to combine locales
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   461
  and instantiate parameters.  A locale expression is a sequence of
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   462
  locale \emph{instances} followed by an optional \isakeyword{for}
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   463
  clause.  Each instance consists of a locale reference, which may be
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   464
  preceded by a qualifer and succeeded by instantiations of the
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   465
  parameters of that locale.  Instantiations may be either positional
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   466
  or through explicit parameter argument pairs.
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   467
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   468
  Using a locale expression, a locale for order
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   469
  preserving maps can be declared in the following way.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   470
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   471
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   472
\ \ \isacommand{locale}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   473
\ order{\isacharunderscore}preserving\ {\isacharequal}\isanewline
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   474
\ \ \ \ le{\isacharcolon}\ partial{\isacharunderscore}order\ le\ {\isacharplus}\ le{\isacharprime}{\isacharcolon}\ partial{\isacharunderscore}order\ le{\isacharprime}\isanewline
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   475
\ \ \ \ \ \ \isakeyword{for}\ le\ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequoteopen}{\isasymsqsubseteq}{\isachardoublequoteclose}\ {\isadigit{5}}{\isadigit{0}}{\isacharparenright}\ \isakeyword{and}\ le{\isacharprime}\ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequoteopen}{\isasympreceq}{\isachardoublequoteclose}\ {\isadigit{5}}{\isadigit{0}}{\isacharparenright}\ {\isacharplus}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   476
\ \ \ \ \isakeyword{fixes}\ {\isasymphi}\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}b{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   477
\ \ \ \ \isakeyword{assumes}\ hom{\isacharunderscore}le{\isacharcolon}\ {\isachardoublequoteopen}x\ {\isasymsqsubseteq}\ y\ {\isasymLongrightarrow}\ {\isasymphi}\ x\ {\isasympreceq}\ {\isasymphi}\ y{\isachardoublequoteclose}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   478
\begin{isamarkuptext}%
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   479
The second and third line contain the expression --- two
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   480
  instances of the partial order locale with instantiations \isa{le}
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   481
  and \isa{le{\isacharprime}}, respectively.  The \isakeyword{for} clause consists
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   482
  of parameter declarations and is similar to the context element
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   483
  \isakeyword{fixes}.  The notable difference is that the
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   484
  \isakeyword{for} clause is part of the expression, and only
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   485
  parameters defined in the expression may occur in its instances.
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   486
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   487
  Instances are \emph{morphisms} on locales.  Their effect on the
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   488
  parameters is naturally lifted to terms, propositions and theorems,
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   489
  and thus to the assumptions and conclusions of a locale.  The
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   490
  assumption of a locale expression is the conjunction of the
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   491
  assumptions of the instances.  The conclusions of a sequence of
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   492
  instances are obtained by appending the conclusions of the
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   493
  instances in the order of the sequence.
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   494
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   495
  The qualifiers in the expression are already a familiar concept from
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   496
  the \isakeyword{interpretation} command.  They serve to distinguish
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   497
  names (in particular theorem names) for the two partial orders
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   498
  within the locale.  Qualifiers in the \isakeyword{locale} command
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   499
  default to optional.  Here are examples of theorems in locale \isa{order{\isacharunderscore}preserving}:%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   500
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   501
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   502
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   503
\isadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   504
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   505
\endisadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   506
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   507
\isataginvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   508
\isacommand{context}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   509
\ order{\isacharunderscore}preserving\ \isakeyword{begin}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   510
\endisataginvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   511
{\isafoldinvisible}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   512
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   513
\isadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   514
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   515
\endisadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   516
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   517
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   518
\isa{le{\isachardot}less{\isacharunderscore}le{\isacharunderscore}trans}: \isa{{\isasymlbrakk}{\isacharquery}x\ {\isasymsqsubset}\ {\isacharquery}y{\isacharsemicolon}\ {\isacharquery}y\ {\isasymsqsubseteq}\ {\isacharquery}z{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}x\ {\isasymsqsubset}\ {\isacharquery}z}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   519
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   520
  \isa{hom{\isacharunderscore}le}: \isa{{\isacharquery}x\ {\isasymsqsubseteq}\ {\isacharquery}y\ {\isasymLongrightarrow}\ {\isasymphi}\ {\isacharquery}x\ {\isasympreceq}\ {\isasymphi}\ {\isacharquery}y}%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   521
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   522
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   523
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   524
\begin{isamarkuptext}%
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   525
The theorems for the partial order \isa{{\isasympreceq}}
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   526
  are qualified by \isa{le{\isacharprime}}.  For example, \isa{le{\isacharprime}{\isachardot}less{\isacharunderscore}le{\isacharunderscore}trans}: \begin{isabelle}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   527
\ \ {\isasymlbrakk}partial{\isacharunderscore}order{\isachardot}less\ op\ {\isasympreceq}\ {\isacharquery}x\ {\isacharquery}y{\isacharsemicolon}\ {\isacharquery}y\ {\isasympreceq}\ {\isacharquery}z{\isasymrbrakk}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   528
\isaindent{\ \ }{\isasymLongrightarrow}\ partial{\isacharunderscore}order{\isachardot}less\ op\ {\isasympreceq}\ {\isacharquery}x\ {\isacharquery}z%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   529
\end{isabelle}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   530
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   531
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   532
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   533
\isadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   534
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   535
\endisadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   536
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   537
\isataginvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   538
\isacommand{end}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   539
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   540
\endisataginvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   541
{\isafoldinvisible}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   542
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   543
\isadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   544
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   545
\endisadeliminvisible
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   546
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   547
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   548
This example reveals that there is no infix syntax for the strict
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   549
  version of \isa{{\isasympreceq}}!  This can be declared through an abbreviation.%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   550
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   551
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   552
\ \ \isacommand{abbreviation}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   553
\ {\isacharparenleft}\isakeyword{in}\ order{\isacharunderscore}preserving{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   554
\ \ \ \ less{\isacharprime}\ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequoteopen}{\isasymprec}{\isachardoublequoteclose}\ {\isadigit{5}}{\isadigit{0}}{\isacharparenright}\ \isakeyword{where}\ {\isachardoublequoteopen}less{\isacharprime}\ {\isasymequiv}\ partial{\isacharunderscore}order{\isachardot}less\ le{\isacharprime}{\isachardoublequoteclose}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   555
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   556
Now the theorem is displayed nicely as
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   557
  \isa{{\isasymlbrakk}{\isacharquery}x\ {\isasymprec}\ {\isacharquery}y{\isacharsemicolon}\ {\isacharquery}y\ {\isasympreceq}\ {\isacharquery}z{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}x\ {\isasymprec}\ {\isacharquery}z}.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   558
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   559
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   560
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   561
\begin{isamarkuptext}%
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   562
Qualifiers not only apply to theorem names, but also to names
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   563
  introduced by definitions and abbreviations.  In locale
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   564
  \isa{partial{\isacharunderscore}order} the full name of the strict order of \isa{{\isasymsqsubseteq}} is
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   565
  \isa{le{\isachardot}less} and therefore \isa{le{\isacharprime}{\isachardot}less} is the full name of
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   566
  the strict order of \isa{{\isasympreceq}}.  Hence, the equation in the
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   567
  abbreviation above could have been also written as \isa{less{\isacharprime}\ {\isasymequiv}\ le{\isacharprime}{\isachardot}less}.%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   568
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   569
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   570
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   571
\begin{isamarkuptext}%
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   572
Readers may find the declaration of locale \isa{order{\isacharunderscore}preserving} a little awkward, because the declaration and
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   573
  concrete syntax for \isa{le} from \isa{partial{\isacharunderscore}order} are
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   574
  repeated in the declaration of \isa{order{\isacharunderscore}preserving}.  Locale
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   575
  expressions provide a convenient short hand for this.  A parameter
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   576
  in an instance is \emph{untouched} if no instantiation term is
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   577
  provided for it.  In positional instantiations, a parameter position
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   578
  may be skipped with an underscore, and it is allowed to give fewer
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   579
  instantiation terms than the instantiated locale's number of
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   580
  parameters.  In named instantiations, instantiation pairs for
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   581
  certain parameters may simply be omitted.  Untouched parameters are
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   582
  declared by the locale expression and with their concrete syntax by
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   583
  implicitly adding them to the beginning of the \isakeyword{for}
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   584
  clause.
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   585
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   586
  The following locales illustrate this.  A map \isa{{\isasymphi}} is a
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   587
  lattice homomorphism if it preserves meet and join.%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   588
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   589
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   590
\ \ \isacommand{locale}\isamarkupfalse%
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   591
\ lattice{\isacharunderscore}hom\ {\isacharequal}\isanewline
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   592
\ \ \ \ le{\isacharcolon}\ lattice\ {\isacharplus}\ le{\isacharprime}{\isacharcolon}\ lattice\ le{\isacharprime}\ \isakeyword{for}\ le{\isacharprime}\ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequoteopen}{\isasympreceq}{\isachardoublequoteclose}\ {\isadigit{5}}{\isadigit{0}}{\isacharparenright}\ {\isacharplus}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   593
\ \ \ \ \isakeyword{fixes}\ {\isasymphi}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   594
\ \ \ \ \isakeyword{assumes}\ hom{\isacharunderscore}meet{\isacharcolon}\isanewline
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   595
\ \ \ \ \ \ \ \ {\isachardoublequoteopen}{\isasymphi}\ {\isacharparenleft}x\ {\isasymsqinter}\ y{\isacharparenright}\ {\isacharequal}\ le{\isacharprime}{\isachardot}meet\ {\isacharparenleft}{\isasymphi}\ x{\isacharparenright}\ {\isacharparenleft}{\isasymphi}\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   596
\ \ \ \ \ \ \isakeyword{and}\ hom{\isacharunderscore}join{\isacharcolon}\isanewline
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   597
\ \ \ \ \ \ \ \ {\isachardoublequoteopen}{\isasymphi}\ {\isacharparenleft}x\ {\isasymsqunion}\ y{\isacharparenright}\ {\isacharequal}\ le{\isacharprime}{\isachardot}join\ {\isacharparenleft}{\isasymphi}\ x{\isacharparenright}\ {\isacharparenleft}{\isasymphi}\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   598
\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   599
\ \ \isacommand{abbreviation}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   600
\ {\isacharparenleft}\isakeyword{in}\ lattice{\isacharunderscore}hom{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   601
\ \ \ \ meet{\isacharprime}\ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequoteopen}{\isasymsqinter}{\isacharprime}{\isacharprime}{\isachardoublequoteclose}\ {\isadigit{5}}{\isadigit{0}}{\isacharparenright}\ \isakeyword{where}\ {\isachardoublequoteopen}meet{\isacharprime}\ {\isasymequiv}\ le{\isacharprime}{\isachardot}meet{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   602
\ \ \isacommand{abbreviation}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   603
\ {\isacharparenleft}\isakeyword{in}\ lattice{\isacharunderscore}hom{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   604
\ \ \ \ join{\isacharprime}\ {\isacharparenleft}\isakeyword{infixl}\ {\isachardoublequoteopen}{\isasymsqunion}{\isacharprime}{\isacharprime}{\isachardoublequoteclose}\ {\isadigit{5}}{\isadigit{0}}{\isacharparenright}\ \isakeyword{where}\ {\isachardoublequoteopen}join{\isacharprime}\ {\isasymequiv}\ le{\isacharprime}{\isachardot}join{\isachardoublequoteclose}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   605
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   606
A homomorphism is an endomorphism if both orders coincide.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   607
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   608
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   609
\ \ \isacommand{locale}\isamarkupfalse%
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   610
\ lattice{\isacharunderscore}end\ {\isacharequal}\ lattice{\isacharunderscore}hom\ {\isacharunderscore}\ le%
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   611
\begin{isamarkuptext}%
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   612
In this declaration, the first parameter of \isa{lattice{\isacharunderscore}hom}, \isa{le}, is untouched and then used to instantiate
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   613
  the second parameter.  Its concrete syntax is preseverd.%
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   614
\end{isamarkuptext}%
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   615
\isamarkuptrue%
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   616
%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   617
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   618
The inheritance diagram of the situation we have now is shown
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   619
  in Figure~\ref{fig:hom}, where the dashed line depicts an
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   620
  interpretation which is introduced below.  Renamings are
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   621
  indicated by $\sqsubseteq \mapsto \preceq$ etc.  The expression
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   622
  imported by \isa{lattice{\isacharunderscore}end} identifies the first and second
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   623
  parameter of \isa{lattice{\isacharunderscore}hom}.  By looking at the inheritance diagram it would seem
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   624
  that two identical copies of each of the locales \isa{partial{\isacharunderscore}order} and \isa{lattice} are imported.  This is not the
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   625
  case!  Inheritance paths with identical morphisms are detected and
27506
c99c72458ec5 updated generated file;
wenzelm
parents: 27080
diff changeset
   626
  the conclusions of the respective locales appear only once.
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   627
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   628
\begin{figure}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   629
\hrule \vspace{2ex}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   630
\begin{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   631
\begin{tikzpicture}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   632
  \node (o) at (0,0) {\isa{partial{\isacharunderscore}order}};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   633
  \node (oh) at (1.5,-2) {\isa{order{\isacharunderscore}preserving}};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   634
  \node (oh1) at (1.5,-0.7) {$\scriptscriptstyle \sqsubseteq \mapsto \sqsubseteq$};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   635
  \node (oh2) at (0,-1.3) {$\scriptscriptstyle \sqsubseteq \mapsto \preceq$};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   636
  \node (l) at (-1.5,-2) {\isa{lattice}};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   637
  \node (lh) at (0,-4) {\isa{lattice{\isacharunderscore}hom}};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   638
  \node (lh1) at (0,-2.7) {$\scriptscriptstyle \sqsubseteq \mapsto \sqsubseteq$};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   639
  \node (lh2) at (-1.5,-3.3) {$\scriptscriptstyle \sqsubseteq \mapsto \preceq$};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   640
  \node (le) at (0,-6) {\isa{lattice{\isacharunderscore}end}};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   641
  \node (le1) at (0,-4.8)
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   642
    [anchor=west]{$\scriptscriptstyle \sqsubseteq \mapsto \sqsubseteq$};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   643
  \node (le2) at (0,-5.2)
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   644
    [anchor=west]{$\scriptscriptstyle \preceq \mapsto \sqsubseteq$};
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   645
  \draw (o) -- (l);
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   646
  \draw[dashed] (oh) -- (lh);
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   647
  \draw (lh) -- (le);
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   648
  \draw (o) .. controls (oh1.south west) .. (oh);
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   649
  \draw (o) .. controls (oh2.north east) .. (oh);
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   650
  \draw (l) .. controls (lh1.south west) .. (lh);
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   651
  \draw (l) .. controls (lh2.north east) .. (lh);
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   652
\end{tikzpicture}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   653
\end{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   654
\hrule
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   655
\caption{Hierarchy of Homomorphism Locales.}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   656
\label{fig:hom}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   657
\end{figure}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   658
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   659
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   660
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   661
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   662
It can be shown easily that a lattice homomorphism is order
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   663
  preserving.  As the final example of this section, a locale
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   664
  interpretation is used to assert this:%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   665
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   666
\isamarkuptrue%
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   667
\ \ \isacommand{sublocale}\isamarkupfalse%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   668
\ lattice{\isacharunderscore}hom\ {\isasymsubseteq}\ order{\isacharunderscore}preserving%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   669
\isadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   670
\ %
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   671
\endisadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   672
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   673
\isatagproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   674
\isacommand{proof}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   675
\ unfold{\isacharunderscore}locales\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   676
\ \ \ \ \isacommand{fix}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   677
\ x\ y\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   678
\ \ \ \ \isacommand{assume}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   679
\ {\isachardoublequoteopen}x\ {\isasymsqsubseteq}\ y{\isachardoublequoteclose}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   680
\ \ \ \ \isacommand{then}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   681
\ \isacommand{have}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   682
\ {\isachardoublequoteopen}y\ {\isacharequal}\ {\isacharparenleft}x\ {\isasymsqunion}\ y{\isacharparenright}{\isachardoublequoteclose}\ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   683
\ {\isacharparenleft}simp\ add{\isacharcolon}\ le{\isachardot}join{\isacharunderscore}connection{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   684
\ \ \ \ \isacommand{then}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   685
\ \isacommand{have}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   686
\ {\isachardoublequoteopen}{\isasymphi}\ y\ {\isacharequal}\ {\isacharparenleft}{\isasymphi}\ x\ {\isasymsqunion}{\isacharprime}\ {\isasymphi}\ y{\isacharparenright}{\isachardoublequoteclose}\ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   687
\ {\isacharparenleft}simp\ add{\isacharcolon}\ hom{\isacharunderscore}join\ {\isacharbrackleft}symmetric{\isacharbrackright}{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   688
\ \ \ \ \isacommand{then}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   689
\ \isacommand{show}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   690
\ {\isachardoublequoteopen}{\isasymphi}\ x\ {\isasympreceq}\ {\isasymphi}\ y{\isachardoublequoteclose}\ \isacommand{by}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   691
\ {\isacharparenleft}simp\ add{\isacharcolon}\ le{\isacharprime}{\isachardot}join{\isacharunderscore}connection{\isacharparenright}\isanewline
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   692
\ \ \isacommand{qed}\isamarkupfalse%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   693
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   694
\endisatagproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   695
{\isafoldproof}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   696
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   697
\isadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   698
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   699
\endisadelimproof
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   700
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   701
\begin{isamarkuptext}%
30393
aa6f42252bf6 replaced old locale option by proper "text (in locale)";
wenzelm
parents: 29568
diff changeset
   702
Theorems and other declarations --- syntax, in particular --- from
aa6f42252bf6 replaced old locale option by proper "text (in locale)";
wenzelm
parents: 29568
diff changeset
   703
  the locale \isa{order{\isacharunderscore}preserving} are now active in \isa{lattice{\isacharunderscore}hom}, for example
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   704
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   705
  \isa{le{\isacharprime}{\isachardot}less{\isacharunderscore}le{\isacharunderscore}trans}:
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   706
  \isa{{\isasymlbrakk}{\isacharquery}x\ {\isasymprec}\ {\isacharquery}y{\isacharsemicolon}\ {\isacharquery}y\ {\isasympreceq}\ {\isacharquery}z{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}x\ {\isasymprec}\ {\isacharquery}z}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   707
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   708
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   709
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   710
\isamarkupsection{Further Reading%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   711
}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   712
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   713
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   714
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   715
More information on locales and their interpretation is
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   716
  available.  For the locale hierarchy of import and interpretation
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   717
  dependencies see \cite{Ballarin2006a}; interpretations in theories
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   718
  and proofs are covered in \cite{Ballarin2006b}.  In the latter, we
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   719
  show how interpretation in proofs enables to reason about families
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   720
  of algebraic structures, which cannot be expressed with locales
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   721
  directly.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   722
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   723
  Haftmann and Wenzel \cite{HaftmannWenzel2007} overcome a restriction
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   724
  of axiomatic type classes through a combination with locale
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   725
  interpretation.  The result is a Haskell-style class system with a
30750
3779e2158dad Update explanation of locale expressions to locale reimplementation.
ballarin
parents: 30580
diff changeset
   726
  facility to generate ML and Haskell code.  Classes are sufficient for
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   727
  simple specifications with a single type parameter.  The locales for
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   728
  orders and lattices presented in this tutorial fall into this
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   729
  category.  Order preserving maps, homomorphisms and vector spaces,
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   730
  on the other hand, do not.
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   731
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   732
  The original work of Kamm\"uller on locales \cite{KammullerEtAl1999}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   733
  may be of interest from a historical perspective.  The mathematical
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   734
  background on orders and lattices is taken from Jacobson's textbook
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   735
  on algebra \cite[Chapter~8]{Jacobson1985}.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   736
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   737
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   738
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   739
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   740
\begin{table}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   741
\hrule
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   742
\vspace{2ex}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   743
\begin{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   744
\begin{tabular}{l>$c<$l}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   745
  \multicolumn{3}{l}{Miscellaneous} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   746
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   747
  \textit{attr-name} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   748
  & \textit{name} $|$ \textit{attribute} $|$
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   749
    \textit{name} \textit{attribute} \\
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   750
  \textit{qualifier} & ::=
30751
36a255c2e428 Corrections to locale syntax.
ballarin
parents: 30750
diff changeset
   751
  & \textit{name} [``\textbf{?}'' $|$ ``\textbf{!}''] \\[2ex]
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   752
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   753
  \multicolumn{3}{l}{Context Elements} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   754
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   755
  \textit{fixes} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   756
  & \textit{name} [ ``\textbf{::}'' \textit{type} ]
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   757
    [ ``\textbf{(}'' \textbf{structure} ``\textbf{)}'' $|$
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   758
    \textit{mixfix} ] \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   759
\begin{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   760
  \textit{constrains} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   761
  & \textit{name} ``\textbf{::}'' \textit{type} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   762
\end{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   763
  \textit{assumes} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   764
  & [ \textit{attr-name} ``\textbf{:}'' ] \textit{proposition} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   765
\begin{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   766
  \textit{defines} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   767
  & [ \textit{attr-name} ``\textbf{:}'' ] \textit{proposition} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   768
  \textit{notes} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   769
  & [ \textit{attr-name} ``\textbf{=}'' ]
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   770
    ( \textit{qualified-name} [ \textit{attribute} ] )$^+$ \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   771
\end{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   772
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   773
  \textit{element} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   774
  & \textbf{fixes} \textit{fixes} ( \textbf{and} \textit{fixes} )$^*$ \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   775
\begin{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   776
  & |
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   777
  & \textbf{constrains} \textit{constrains}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   778
    ( \textbf{and} \textit{constrains} )$^*$ \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   779
\end{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   780
  & |
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   781
  & \textbf{assumes} \textit{assumes} ( \textbf{and} \textit{assumes} )$^*$ \\[2ex]
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   782
%\begin{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   783
%  & |
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   784
%  & \textbf{defines} \textit{defines} ( \textbf{and} \textit{defines} )$^*$ \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   785
%  & |
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   786
%  & \textbf{notes} \textit{notes} ( \textbf{and} \textit{notes} )$^*$ \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   787
%\end{comment}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   788
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   789
  \multicolumn{3}{l}{Locale Expressions} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   790
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   791
  \textit{pos-insts} & ::=
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   792
  & ( \textit{term} $|$ ``\textbf{\_}'' )$^*$ \\
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   793
  \textit{named-insts} & ::=
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   794
  & \textbf{where} \textit{name} ``\textbf{=}'' \textit{term}
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   795
  ( \textbf{and} \textit{name} ``\textbf{=}'' \textit{term} )$^*$ \\
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   796
  \textit{instance} & ::=
30751
36a255c2e428 Corrections to locale syntax.
ballarin
parents: 30750
diff changeset
   797
  & [ \textit{qualifier} ``\textbf{:}'' ]
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   798
    \textit{qualified-name} ( \textit{pos-insts} $|$ \textit{named-inst} ) \\
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   799
  \textit{expression}  & ::= 
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   800
  & \textit{instance} ( ``\textbf{+}'' \textit{instance} )$^*$
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   801
    [ \textbf{for} \textit{fixes} ( \textbf{and} \textit{fixes} )$^*$ ] \\[2ex]
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   802
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   803
  \multicolumn{3}{l}{Declaration of Locales} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   804
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   805
  \textit{locale} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   806
  & \textit{element}$^+$ \\
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   807
  & | & \textit{expression} [ ``\textbf{+}'' \textit{element}$^+$ ] \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   808
  \textit{toplevel} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   809
  & \textbf{locale} \textit{name} [ ``\textbf{=}''
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   810
    \textit{locale} ] \\[2ex]
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   811
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   812
  \multicolumn{3}{l}{Interpretation} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   813
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   814
  \textit{equation} & ::= & [ \textit{attr-name} ``\textbf{:}'' ]
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   815
    \textit{prop} \\
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   816
  \textit{equations} & ::= &  \textbf{where} \textit{equation} ( \textbf{and}
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   817
    \textit{equation} )$^*$  \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   818
  \textit{toplevel} & ::=
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   819
  & \textbf{sublocale} \textit{name} ( ``$<$'' $|$
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   820
    ``$\subseteq$'' ) \textit{expression} \textit{proof} \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   821
  & |
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   822
  & \textbf{interpretation}
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   823
    \textit{expression} [ \textit{equations} ] \textit{proof} \\
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   824
  & |
29566
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   825
  & \textbf{interpret}
937baa077df2 Fixed tutorial to compile with new locales; grammar of new locale commands.
ballarin
parents: 28259
diff changeset
   826
    \textit{expression} \textit{proof} \\[2ex]
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   827
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   828
  \multicolumn{3}{l}{Diagnostics} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   829
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   830
  \textit{toplevel} & ::=
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   831
  & \textbf{print\_locale} [ ``\textbf{!}'' ] \textit{locale} \\
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   832
  & | & \textbf{print\_locales} 
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   833
\end{tabular}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   834
\end{center}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   835
\hrule
29567
286c01be90cb Merged, overriding earlier fix.
ballarin
parents: 29297 29566
diff changeset
   836
\caption{Syntax of Locale Commands (abridged).}
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   837
\label{tab:commands}
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   838
\end{table}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   839
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   840
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   841
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   842
\begin{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   843
\textbf{Acknowledgements.}  Alexander Krauss, Tobias Nipkow,
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   844
  Christian Sternagel and Makarius Wenzel have made useful comments on
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   845
  a draft of this document.%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   846
\end{isamarkuptext}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   847
\isamarkuptrue%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   848
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   849
\isadelimtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   850
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   851
\endisadelimtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   852
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   853
\isatagtheory
27080
0ee385433247 updated generated file;
wenzelm
parents: 27079
diff changeset
   854
\isacommand{end}\isamarkupfalse%
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   855
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   856
\endisatagtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   857
{\isafoldtheory}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   858
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   859
\isadelimtheory
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   860
%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   861
\endisadelimtheory
27080
0ee385433247 updated generated file;
wenzelm
parents: 27079
diff changeset
   862
\isanewline
27063
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   863
\end{isabellebody}%
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   864
%%% Local Variables:
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   865
%%% mode: latex
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   866
%%% TeX-master: "root"
d1d35284542f New version covering interpretation.
ballarin
parents:
diff changeset
   867
%%% End: