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