author | Christian Urban <urbanc@in.tum.de> |
Sun, 21 Mar 2010 22:27:08 +0100 | |
changeset 1566 | 2facd6645599 |
parent 1556 | a7072d498723 |
child 1570 | 014ddf0d7271 |
permissions | -rw-r--r-- |
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1 |
(*<*) |
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
2 |
theory Paper |
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
3 |
imports "../Nominal/Test" "LaTeXsugar" |
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
4 |
begin |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
5 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
6 |
notation (latex output) |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
7 |
swap ("'(_ _')" [1000, 1000] 1000) and |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
8 |
fresh ("_ # _" [51, 51] 50) and |
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
9 |
fresh_star ("_ #* _" [51, 51] 50) and |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
10 |
supp ("supp _" [78] 73) and |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
11 |
uminus ("-_" [78] 73) and |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
12 |
If ("if _ then _ else _" 10) |
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
13 |
(*>*) |
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
14 |
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
15 |
section {* Introduction *} |
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
16 |
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
17 |
text {* |
1524 | 18 |
So far, Nominal Isabelle provides a mechanism for constructing |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
19 |
alpha-equated terms such as |
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
20 |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
21 |
\begin{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
22 |
$t ::= x \mid t\;t \mid \lambda x. t$ |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
23 |
\end{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
24 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
25 |
\noindent |
1550 | 26 |
where free and bound variables have names. For such terms Nominal Isabelle |
27 |
derives automatically a reasoning infrastructure, which has been used |
|
28 |
successfully in formalisations of an equivalence checking algorithm for LF |
|
29 |
\cite{UrbanCheneyBerghofer08}, Typed |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
30 |
Scheme~\cite{TobinHochstadtFelleisen08}, several calculi for concurrency |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
31 |
\cite{BengtsonParrow07,BengtsonParow09} and a strong normalisation result |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
32 |
for cut-elimination in classical logic \cite{UrbanZhu08}. It has also been |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
33 |
used by Pollack for formalisations in the locally-nameless approach to |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
34 |
binding \cite{SatoPollack10}. |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
35 |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
36 |
However, Nominal Isabelle has fared less well in a formalisation of |
1524 | 37 |
the algorithm W \cite{UrbanNipkow09}, where types and type-schemes |
38 |
are of the form |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
39 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
40 |
\begin{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
41 |
\begin{tabular}{l} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
42 |
$T ::= x \mid T \rightarrow T$ \hspace{5mm} $S ::= \forall \{x_1,\ldots, x_n\}. T$ |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
43 |
\end{tabular} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
44 |
\end{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
45 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
46 |
\noindent |
1566 | 47 |
and the quantification $\forall$ binds a finite (possibly empty) set of |
1550 | 48 |
type-variables. While it is possible to implement this kind of more general |
49 |
binders by iterating single binders, this leads to a rather clumsy |
|
50 |
formalisation of W. The need of iterating single binders is also one reason |
|
51 |
why Nominal Isabelle and similar theorem provers that only provide |
|
52 |
mechanisms for binding single variables have not fared extremely well with the |
|
53 |
more advanced tasks in the POPLmark challenge \cite{challenge05}, because |
|
54 |
also there one would like to bind multiple variables at once. |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
55 |
|
1550 | 56 |
Binding multiple variables has interesting properties that are not captured |
1556 | 57 |
by iterating single binders. For example in the case of type-schemes we do not |
1550 | 58 |
like to make a distinction about the order of the bound variables. Therefore |
59 |
we would like to regard the following two type-schemes as alpha-equivalent |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
60 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
61 |
\begin{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
62 |
$\forall \{x, y\}. x \rightarrow y \;\approx_\alpha\; \forall \{y, x\}. y \rightarrow x$ |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
63 |
\end{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
64 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
65 |
\noindent |
1524 | 66 |
but the following two should \emph{not} be alpha-equivalent |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
67 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
68 |
\begin{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
69 |
$\forall \{x, y\}. x \rightarrow y \;\not\approx_\alpha\; \forall \{z\}. z \rightarrow z$ |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
70 |
\end{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
71 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
72 |
\noindent |
1524 | 73 |
assuming that $x$, $y$ and $z$ are distinct. Moreover, we like to regard type-schemes as |
74 |
alpha-equivalent, if they differ only on \emph{vacuous} binders, such as |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
75 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
76 |
\begin{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
77 |
$\forall \{x\}. x \rightarrow y \;\approx_\alpha\; \forall \{x, z\}. x \rightarrow y$ |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
78 |
\end{center} |
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
79 |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
80 |
\noindent |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
81 |
where $z$ does not occur freely in the type. |
1545 | 82 |
In this paper we will give a general binding mechanism and associated |
1524 | 83 |
notion of alpha-equivalence that can be used to faithfully represent |
1545 | 84 |
this kind of binding in Nominal Isabelle. The difficulty of finding the right notion |
1524 | 85 |
for alpha-equivalence in this case can be appreciated by considering that the |
86 |
definition given by Leroy in \cite{Leroy92} is incorrect (it omits a side-condition). |
|
87 |
||
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
88 |
However, the notion of alpha-equivalence that is preserved by vacuous binders is not |
1566 | 89 |
always wanted. For example in terms like |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
90 |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
91 |
\begin{equation}\label{one} |
1550 | 92 |
\LET x = 3 \AND y = 2 \IN x\,-\,y \END |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
93 |
\end{equation} |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
94 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
95 |
\noindent |
1524 | 96 |
we might not care in which order the assignments $x = 3$ and $y = 2$ are |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
97 |
given, but it would be unusual to regard \eqref{one} as alpha-equivalent |
1524 | 98 |
with |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
99 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
100 |
\begin{center} |
1550 | 101 |
$\LET x = 3 \AND y = 2 \AND z = loop \IN x\,-\,y \END$ |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
102 |
\end{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
103 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
104 |
\noindent |
1550 | 105 |
Therefore we will also provide a separate binding mechanism for cases in |
106 |
which the order of binders does not matter, but the ``cardinality'' of the |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
107 |
binders has to agree. |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
108 |
|
1550 | 109 |
However, we found that this is still not sufficient for dealing with |
110 |
language constructs frequently occurring in programming language |
|
111 |
research. For example in $\mathtt{let}$s containing patterns |
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
112 |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
113 |
\begin{equation}\label{two} |
1550 | 114 |
\LET (x, y) = (3, 2) \IN x\,-\,y \END |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
115 |
\end{equation} |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
116 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
117 |
\noindent |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
118 |
we want to bind all variables from the pattern inside the body of the |
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
119 |
$\mathtt{let}$, but we also care about the order of these variables, since |
1566 | 120 |
we do not want to regard \eqref{two} as alpha-equivalent with |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
121 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
122 |
\begin{center} |
1550 | 123 |
$\LET (y, x) = (3, 2) \IN x\,- y\,\END$ |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
124 |
\end{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
125 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
126 |
\noindent |
1545 | 127 |
As a result, we provide three general binding mechanisms each of which binds multiple |
1566 | 128 |
variables at once, and let the user chose which one is intended when formalising a |
1524 | 129 |
programming language calculus. |
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
130 |
|
1545 | 131 |
By providing these general binding mechanisms, however, we have to work around |
1524 | 132 |
a problem that has been pointed out by Pottier in \cite{Pottier06}: in |
133 |
$\mathtt{let}$-constructs of the form |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
134 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
135 |
\begin{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
136 |
$\LET x_1 = t_1 \AND \ldots \AND x_n = t_n \IN s \END$ |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
137 |
\end{center} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
138 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
139 |
\noindent |
1524 | 140 |
which bind all the $x_i$ in $s$, we might not care about the order in |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
141 |
which the $x_i = t_i$ are given, but we do care about the information that there are |
1524 | 142 |
as many $x_i$ as there are $t_i$. We lose this information if we represent the |
1550 | 143 |
$\mathtt{let}$-constructor by something like |
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
144 |
|
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
145 |
\begin{center} |
1524 | 146 |
$\LET [x_1,\ldots,x_n].s\;\; [t_1,\ldots,t_n]$ |
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
147 |
\end{center} |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
148 |
|
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
149 |
\noindent |
1566 | 150 |
where the notation $[\_\!\_].\_\!\_$ indicates that the $x_i$ become bound |
151 |
in $s$. In this representation the term \mbox{$\LET [x].s\;\;[t_1,t_2]$} |
|
152 |
would be a perfectly legal instance. To exclude such terms an additional |
|
153 |
predicate about well-formed terms is needed in order to ensure that the two |
|
154 |
lists are of equal length. This can result into very messy reasoning (see |
|
155 |
for example~\cite{BengtsonParow09}). To avoid this, we will allow specifications |
|
156 |
for $\mathtt{let}$s as follows |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
157 |
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
158 |
\begin{center} |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
159 |
\begin{tabular}{r@ {\hspace{2mm}}r@ {\hspace{2mm}}l} |
1556 | 160 |
$trm$ & $=$ & \ldots\\ |
1545 | 161 |
& $\mid$ & $\mathtt{let}\;a\!::\!assn\;\;s\!::\!trm\quad\mathtt{bind}\;bn\,(a) \IN s$\\[1mm] |
1556 | 162 |
$assn$ & $=$ & $\mathtt{anil}$\\ |
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
163 |
& $\mid$ & $\mathtt{acons}\;\;name\;\;trm\;\;assn$ |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
164 |
\end{tabular} |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
165 |
\end{center} |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
166 |
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
167 |
\noindent |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
168 |
where $assn$ is an auxiliary type representing a list of assignments |
1545 | 169 |
and $bn$ an auxiliary function identifying the variables to be bound by |
1566 | 170 |
the $\mathtt{let}$. This function is defined by recursion over $assn$ as follows |
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
171 |
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
172 |
\begin{center} |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
173 |
$bn\,(\mathtt{anil}) = \varnothing \qquad bn\,(\mathtt{acons}\;x\;t\;as) = \{x\} \cup bn\,(as)$ |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
174 |
\end{center} |
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
175 |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
176 |
\noindent |
1550 | 177 |
The scope of the binding is indicated by labels given to the types, for |
178 |
example \mbox{$s\!::\!trm$}, and a binding clause, in this case |
|
1556 | 179 |
$\mathtt{bind}\;bn\,(a) \IN s$, that states to bind all the names the function |
1550 | 180 |
$bn$ returns in $s$. This style of specifying terms and bindings is heavily |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
181 |
inspired by the syntax of the Ott-tool \cite{ott-jfp}. |
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
182 |
|
1545 | 183 |
However, we will not be able to deal with all specifications that are |
184 |
allowed by Ott. One reason is that we establish the reasoning infrastructure |
|
185 |
for alpha-\emph{equated} terms. In contrast, Ott produces for a subset of |
|
1550 | 186 |
its specifications a reasoning infrastructure in Isabelle/HOL for |
1545 | 187 |
\emph{non}-alpha-equated, or ``raw'', terms. While our alpha-equated terms |
1556 | 188 |
and the raw terms produced by Ott use names for bound variables, |
1545 | 189 |
there is a key difference: working with alpha-equated terms means that the |
190 |
two type-schemes with $x$, $y$ and $z$ being distinct |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
191 |
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
192 |
\begin{center} |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
193 |
$\forall \{x\}. x \rightarrow y \;=\; \forall \{x, z\}. x \rightarrow y$ |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
194 |
\end{center} |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
195 |
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
196 |
\noindent |
1550 | 197 |
are not just alpha-equal, but actually equal. As a |
198 |
result, we can only support specifications that make sense on the level of |
|
199 |
alpha-equated terms (offending specifications, which for example bind a variable |
|
1556 | 200 |
according to a variable bound somewhere else, are not excluded by Ott, but we |
201 |
have to). Our |
|
1550 | 202 |
insistence on reasoning with alpha-equated terms comes from the wealth of |
203 |
experience we gained with the older version of Nominal Isabelle: for |
|
204 |
non-trivial properties, reasoning about alpha-equated terms is much easier |
|
1556 | 205 |
than reasoning with raw terms. The fundamental reason for this is that the |
1550 | 206 |
HOL-logic underlying Nominal Isabelle allows us to replace |
207 |
``equals-by-equals''. In contrast replacing ``alpha-equals-by-alpha-equals'' |
|
208 |
in a representation based on raw terms requires a lot of extra reasoning work. |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
209 |
|
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
210 |
Although in informal settings a reasoning infrastructure for alpha-equated |
1545 | 211 |
terms (that have names for bound variables) is nearly always taken for granted, establishing |
1550 | 212 |
it automatically in the Isabelle/HOL theorem prover is a rather non-trivial task. |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
213 |
For every specification we will need to construct a type containing as |
1556 | 214 |
elements the alpha-equated terms. To do so, we use |
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
215 |
the standard HOL-technique of defining a new type by |
1556 | 216 |
identifying a non-empty subset of an existing type. The construction we |
217 |
perform in HOL is illustrated by the following picture: |
|
1545 | 218 |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
219 |
\begin{center} |
1552 | 220 |
\begin{tikzpicture} |
221 |
%\draw[step=2mm] (-4,-1) grid (4,1); |
|
222 |
||
223 |
\draw[very thick] (0.7,0.4) circle (4.25mm); |
|
224 |
\draw[rounded corners=1mm, very thick] ( 0.0,-0.8) rectangle ( 1.8, 0.9); |
|
225 |
\draw[rounded corners=1mm, very thick] (-1.95,0.85) rectangle (-2.85,-0.05); |
|
226 |
||
227 |
\draw (-2.0, 0.845) -- (0.7,0.845); |
|
228 |
\draw (-2.0,-0.045) -- (0.7,-0.045); |
|
229 |
||
230 |
\draw ( 0.7, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-\\[-1mm]clas.\end{tabular}}; |
|
231 |
\draw (-2.4, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-eq.\\[-1mm]terms\end{tabular}}; |
|
232 |
\draw (1.8, 0.48) node[right=-0.1mm] |
|
233 |
{\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ (sets of raw terms)\end{tabular}}; |
|
234 |
\draw (0.9, -0.35) node {\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}}; |
|
235 |
\draw (-3.25, 0.55) node {\begin{tabular}{@ {}l@ {}}new\\[-1mm]type\end{tabular}}; |
|
236 |
||
237 |
\draw[<->, very thick] (-1.8, 0.3) -- (-0.1,0.3); |
|
238 |
\draw (-0.95, 0.3) node[above=0mm] {isomorphism}; |
|
239 |
||
240 |
\end{tikzpicture} |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
241 |
\end{center} |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
242 |
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
243 |
\noindent |
1556 | 244 |
We take as the starting point a definition of raw terms (being defined as a |
245 |
datatype in Isabelle/HOL); identify then the |
|
246 |
alpha-equivalence classes in the type of sets of raw terms, according to our |
|
247 |
alpha-equivalence relation and finally define the new type as these |
|
248 |
alpha-equivalence classes (non-emptiness is satisfied whenever the raw terms are |
|
249 |
definable as datatype in Isabelle/HOL and the fact that our relation for alpha is an |
|
250 |
equivalence relation).\marginpar{\footnotesize Does Ott allow definitions of ``strange'' types?} |
|
251 |
||
252 |
The fact that we obtain an isomorphism between between the new type and the non-empty |
|
253 |
subset shows that the new type is a faithful representation of alpha-equated terms. |
|
254 |
That is different for example in the representation of terms using the locally |
|
255 |
nameless representation of binders: there are non-well-formed terms that need to |
|
256 |
be excluded by reasoning about a well-formedness predicate. |
|
257 |
||
258 |
The problem with introducing a new type is that in order to be useful |
|
259 |
a resoning infrastructure needs to be ``lifted'' from the underlying type |
|
260 |
and subset to the new type. This is usually a tricky task. To ease this task |
|
261 |
we reimplemented in Isabelle/HOL the quotient package described by Homeier |
|
262 |
\cite{Homeier05}. Gieven that alpha is an equivalence relation, this package |
|
263 |
allows us to automatically lift definitions and theorems involving raw terms |
|
264 |
to definitions and theorems involving alpha-equated terms. This of course |
|
265 |
only works if the definitions and theorems are respectful w.r.t.~alpha-equivalence. |
|
266 |
Hence we will be able to lift, for instance, the function for free |
|
267 |
variables of raw terms to alpha-equated terms (since this function respects |
|
268 |
alpha-equivalence), but we will not be able to do this with a bound-variable |
|
269 |
function (since it does not respect alpha-equivalence). As a result, each |
|
270 |
lifting needs some respectulness proofs which we automated.\medskip |
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
271 |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
272 |
\noindent |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
273 |
{\bf Contributions:} We provide new definitions for when terms |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
274 |
involving multiple binders are alpha-equivalent. These definitions are |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
275 |
inspired by earlier work of Pitts \cite{}. By means of automatic |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
276 |
proofs, we establish a reasoning infrastructure for alpha-equated |
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
277 |
terms, including properties about support, freshness and equality |
1552 | 278 |
conditions for alpha-equated terms. We re also able to derive, at the moment |
279 |
only manually, for these terms a strong induction principle that |
|
280 |
has the variable convention already built in. |
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
281 |
*} |
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
282 |
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
283 |
section {* A Short Review of the Nominal Logic Work *} |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
284 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
285 |
text {* |
1556 | 286 |
At its core, Nominal Isabelle is an adaption of the nominal logic work by |
287 |
Pitts \cite{Pitts03}. This adaptation for Isabelle/HOL is described in |
|
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
288 |
\cite{HuffmanUrban10}, which we review here briefly to aid the description |
1556 | 289 |
of what follows. Two central notions in the nominal logic work are sorted |
290 |
atoms and permutations of atoms. The sorted atoms represent different kinds |
|
291 |
of variables, such as term- and type-variables in Core-Haskell, and it is |
|
292 |
assumed that there is an infinite supply of atoms for each sort. However, in |
|
293 |
order to simplify the description, we shall assume in what follows that |
|
294 |
there is only a single sort of atoms. |
|
295 |
||
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
296 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
297 |
Permutations are bijective functions from atoms to atoms that are |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
298 |
the identity everywhere except on a finite number of atoms. There is a |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
299 |
two-place permutation operation written |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
300 |
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
301 |
@{text[display,indent=5] "_ \<bullet> _ :: (\<alpha> \<times> \<alpha>) list \<Rightarrow> \<beta> \<Rightarrow> \<beta>"} |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
302 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
303 |
\noindent |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
304 |
with a generic type in which @{text "\<alpha>"} stands for the type of atoms |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
305 |
and @{text "\<beta>"} for the type of the objects on which the permutation |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
306 |
acts. In Nominal Isabelle the identity permutation is written as @{term "0::perm"}, |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
307 |
the composition of two permutations @{term p} and @{term q} as \mbox{@{term "p + q"}} |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
308 |
and the inverse permutation @{term p} as @{text "- p"}. The permutation |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
309 |
operation is defined for products, lists, sets, functions, booleans etc |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
310 |
(see \cite{HuffmanUrban10}). |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
311 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
312 |
The most original aspect of the nominal logic work of Pitts et al is a general |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
313 |
definition for ``the set of free variables of an object @{text "x"}''. This |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
314 |
definition is general in the sense that it applies not only to lambda-terms, |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
315 |
but also to lists, products, sets and even functions. The definition depends |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
316 |
only on the permutation operation and on the notion of equality defined for |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
317 |
the type of @{text x}, namely: |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
318 |
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
319 |
@{thm[display,indent=5] supp_def[no_vars, THEN eq_reflection]} |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
320 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
321 |
\noindent |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
322 |
There is also the derived notion for when an atom @{text a} is \emph{fresh} |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
323 |
for an @{text x}, defined as |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
324 |
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
325 |
@{thm[display,indent=5] fresh_def[no_vars]} |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
326 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
327 |
\noindent |
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
328 |
We also use for sets of atoms the abbreviation |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
329 |
@{thm (lhs) fresh_star_def[no_vars]} defined as |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
330 |
@{thm (rhs) fresh_star_def[no_vars]}. |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
331 |
A striking consequence of these definitions is that we can prove |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
332 |
without knowing anything about the structure of @{term x} that |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
333 |
swapping two fresh atoms, say @{text a} and @{text b}, leave |
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
334 |
@{text x} unchanged. |
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
335 |
|
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
336 |
\begin{property} |
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
337 |
@{thm[mode=IfThen] swap_fresh_fresh[no_vars]} |
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
338 |
\end{property} |
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
339 |
|
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
340 |
\noindent |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
341 |
For a proof see \cite{HuffmanUrban10}. |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
342 |
|
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
343 |
\begin{property} |
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
344 |
@{thm[mode=IfThen] at_set_avoiding[no_vars]} |
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
345 |
\end{property} |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
346 |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
347 |
*} |
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
348 |
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
349 |
|
1556 | 350 |
section {* General Binders *} |
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
351 |
|
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
352 |
text {* |
1556 | 353 |
In order to keep our work managable we like to state general definitions |
354 |
and perform proofs inside Isabelle as much as possible, as opposed to write |
|
355 |
custom ML-code that generates appropriate definitions and proofs for each |
|
356 |
instance of a term-calculus. For this, we like to consider pairs |
|
357 |
||
358 |
\begin{equation}\label{three} |
|
359 |
\mbox{@{text "(as, x) :: atom set \<times> \<beta>"}} |
|
360 |
\end{equation} |
|
361 |
||
362 |
\noindent |
|
363 |
consisting of a set of atoms and an object of generic type. The pairs |
|
364 |
are intended to be used for representing binding such as found in |
|
365 |
type-schemes |
|
366 |
||
367 |
\begin{center} |
|
368 |
$\forall \{x_1,\ldots,x_n\}. T$ |
|
369 |
\end{center} |
|
370 |
||
371 |
\noindent |
|
372 |
where the atoms $x_1,\ldots,x_n$ is intended to be in \eqref{three} the |
|
373 |
set @{text as} of atoms we want to bind, and $T$, an object-level type, is |
|
374 |
one instance for the generic $x$. |
|
375 |
||
376 |
The first question we have to answer is when we should consider the pairs |
|
377 |
in \eqref{three} as alpha-equivelent? (At the moment we are interested in |
|
378 |
the notion of alpha-equivalence that is \emph{not} preserved by adding |
|
379 |
vacuous binders.) Assuming we are given a free-variable function, say |
|
380 |
\mbox{@{text "fv :: \<beta> \<Rightarrow> atom set"}}, then we expect for two alpha-equivelent |
|
381 |
pairs that their sets of free variables aggree. That is |
|
382 |
% |
|
383 |
\begin{equation}\label{four} |
|
384 |
\mbox{@{text "(as, x) \<approx> (bs, y)"} \hspace{2mm}implies\hspace{2mm} @{text "fv(x) - as = fv(y) - bs"}} |
|
385 |
\end{equation} |
|
386 |
||
387 |
\noindent |
|
388 |
Next we expect that there is a permutation, say $p$, that leaves the |
|
389 |
free variables unchanged, but ``moves'' the bound names in $x$ so that |
|
390 |
we obtain $y$ modulo a relation, say @{text "_ R _"}, that characterises when two |
|
391 |
elments of type $\beta$ are equivalent. We also expect that $p$ |
|
392 |
makes the binders equal. We can formulate these requirements as: there |
|
393 |
exists a $p$ such that $i)$ @{term "(fv(x) - as) \<sharp>* p"}, $ii)$ @{text "(p \<bullet> x) R y"} and |
|
394 |
$iii)$ @{text "(p \<bullet> as) = bs"}. |
|
395 |
||
396 |
We take now \eqref{four} and the three |
|
397 |
||
398 |
||
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
399 |
General notion of alpha-equivalence (depends on a free-variable |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
400 |
function and a relation). |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
401 |
*} |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
402 |
|
1491
f970ca9b5bec
paper uses now a heap file - does not compile so long anymore
Christian Urban <urbanc@in.tum.de>
parents:
1485
diff
changeset
|
403 |
section {* Alpha-Equivalence and Free Variables *} |
f970ca9b5bec
paper uses now a heap file - does not compile so long anymore
Christian Urban <urbanc@in.tum.de>
parents:
1485
diff
changeset
|
404 |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
405 |
text {* |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
406 |
Restrictions |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
407 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
408 |
\begin{itemize} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
409 |
\item non-emptyness |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
410 |
\item positive datatype definitions |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
411 |
\item finitely supported abstractions |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
412 |
\item respectfulness of the bn-functions\bigskip |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
413 |
\item binders can only have a ``single scope'' |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
414 |
\end{itemize} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
415 |
*} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
416 |
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
417 |
section {* Examples *} |
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
418 |
|
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
419 |
section {* Adequacy *} |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
420 |
|
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
421 |
section {* Related Work *} |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
422 |
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
423 |
section {* Conclusion *} |
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
424 |
|
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
425 |
text {* |
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
426 |
Complication when the single scopedness restriction is lifted (two |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
427 |
overlapping permutations) |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
428 |
*} |
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
429 |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
430 |
text {* |
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
431 |
|
1517
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
432 |
TODO: function definitions: |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
433 |
\medskip |
62d6f7acc110
corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents:
1506
diff
changeset
|
434 |
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
435 |
\noindent |
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
436 |
{\bf Acknowledgements:} We are very grateful to Andrew Pitts for |
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
437 |
many discussions about Nominal Isabelle. We thank Peter Sewell for |
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
438 |
making the informal notes \cite{SewellBestiary} available to us and |
1556 | 439 |
also for patiently explaining some of the finer points about the abstract |
1545 | 440 |
definitions and about the implementation of the Ott-tool. |
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
441 |
|
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
442 |
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
443 |
*} |
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
444 |
|
1484 | 445 |
|
446 |
||
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
447 |
(*<*) |
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
448 |
end |
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
449 |
(*>*) |