2351
|
1 |
(*<*)
|
|
2 |
theory Slides2
|
|
3 |
imports "LaTeXsugar" "Nominal"
|
|
4 |
begin
|
|
5 |
|
|
6 |
notation (latex output)
|
|
7 |
set ("_") and
|
|
8 |
Cons ("_::/_" [66,65] 65)
|
|
9 |
|
|
10 |
(*>*)
|
|
11 |
|
|
12 |
|
|
13 |
text_raw {*
|
2352
|
14 |
\renewcommand{\slidecaption}{Edinburgh, 11.~July 2010}
|
2351
|
15 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
16 |
\mode<presentation>{
|
|
17 |
\begin{frame}<1>[t]
|
|
18 |
\frametitle{%
|
|
19 |
\begin{tabular}{@ {\hspace{-3mm}}c@ {}}
|
|
20 |
\\
|
2352
|
21 |
\LARGE Proof Pearl:\\[-2mm]
|
|
22 |
\LARGE A New Foundation for\\[-2mm]
|
|
23 |
\LARGE Nominal Isabelle\\[12mm]
|
2351
|
24 |
\end{tabular}}
|
|
25 |
\begin{center}
|
2352
|
26 |
\small
|
|
27 |
Brian Huf\!fman and {\bf Christian Urban}\\[0mm]
|
2351
|
28 |
\end{center}
|
|
29 |
\end{frame}}
|
|
30 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
31 |
|
|
32 |
*}
|
|
33 |
|
|
34 |
text_raw {*
|
|
35 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
36 |
\mode<presentation>{
|
|
37 |
\begin{frame}<1-2>
|
2352
|
38 |
\frametitle{\begin{tabular}{c}Nominal Isabelle\end{tabular}}
|
|
39 |
\mbox{}\\[-3mm]
|
|
40 |
|
|
41 |
\begin{itemize}
|
|
42 |
\item sorted atoms and sort-respecting permutations\medskip
|
|
43 |
|
|
44 |
\onslide<2->{
|
|
45 |
\item[] in old Nominal: atoms have \underline{dif\!ferent} type\medskip
|
|
46 |
|
|
47 |
\begin{center}
|
|
48 |
\begin{tabular}{c@ {\hspace{7mm}}c}
|
|
49 |
$[]\;\act\;c \dn c$ &
|
|
50 |
$(a\;b)\!::\!\pi\;\act\;c \dn$
|
|
51 |
$\begin{cases}
|
|
52 |
b & \text{if}\; \pi \act c = a\\
|
|
53 |
a & \text{if}\; \pi \act c = b\\
|
|
54 |
\pi \act c & \text{otherwise}
|
|
55 |
\end{cases}$
|
|
56 |
\end{tabular}
|
|
57 |
\end{center}}
|
|
58 |
\end{itemize}
|
|
59 |
|
|
60 |
\end{frame}}
|
|
61 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
62 |
*}
|
|
63 |
|
|
64 |
text_raw {*
|
|
65 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
66 |
\mode<presentation>{
|
|
67 |
\begin{frame}<1-2>
|
|
68 |
\frametitle{\begin{tabular}{c}Nominal Theory\end{tabular}}
|
2351
|
69 |
\mbox{}\\[-3mm]
|
|
70 |
|
|
71 |
\begin{itemize}
|
|
72 |
\item sorted atoms and sort-respecting permutations\medskip
|
|
73 |
|
|
74 |
\onslide<2->{
|
|
75 |
\item[] in old Nominal: atoms have \underline{dif\!ferent} type\medskip
|
|
76 |
|
|
77 |
\begin{center}
|
|
78 |
\begin{tabular}{c@ {\hspace{7mm}}c}
|
|
79 |
$[]\;\act\;c \dn c$ &
|
|
80 |
$(a\;b)\!::\!\pi\;\act\;c \dn$
|
|
81 |
$\begin{cases}
|
|
82 |
b & \text{if}\; \pi \act c = a\\
|
|
83 |
a & \text{if}\; \pi \act c = b\\
|
|
84 |
\pi \act c & \text{otherwise}
|
|
85 |
\end{cases}$
|
|
86 |
\end{tabular}
|
|
87 |
\end{center}}
|
|
88 |
\end{itemize}
|
|
89 |
|
|
90 |
\end{frame}}
|
|
91 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
92 |
*}
|
|
93 |
|
|
94 |
text_raw {*
|
|
95 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
96 |
\mode<presentation>{
|
|
97 |
\begin{frame}<1>
|
|
98 |
\frametitle{\begin{tabular}{c}Problems\end{tabular}}
|
|
99 |
\mbox{}\\[-3mm]
|
|
100 |
|
|
101 |
\begin{itemize}
|
|
102 |
\item @{text "_ \<bullet> _ :: \<alpha> perm \<Rightarrow> \<beta> \<Rightarrow> \<beta>"}\bigskip
|
|
103 |
|
|
104 |
\item @{text "supp _ :: \<beta> \<Rightarrow> \<alpha> set"}
|
|
105 |
|
|
106 |
\begin{center}
|
|
107 |
$\text{finite} (\text{supp}\;x)_{\,\alpha_1\,\text{set}}$ \ldots
|
|
108 |
$\text{finite} (\text{supp}\;x)_{\,\alpha_n\,\text{set}}$
|
|
109 |
\end{center}\bigskip
|
|
110 |
|
|
111 |
\item $\forall \pi_{\alpha_1} \ldots \pi_{\alpha_n}\;.\; P$\bigskip
|
|
112 |
|
|
113 |
\item type-classes
|
|
114 |
\end{itemize}
|
|
115 |
|
|
116 |
\end{frame}}
|
|
117 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
118 |
*}
|
|
119 |
|
|
120 |
text_raw {*
|
|
121 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
122 |
\mode<presentation>{
|
|
123 |
\begin{frame}<1-4>
|
|
124 |
\frametitle{\begin{tabular}{c}Our New Solution\end{tabular}}
|
|
125 |
\mbox{}\\[-3mm]
|
|
126 |
*}
|
|
127 |
datatype atom = Atom string nat
|
|
128 |
|
|
129 |
text_raw {*
|
|
130 |
\mbox{}\bigskip
|
|
131 |
\begin{itemize}
|
|
132 |
\item<2-> permutations are (restricted) bijective functions from @{text "atom \<Rightarrow> atom"}
|
|
133 |
|
|
134 |
\begin{itemize}
|
|
135 |
\item sort-respecting \hspace{5mm}($\forall a.\;\text{sort}(f a) = \text{sort}(a)$)
|
|
136 |
\item finite domain \hspace{5mm}($\text{finite} \{a.\;f a \not= a\}$)
|
|
137 |
\end{itemize}\medskip
|
|
138 |
|
|
139 |
\item<3-> swappings:
|
|
140 |
\small
|
|
141 |
\[
|
|
142 |
\begin{array}{l@ {\hspace{1mm}}l}
|
|
143 |
(a\;b) \dn & \text{if}\;\text{sort}(a) = \text{sort}(b)\\
|
|
144 |
& \text{then}\;\lambda c. \text{if}\;a = c\;\text{then}\;b\;\text{else}\;
|
|
145 |
\text{if}\;b = c\;\text{then}\;a\;\text{else}\;c\\
|
|
146 |
& \text{else}\;\only<3>{\mbox{\textcolor{red}{\bf ?}}}\only<4->{\text{id}}
|
|
147 |
\end{array}
|
|
148 |
\]
|
|
149 |
\end{itemize}
|
|
150 |
|
|
151 |
\end{frame}}
|
|
152 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
153 |
*}
|
|
154 |
|
|
155 |
text_raw {*
|
|
156 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
157 |
\mode<presentation>{
|
|
158 |
\begin{frame}<1-6>
|
|
159 |
\frametitle{\begin{tabular}{c}\LARGE{}A Smoother Nominal Theory\end{tabular}}
|
|
160 |
\mbox{}\\[-3mm]
|
|
161 |
|
|
162 |
\begin{itemize}
|
|
163 |
\item<1-> $(a\;b) = (b\;a) \onslide<3->{= (a\;c) + (b\;c) + (a\;c)}$\bigskip
|
|
164 |
|
|
165 |
\item<2-> permutations are an instance of group\_add\\ $0$, $\pi_1 + \pi_2$, $- \pi$\bigskip
|
|
166 |
|
|
167 |
\item<5-> $\_\;\act\;\_ :: \text{perm} \Rightarrow \alpha \Rightarrow \alpha$\medskip
|
|
168 |
|
|
169 |
\begin{itemize}
|
|
170 |
\item $0\;\act\;x = x$\\
|
|
171 |
\item $(\pi_1 + \pi_2)\;\act\;x = \pi_1\;\act\;(\pi_2\;\act\;x)$
|
|
172 |
\end{itemize}
|
|
173 |
|
|
174 |
\small
|
|
175 |
\onslide<6->{$\text{finite}(\text{supp}\;x)$, $\forall \pi. P$}
|
|
176 |
\end{itemize}
|
|
177 |
|
|
178 |
\only<4>{
|
|
179 |
\begin{textblock}{6}(2.5,11)
|
|
180 |
\begin{tikzpicture}
|
|
181 |
\draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm]
|
|
182 |
{\normalsize\color{darkgray}
|
|
183 |
\begin{minipage}{8cm}\raggedright
|
|
184 |
This is slightly odd, since in general:
|
|
185 |
\begin{center}$\pi_1 + \pi_2 \alert{\not=} \pi_2 + \pi_1$\end{center}
|
|
186 |
\end{minipage}};
|
|
187 |
\end{tikzpicture}
|
|
188 |
\end{textblock}}
|
|
189 |
|
|
190 |
\end{frame}}
|
|
191 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
192 |
*}
|
|
193 |
|
|
194 |
text_raw {*
|
|
195 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
196 |
\mode<presentation>{
|
|
197 |
\begin{frame}<1-3>
|
|
198 |
\frametitle{\begin{tabular}{c}Very Few Snatches\end{tabular}}
|
|
199 |
\mbox{}\\[-3mm]
|
|
200 |
|
|
201 |
\begin{itemize}
|
|
202 |
\item \underline{concrete} atoms:
|
|
203 |
\end{itemize}
|
|
204 |
*}
|
|
205 |
(*<*)
|
|
206 |
consts sort :: "atom \<Rightarrow> string"
|
|
207 |
(*>*)
|
|
208 |
|
|
209 |
typedef name = "{a :: atom. sort a = ''name''}" (*<*)sorry(*>*)
|
|
210 |
typedef ident = "{a :: atom. sort a = ''ident''}" (*<*)sorry(*>*)
|
|
211 |
|
|
212 |
text_raw {*
|
|
213 |
\mbox{}\bigskip\bigskip
|
|
214 |
\begin{itemize}
|
|
215 |
\item<2-> there is an overloaded function \underline{atom}, which injects concrete
|
|
216 |
atoms into generic ones\medskip
|
|
217 |
\begin{center}
|
|
218 |
\begin{tabular}{l}
|
|
219 |
$\text{atom}(a) \fresh x$\\
|
|
220 |
$(a \leftrightarrow b) \dn (\text{atom}(a)\;\;\text{atom}(b))$
|
|
221 |
\end{tabular}
|
|
222 |
\end{center}\bigskip\medskip
|
|
223 |
|
|
224 |
\onslide<3->
|
|
225 |
{I would like to have $a \fresh x$, $(a\; b)$, \ldots}
|
|
226 |
|
|
227 |
\end{itemize}
|
|
228 |
|
|
229 |
\end{frame}}
|
|
230 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
231 |
*}
|
|
232 |
|
|
233 |
text_raw {*
|
|
234 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
235 |
\mode<presentation>{
|
|
236 |
\begin{frame}<1-2>[c]
|
|
237 |
\frametitle{\begin{tabular}{c}\LARGE{}End of Part I\end{tabular}}
|
|
238 |
\mbox{}\\[-3mm]
|
|
239 |
|
|
240 |
\begin{itemize}
|
|
241 |
\item the formalised version of the nominal theory is now much nicer to
|
|
242 |
work with (sorts are occasionally explicit)\bigskip
|
|
243 |
|
|
244 |
\item permutations: ``be as abstract as you can'' (group\_add is a slight oddity)\bigskip
|
|
245 |
|
|
246 |
\item allow sort-disrespecting swappings\onslide<2->{: just define them as the identity}
|
|
247 |
\end{itemize}
|
|
248 |
|
|
249 |
|
|
250 |
\end{frame}}
|
|
251 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
252 |
*}
|
|
253 |
|
|
254 |
(*<*)
|
|
255 |
end
|
|
256 |
(*>*) |