| author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
| Sat, 27 Mar 2010 12:01:28 +0100 | |
| changeset 1678 | 23f81992da8f |
| parent 1667 | 2922b04d9545 |
| child 1687 | 51bc795b81fd |
| 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 |
|
| 1657 | 6 |
consts |
7 |
fv :: "'a \<Rightarrow> 'b" |
|
8 |
abs_set :: "'a \<Rightarrow> 'b \<Rightarrow> 'c" |
|
9 |
||
10 |
definition |
|
11 |
"equal \<equiv> (op =)" |
|
12 |
||
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
13 |
notation (latex output) |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
14 |
swap ("'(_ _')" [1000, 1000] 1000) and
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
15 |
fresh ("_ # _" [51, 51] 50) and
|
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
16 |
fresh_star ("_ #* _" [51, 51] 50) and
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
17 |
supp ("supp _" [78] 73) and
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
18 |
uminus ("-_" [78] 73) and
|
| 1657 | 19 |
If ("if _ then _ else _" 10) and
|
| 1662 | 20 |
alpha_gen ("_ \<approx>\<^raw:\raisebox{-1pt}{\makebox[0mm][l]{$\,_{\textit{set}}$}}>\<^bsup>_,_,_\<^esup> _") and
|
21 |
alpha_lst ("_ \<approx>\<^raw:\raisebox{-1pt}{\makebox[0mm][l]{$\,_{\textit{list}}$}}>\<^bsup>_,_,_\<^esup> _") and
|
|
22 |
alpha_res ("_ \<approx>\<^raw:\raisebox{-1pt}{\makebox[0mm][l]{$\,_{\textit{res}}$}}>\<^bsup>_,_,_\<^esup> _") and
|
|
| 1657 | 23 |
abs_set ("_ \<approx>\<^raw:{$\,_{\textit{abs\_set}}$}> _") and
|
24 |
fv ("fv'(_')" [100] 100) and
|
|
25 |
equal ("=") and
|
|
26 |
alpha_abs ("_ \<approx>\<^raw:{$\,_{\textit{abs\_set}}$}> _") and
|
|
27 |
Abs ("[_]\<^raw:$\!$>\<^bsub>set\<^esub>._") and
|
|
28 |
Abs_lst ("[_]\<^raw:$\!$>\<^bsub>list\<^esub>._") and
|
|
29 |
Abs_res ("[_]\<^raw:$\!$>\<^bsub>res\<^esub>._")
|
|
|
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
30 |
(*>*) |
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
31 |
|
| 1657 | 32 |
|
|
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
33 |
section {* Introduction *}
|
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
34 |
|
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
35 |
text {*
|
| 1524 | 36 |
So far, Nominal Isabelle provides a mechanism for constructing |
| 1607 | 37 |
alpha-equated terms, for example |
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
38 |
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
39 |
\begin{center}
|
| 1657 | 40 |
@{text "t ::= x | t t | \<lambda>x. t"}
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
41 |
\end{center}
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
42 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
43 |
\noindent |
| 1550 | 44 |
where free and bound variables have names. For such terms Nominal Isabelle |
| 1657 | 45 |
derives automatically a reasoning infrastructure that has been used |
| 1550 | 46 |
successfully in formalisations of an equivalence checking algorithm for LF |
47 |
\cite{UrbanCheneyBerghofer08}, Typed
|
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
48 |
Scheme~\cite{TobinHochstadtFelleisen08}, several calculi for concurrency
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
49 |
\cite{BengtsonParrow07,BengtsonParow09} and a strong normalisation result
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
50 |
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
|
51 |
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
|
52 |
binding \cite{SatoPollack10}.
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
53 |
|
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
54 |
However, Nominal Isabelle has fared less well in a formalisation of |
| 1524 | 55 |
the algorithm W \cite{UrbanNipkow09}, where types and type-schemes
|
56 |
are of the form |
|
| 1570 | 57 |
% |
58 |
\begin{equation}\label{tysch}
|
|
59 |
\begin{array}{l}
|
|
| 1657 | 60 |
@{text "T ::= x | T \<rightarrow> T"}\hspace{5mm}
|
61 |
@{text "S ::= \<forall>{x\<^isub>1,\<dots>, x\<^isub>n}. T"}
|
|
| 1570 | 62 |
\end{array}
|
63 |
\end{equation}
|
|
|
1520
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 |
| 1566 | 66 |
and the quantification $\forall$ binds a finite (possibly empty) set of |
| 1550 | 67 |
type-variables. While it is possible to implement this kind of more general |
68 |
binders by iterating single binders, this leads to a rather clumsy |
|
69 |
formalisation of W. The need of iterating single binders is also one reason |
|
70 |
why Nominal Isabelle and similar theorem provers that only provide |
|
71 |
mechanisms for binding single variables have not fared extremely well with the |
|
72 |
more advanced tasks in the POPLmark challenge \cite{challenge05}, because
|
|
73 |
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
|
74 |
|
| 1577 | 75 |
Binding multiple variables has interesting properties that cannot be captured |
| 1587 | 76 |
easily by iterating single binders. For example in case of type-schemes we do not |
77 |
want to make a distinction about the order of the bound variables. Therefore |
|
| 1550 | 78 |
we would like to regard the following two type-schemes as alpha-equivalent |
| 1572 | 79 |
% |
80 |
\begin{equation}\label{ex1}
|
|
| 1667 | 81 |
@{text "\<forall>{x, y}. x \<rightarrow> y \<approx>\<^isub>\<alpha> \<forall>{y, x}. y \<rightarrow> x"}
|
| 1572 | 82 |
\end{equation}
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
83 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
84 |
\noindent |
| 1657 | 85 |
but assuming that @{text x}, @{text y} and @{text z} are distinct variables,
|
| 1587 | 86 |
the following two should \emph{not} be alpha-equivalent
|
| 1572 | 87 |
% |
88 |
\begin{equation}\label{ex2}
|
|
| 1667 | 89 |
@{text "\<forall>{x, y}. x \<rightarrow> y \<notapprox>\<^isub>\<alpha> \<forall>{z}. z \<rightarrow> z"}
|
| 1572 | 90 |
\end{equation}
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
91 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
92 |
\noindent |
| 1657 | 93 |
Moreover, we like to regard type-schemes as alpha-equivalent, if they differ |
94 |
only on \emph{vacuous} binders, such as
|
|
| 1572 | 95 |
% |
96 |
\begin{equation}\label{ex3}
|
|
| 1667 | 97 |
@{text "\<forall>{x}. x \<rightarrow> y \<approx>\<^isub>\<alpha> \<forall>{x, z}. x \<rightarrow> y"}
|
| 1572 | 98 |
\end{equation}
|
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
99 |
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
100 |
\noindent |
| 1657 | 101 |
where @{text z} does not occur freely in the type. In this paper we will
|
102 |
give a general binding mechanism and associated notion of alpha-equivalence |
|
103 |
that can be used to faithfully represent this kind of binding in Nominal |
|
104 |
Isabelle. The difficulty of finding the right notion for alpha-equivalence |
|
105 |
can be appreciated in this case by considering that the definition given by |
|
106 |
Leroy in \cite{Leroy92} is incorrect (it omits a side-condition).
|
|
| 1524 | 107 |
|
| 1657 | 108 |
However, the notion of alpha-equivalence that is preserved by vacuous |
109 |
binders is not always wanted. For example in terms like |
|
| 1587 | 110 |
% |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
111 |
\begin{equation}\label{one}
|
| 1657 | 112 |
@{text "\<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
|
113 |
\end{equation}
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
114 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
115 |
\noindent |
| 1524 | 116 |
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
|
117 |
given, but it would be unusual to regard \eqref{one} as alpha-equivalent
|
| 1524 | 118 |
with |
| 1587 | 119 |
% |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
120 |
\begin{center}
|
| 1657 | 121 |
@{text "\<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
|
122 |
\end{center}
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
123 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
124 |
\noindent |
| 1550 | 125 |
Therefore we will also provide a separate binding mechanism for cases in |
126 |
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
|
127 |
binders has to agree. |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
128 |
|
| 1550 | 129 |
However, we found that this is still not sufficient for dealing with |
130 |
language constructs frequently occurring in programming language |
|
| 1657 | 131 |
research. For example in @{text "\<LET>"}s containing patterns
|
| 1587 | 132 |
% |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
133 |
\begin{equation}\label{two}
|
| 1657 | 134 |
@{text "\<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
|
135 |
\end{equation}
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
136 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
137 |
\noindent |
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
138 |
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
|
139 |
$\mathtt{let}$, but we also care about the order of these variables, since
|
| 1566 | 140 |
we do not want to regard \eqref{two} as alpha-equivalent with
|
| 1587 | 141 |
% |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
142 |
\begin{center}
|
| 1657 | 143 |
@{text "\<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
|
144 |
\end{center}
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
145 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
146 |
\noindent |
| 1657 | 147 |
As a result, we provide three general binding mechanisms each of which binds |
148 |
multiple variables at once, and let the user chose which one is intended |
|
149 |
when formalising a programming language calculus. |
|
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
150 |
|
| 1657 | 151 |
By providing these general binding mechanisms, however, we have to work |
152 |
around a problem that has been pointed out by Pottier \cite{Pottier06} and
|
|
153 |
Cheney \cite{Cheney05}: in @{text "\<LET>"}-constructs of the form
|
|
| 1587 | 154 |
% |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
155 |
\begin{center}
|
| 1657 | 156 |
@{text "\<LET> x\<^isub>1 = t\<^isub>1 \<AND> \<dots> \<AND> x\<^isub>n = t\<^isub>n \<IN> s \<END>"}
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
157 |
\end{center}
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
158 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
159 |
\noindent |
| 1657 | 160 |
which bind all the @{text "x\<^isub>i"} in @{text s}, we might not care
|
161 |
about the order in which the @{text "x\<^isub>i = t\<^isub>i"} are given,
|
|
162 |
but we do care about the information that there are as many @{text
|
|
163 |
"x\<^isub>i"} as there are @{text "t\<^isub>i"}. We lose this information if
|
|
164 |
we represent the @{text "\<LET>"}-constructor by something like
|
|
| 1587 | 165 |
% |
|
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
166 |
\begin{center}
|
| 1657 | 167 |
@{text "\<LET> [x\<^isub>1,\<dots>,x\<^isub>n].s [t\<^isub>1,\<dots>,t\<^isub>n]"}
|
|
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
168 |
\end{center}
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
169 |
|
|
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
170 |
\noindent |
| 1657 | 171 |
where the notation @{text "[_]._"} indicates that the @{text "x\<^isub>i"}
|
172 |
become bound in @{text s}. In this representation the term
|
|
| 1667 | 173 |
\mbox{@{text "\<LET> [x].s [t\<^isub>1, t\<^isub>2]"}} would be a perfectly legal
|
| 1657 | 174 |
instance. To exclude such terms, additional predicates about well-formed |
175 |
terms are needed in order to ensure that the two lists are of equal |
|
176 |
length. This can result into very messy reasoning (see for |
|
177 |
example~\cite{BengtsonParow09}). To avoid this, we will allow type
|
|
178 |
specifications for $\mathtt{let}$s as follows
|
|
| 1587 | 179 |
% |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
180 |
\begin{center}
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
181 |
\begin{tabular}{r@ {\hspace{2mm}}r@ {\hspace{2mm}}l}
|
| 1657 | 182 |
@{text trm} & @{text "::="} & @{text "\<dots>"}\\
|
183 |
& @{text "|"} & @{text "\<LET> a::assn s::trm"}\hspace{4mm}
|
|
184 |
\isacommand{bind} @{text "bn(a)"} \isacommand{in} @{text "s"}\\[1mm]
|
|
185 |
@{text assn} & @{text "::="} & @{text "\<ANIL>"}\\
|
|
186 |
& @{text "|"} & @{text "\<ACONS> name trm assn"}
|
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
187 |
\end{tabular}
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
188 |
\end{center}
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
189 |
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
190 |
\noindent |
| 1657 | 191 |
where @{text assn} is an auxiliary type representing a list of assignments
|
192 |
and @{text bn} an auxiliary function identifying the variables to be bound
|
|
193 |
by the @{text "\<LET>"}. This function is defined by recursion over @{text
|
|
194 |
assn} as follows |
|
|
1528
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 |
\begin{center}
|
| 1657 | 197 |
@{text "bn(\<ANIL>) ="} @{term "{}"} \hspace{5mm}
|
198 |
@{text "bn(\<ACONS> x t as) = {x} \<union> bn(as)"}
|
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
199 |
\end{center}
|
|
1523
eb95360d6ac6
another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1520
diff
changeset
|
200 |
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
201 |
\noindent |
| 1550 | 202 |
The scope of the binding is indicated by labels given to the types, for |
| 1657 | 203 |
example @{text "s::trm"}, and a binding clause, in this case
|
204 |
\isacommand{bind} @{text "bn(a)"} \isacommand{in} @{text "s"}, that states
|
|
205 |
to bind in @{text s} all the names the function call @{text "bn(a)"} returns.
|
|
206 |
This style of specifying terms and bindings is heavily inspired by the |
|
207 |
syntax of the Ott-tool \cite{ott-jfp}.
|
|
208 |
||
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
209 |
|
| 1545 | 210 |
However, we will not be able to deal with all specifications that are |
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
211 |
allowed by Ott. One reason is that Ott lets the user to specify ``empty'' |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
212 |
types like |
| 1570 | 213 |
|
214 |
\begin{center}
|
|
| 1657 | 215 |
@{text "t ::= t t | \<lambda>x. t"}
|
| 1570 | 216 |
\end{center}
|
217 |
||
218 |
\noindent |
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
219 |
where no clause for variables is given. Arguably, such specifications make |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
220 |
some sense in the context of Coq's type theory (which Ott supports), but not |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
221 |
at all in a HOL-based environment where every datatype must have a non-empty |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
222 |
set-theoretic model. |
| 1570 | 223 |
|
224 |
Another reason is that we establish the reasoning infrastructure |
|
225 |
for alpha-\emph{equated} terms. In contrast, Ott produces a reasoning
|
|
226 |
infrastructure in Isabelle/HOL for |
|
| 1545 | 227 |
\emph{non}-alpha-equated, or ``raw'', terms. While our alpha-equated terms
|
| 1556 | 228 |
and the raw terms produced by Ott use names for bound variables, |
| 1545 | 229 |
there is a key difference: working with alpha-equated terms means that the |
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
230 |
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
|
231 |
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
232 |
\begin{center}
|
| 1667 | 233 |
@{text "\<forall>{x}. x \<rightarrow> y = \<forall>{x, z}. x \<rightarrow> y"}
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
234 |
\end{center}
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
235 |
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
236 |
\noindent |
| 1657 | 237 |
are not just alpha-equal, but actually \emph{equal}. As a result, we can
|
238 |
only support specifications that make sense on the level of alpha-equated |
|
239 |
terms (offending specifications, which for example bind a variable according |
|
240 |
to a variable bound somewhere else, are not excluded by Ott, but we have |
|
241 |
to). Our insistence on reasoning with alpha-equated terms comes from the |
|
242 |
wealth of experience we gained with the older version of Nominal Isabelle: |
|
243 |
for non-trivial properties, reasoning about alpha-equated terms is much |
|
244 |
easier than reasoning with raw terms. The fundamental reason for this is |
|
245 |
that the HOL-logic underlying Nominal Isabelle allows us to replace |
|
246 |
``equals-by-equals''. In contrast, replacing |
|
247 |
``alpha-equals-by-alpha-equals'' in a representation based on raw terms |
|
248 |
requires a lot of extra reasoning work. |
|
|
1535
a37c65fe10de
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1528
diff
changeset
|
249 |
|
| 1657 | 250 |
Although in informal settings a reasoning infrastructure for alpha-equated |
251 |
terms is nearly always taken for granted, establishing it automatically in |
|
252 |
the Isabelle/HOL theorem prover is a rather non-trivial task. For every |
|
253 |
specification we will need to construct a type containing as elements the |
|
254 |
alpha-equated terms. To do so, we use the standard HOL-technique of defining |
|
255 |
a new type by identifying a non-empty subset of an existing type. The |
|
| 1667 | 256 |
construction we perform in Isabelle/HOL can be illustrated by the following picture: |
| 1657 | 257 |
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
258 |
\begin{center}
|
| 1552 | 259 |
\begin{tikzpicture}
|
260 |
%\draw[step=2mm] (-4,-1) grid (4,1); |
|
261 |
||
262 |
\draw[very thick] (0.7,0.4) circle (4.25mm); |
|
263 |
\draw[rounded corners=1mm, very thick] ( 0.0,-0.8) rectangle ( 1.8, 0.9); |
|
264 |
\draw[rounded corners=1mm, very thick] (-1.95,0.85) rectangle (-2.85,-0.05); |
|
265 |
||
266 |
\draw (-2.0, 0.845) -- (0.7,0.845); |
|
267 |
\draw (-2.0,-0.045) -- (0.7,-0.045); |
|
268 |
||
269 |
\draw ( 0.7, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-\\[-1mm]clas.\end{tabular}};
|
|
270 |
\draw (-2.4, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-eq.\\[-1mm]terms\end{tabular}};
|
|
271 |
\draw (1.8, 0.48) node[right=-0.1mm] |
|
272 |
{\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ (sets of raw terms)\end{tabular}};
|
|
273 |
\draw (0.9, -0.35) node {\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}};
|
|
274 |
\draw (-3.25, 0.55) node {\begin{tabular}{@ {}l@ {}}new\\[-1mm]type\end{tabular}};
|
|
275 |
||
276 |
\draw[<->, very thick] (-1.8, 0.3) -- (-0.1,0.3); |
|
277 |
\draw (-0.95, 0.3) node[above=0mm] {isomorphism};
|
|
278 |
||
279 |
\end{tikzpicture}
|
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
280 |
\end{center}
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
281 |
|
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
282 |
\noindent |
| 1657 | 283 |
We take as the starting point a definition of raw terms (defined as a |
284 |
datatype in Isabelle/HOL); identify then the alpha-equivalence classes in |
|
285 |
the type of sets of raw terms according to our alpha-equivalence relation |
|
286 |
and finally define the new type as these alpha-equivalence classes |
|
287 |
(non-emptiness is satisfied whenever the raw terms are definable as datatype |
|
288 |
in Isabelle/HOL and the fact that our relation for alpha-equivalence is |
|
289 |
indeed an equivalence relation). |
|
| 1556 | 290 |
|
| 1657 | 291 |
The fact that we obtain an isomorphism between the new type and the |
292 |
non-empty subset shows that the new type is a faithful representation of |
|
293 |
alpha-equated terms. That is not the case for example for terms using the |
|
294 |
locally nameless representation of binders \cite{McKinnaPollack99}: in this
|
|
295 |
representation there are ``junk'' terms that need to be excluded by |
|
296 |
reasoning about a well-formedness predicate. |
|
| 1556 | 297 |
|
| 1657 | 298 |
The problem with introducing a new type in Isabelle/HOL is that in order to |
299 |
be useful, a reasoning infrastructure needs to be ``lifted'' from the |
|
300 |
underlying subset to the new type. This is usually a tricky and arduous |
|
301 |
task. To ease it, we re-implemented in Isabelle/HOL the quotient package |
|
302 |
described by Homeier \cite{Homeier05} for the HOL4 system. This package
|
|
303 |
allows us to lift definitions and theorems involving raw terms to |
|
304 |
definitions and theorems involving alpha-equated terms. For example if we |
|
305 |
define the free-variable function over raw lambda-terms |
|
| 1577 | 306 |
|
307 |
\begin{center}
|
|
| 1657 | 308 |
@{text "fv(x) = {x}"}\hspace{10mm}
|
309 |
@{text "fv(t\<^isub>1 t\<^isub>2) = fv(t\<^isub>1) \<union> fv(t\<^isub>2)"}\\[1mm]
|
|
310 |
@{text "fv(\<lambda>x.t) = fv(t) - {x}"}
|
|
| 1577 | 311 |
\end{center}
|
312 |
||
313 |
\noindent |
|
| 1657 | 314 |
then with not too great effort we obtain a function @{text "fv\<^sup>\<alpha>"}
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
315 |
operating on quotients, or alpha-equivalence classes of lambda-terms. This |
| 1628 | 316 |
lifted function is characterised by the equations |
| 1577 | 317 |
|
318 |
\begin{center}
|
|
| 1657 | 319 |
@{text "fv\<^sup>\<alpha>(x) = {x}"}\hspace{10mm}
|
320 |
@{text "fv\<^sup>\<alpha>(t\<^isub>1 t\<^isub>2) = fv\<^sup>\<alpha>(t\<^isub>1) \<union> fv\<^sup>\<alpha>(t\<^isub>2)"}\\[1mm]
|
|
321 |
@{text "fv\<^sup>\<alpha>(\<lambda>x.t) = fv\<^sup>\<alpha>(t) - {x}"}
|
|
| 1577 | 322 |
\end{center}
|
323 |
||
324 |
\noindent |
|
325 |
(Note that this means also the term-constructors for variables, applications |
|
326 |
and lambda are lifted to the quotient level.) This construction, of course, |
|
| 1628 | 327 |
only works if alpha-equivalence is indeed an equivalence relation, and the lifted |
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
328 |
definitions and theorems are respectful w.r.t.~alpha-equivalence. Accordingly, we |
| 1667 | 329 |
will not be able to lift a bound-variable function, which can be defined for |
330 |
raw terms, to alpha-equated terms |
|
| 1607 | 331 |
(since it does not respect alpha-equivalence). To sum up, every lifting of |
332 |
theorems to the quotient level needs proofs of some respectfulness |
|
333 |
properties. In the paper we show that we are able to automate these |
|
334 |
proofs and therefore can establish a reasoning infrastructure for |
|
| 1667 | 335 |
alpha-equated terms. |
336 |
||
337 |
The examples we have in mind where our reasoning infrastructure will be |
|
338 |
immeasurably helpful is what is often referred to as Core-Haskell (see |
|
339 |
Figure~\ref{corehas}). There terms include patterns which include a list of
|
|
340 |
type- and term- variables (the arguments of constructors) all of which are |
|
341 |
bound in case expressions. One difficulty is that each of these variables |
|
342 |
come with a kind or type annotation. Representing such binders with single |
|
343 |
binders and reasoning about them in a theorem prover would be a major pain. |
|
344 |
\medskip |
|
| 1577 | 345 |
|
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
346 |
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
347 |
\noindent |
|
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
348 |
{\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
|
349 |
involving multiple binders are alpha-equivalent. These definitions are |
| 1607 | 350 |
inspired by earlier work of Pitts \cite{Pitts04}. By means of automatic
|
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
351 |
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
|
352 |
terms, including properties about support, freshness and equality |
| 1607 | 353 |
conditions for alpha-equated terms. We are also able to derive, at the moment |
354 |
only manually, strong induction principles that |
|
355 |
have the variable convention already built in. |
|
| 1667 | 356 |
|
357 |
\begin{figure}
|
|
358 |
||
359 |
\caption{Core Haskell.\label{corehas}}
|
|
360 |
\end{figure}
|
|
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
361 |
*} |
|
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
362 |
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
363 |
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
|
364 |
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
365 |
text {*
|
| 1556 | 366 |
At its core, Nominal Isabelle is an adaption of the nominal logic work by |
367 |
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
|
368 |
\cite{HuffmanUrban10}, which we review here briefly to aid the description
|
| 1556 | 369 |
of what follows. Two central notions in the nominal logic work are sorted |
| 1570 | 370 |
atoms and sort-respecting permutations of atoms. The sorts can be used to |
371 |
represent different kinds of variables, such as term- and type-variables in |
|
372 |
Core-Haskell, and it is assumed that there is an infinite supply of atoms |
|
373 |
for each sort. However, in order to simplify the description, we shall |
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
374 |
assume in what follows that there is only one sort of atoms. |
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
375 |
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
376 |
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
|
377 |
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
|
378 |
two-place permutation operation written |
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
379 |
% |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
380 |
@{text[display,indent=5] "_ \<bullet> _ :: perm \<Rightarrow> \<beta> \<Rightarrow> \<beta>"}
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
381 |
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
382 |
\noindent |
| 1628 | 383 |
in which the generic type @{text "\<beta>"} stands for the type of the object
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
384 |
on which the permutation |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
385 |
acts. In Nominal Isabelle, the identity permutation is written as @{term "0::perm"},
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
386 |
the composition of two permutations @{term p} and @{term q} as \mbox{@{term "p + q"}}
|
| 1570 | 387 |
and the inverse permutation of @{term p} as @{text "- p"}. The permutation
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
388 |
operation is defined for products, lists, sets, functions, booleans etc |
| 1628 | 389 |
(see \cite{HuffmanUrban10}). Concrete permutations are build up from
|
390 |
swappings, written as @{text "(a b)"},
|
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
391 |
which are permutations that behave as follows: |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
392 |
% |
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
393 |
@{text[display,indent=5] "(a b) = \<lambda>c. if a = c then b else if b = c then a else c"}
|
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
394 |
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
395 |
|
| 1570 | 396 |
The most original aspect of the nominal logic work of Pitts is a general |
397 |
definition for the notion of ``the set of free variables of an object @{text
|
|
398 |
"x"}''. This notion, written @{term "supp x"}, is general in the sense that
|
|
| 1628 | 399 |
it applies not only to lambda-terms (alpha-equated or not), but also to lists, |
| 1570 | 400 |
products, sets and even functions. The definition depends only on the |
401 |
permutation operation and on the notion of equality defined for the type of |
|
402 |
@{text x}, namely:
|
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
403 |
% |
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
404 |
@{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
|
405 |
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
406 |
\noindent |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
407 |
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
|
408 |
for an @{text x}, defined as
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
409 |
% |
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
410 |
@{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
|
411 |
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
412 |
\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
|
413 |
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
|
414 |
@{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
|
415 |
@{thm (rhs) fresh_star_def[no_vars]}.
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
416 |
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
|
417 |
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
|
418 |
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
|
419 |
@{text x} unchanged.
|
|
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
420 |
|
|
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
|
421 |
\begin{property}
|
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
422 |
@{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
|
423 |
\end{property}
|
|
1506
7c607df46a0a
slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1493
diff
changeset
|
424 |
|
|
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
|
425 |
\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
|
426 |
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
|
427 |
|
| 1662 | 428 |
%\begin{property}
|
429 |
%@{thm[mode=IfThen] at_set_avoiding[no_vars]}
|
|
430 |
%\end{property}
|
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
431 |
|
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
432 |
*} |
|
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
433 |
|
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
434 |
|
| 1620 | 435 |
section {* General Binders\label{sec:binders} *}
|
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
436 |
|
|
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
|
437 |
text {*
|
| 1587 | 438 |
In Nominal Isabelle, the user is expected to write down a specification of a |
439 |
term-calculus and then a reasoning infrastructure is automatically derived |
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
440 |
from this specification (remember that Nominal Isabelle is a definitional |
| 1587 | 441 |
extension of Isabelle/HOL, which does not introduce any new axioms). |
| 1579 | 442 |
|
| 1657 | 443 |
In order to keep our work with deriving the reasoning infrastructure |
444 |
manageable, we will wherever possible state definitions and perform proofs |
|
445 |
on the user-level of Isabelle/HOL, as opposed to write custom ML-code that |
|
446 |
generates them anew for each specification. To that end, we will consider |
|
447 |
first pairs @{text "(as, x)"} of type @{text "(atom set) \<times> \<beta>"}. These pairs
|
|
448 |
are intended to represent the abstraction, or binding, of the set @{text
|
|
449 |
"as"} in the body @{text "x"}.
|
|
| 1570 | 450 |
|
| 1657 | 451 |
The first question we have to answer is when the pairs @{text "(as, x)"} and
|
452 |
@{text "(bs, y)"} are alpha-equivalent? (At the moment we are interested in
|
|
453 |
the notion of alpha-equivalence that is \emph{not} preserved by adding
|
|
454 |
vacuous binders.) To answer this, we identify four conditions: {\it i)}
|
|
455 |
given a free-variable function @{text "fv"} of type \mbox{@{text "\<beta> \<Rightarrow> atom
|
|
456 |
set"}}, then @{text x} and @{text y} need to have the same set of free
|
|
457 |
variables; moreover there must be a permutation @{text p} such that {\it
|
|
458 |
ii)} it leaves the free variables of @{text x} and @{text y} unchanged, but
|
|
459 |
{\it iii)} ``moves'' their bound names so that we obtain modulo a relation,
|
|
| 1662 | 460 |
say \mbox{@{text "_ R _"}}, two equivalent terms. We also require {\it iv)} that
|
461 |
@{text p} makes the sets of abstracted atoms @{text as} and @{text bs} equal. The
|
|
| 1657 | 462 |
requirements {\it i)} to {\it iv)} can be stated formally as follows:
|
| 1556 | 463 |
% |
| 1572 | 464 |
\begin{equation}\label{alphaset}
|
465 |
\begin{array}{@ {\hspace{10mm}}r@ {\hspace{2mm}}l}
|
|
| 1657 | 466 |
\multicolumn{2}{l}{@{term "(as, x) \<approx>gen R fv p (bs, y)"} @{text "\<equiv>"}\hspace{30mm}}\\
|
467 |
& @{term "fv(x) - as = fv(y) - bs"}\\
|
|
468 |
@{text "\<and>"} & @{term "(fv(x) - as) \<sharp>* p"}\\
|
|
469 |
@{text "\<and>"} & @{text "(p \<bullet> x) R y"}\\
|
|
470 |
@{text "\<and>"} & @{term "(p \<bullet> as) = bs"}\\
|
|
| 1572 | 471 |
\end{array}
|
| 1556 | 472 |
\end{equation}
|
473 |
||
474 |
\noindent |
|
| 1657 | 475 |
Note that this relation is dependent on the permutation @{text
|
476 |
"p"}. Alpha-equivalence between two pairs is then the relation where we |
|
477 |
existentially quantify over this @{text "p"}. Also note that the relation is
|
|
478 |
dependent on a free-variable function @{text "fv"} and a relation @{text
|
|
479 |
"R"}. The reason for this extra generality is that we will use |
|
480 |
$\approx_{\textit{set}}$ for both ``raw'' terms and alpha-equated terms. In
|
|
481 |
the latter case, $R$ will be replaced by equality @{text "="} and for raw terms we
|
|
482 |
will prove that @{text "fv"} is equal to the support of @{text
|
|
483 |
x} and @{text y}.
|
|
| 1572 | 484 |
|
485 |
The definition in \eqref{alphaset} does not make any distinction between the
|
|
| 1579 | 486 |
order of abstracted variables. If we want this, then we can define alpha-equivalence |
487 |
for pairs of the form \mbox{@{text "(as, x)"}} with type @{text "(atom list) \<times> \<beta>"}
|
|
488 |
as follows |
|
| 1572 | 489 |
% |
490 |
\begin{equation}\label{alphalist}
|
|
491 |
\begin{array}{@ {\hspace{10mm}}r@ {\hspace{2mm}}l}
|
|
| 1657 | 492 |
\multicolumn{2}{l}{@{term "(as, x) \<approx>lst R fv p (bs, y)"} @{text "\<equiv>"}\hspace{30mm}}\\[1mm]
|
493 |
& @{term "fv(x) - (set as) = fv(y) - (set bs)"}\\
|
|
494 |
\wedge & @{term "(fv(x) - set as) \<sharp>* p"}\\
|
|
| 1572 | 495 |
\wedge & @{text "(p \<bullet> x) R y"}\\
|
| 1657 | 496 |
\wedge & @{term "(p \<bullet> as) = bs"}\\
|
| 1572 | 497 |
\end{array}
|
498 |
\end{equation}
|
|
499 |
||
500 |
\noindent |
|
| 1657 | 501 |
where @{term set} is a function that coerces a list of atoms into a set of atoms.
|
502 |
Now the last clause ensures that the order of the binders matters. |
|
| 1556 | 503 |
|
| 1657 | 504 |
If we do not want to make any difference between the order of binders \emph{and}
|
| 1579 | 505 |
also allow vacuous binders, then we keep sets of binders, but drop the fourth |
506 |
condition in \eqref{alphaset}:
|
|
| 1572 | 507 |
% |
| 1579 | 508 |
\begin{equation}\label{alphares}
|
| 1572 | 509 |
\begin{array}{@ {\hspace{10mm}}r@ {\hspace{2mm}}l}
|
| 1657 | 510 |
\multicolumn{2}{l}{@{term "(as, x) \<approx>res R fv p (bs, y)"} @{text "\<equiv>"}\hspace{30mm}}\\[1mm]
|
511 |
& @{term "fv(x) - as = fv(y) - bs"}\\
|
|
512 |
\wedge & @{term "(fv(x) - as) \<sharp>* p"}\\
|
|
| 1572 | 513 |
\wedge & @{text "(p \<bullet> x) R y"}\\
|
514 |
\end{array}
|
|
515 |
\end{equation}
|
|
| 1556 | 516 |
|
| 1579 | 517 |
\begin{exmple}\rm
|
| 1662 | 518 |
It might be useful to consider some examples for how these definitions of alpha-equivalence |
519 |
pan out in practise. |
|
| 1579 | 520 |
For this consider the case of abstracting a set of variables over types (as in type-schemes). |
| 1657 | 521 |
We set @{text R} to be the equality and for @{text "fv(T)"} we define
|
| 1572 | 522 |
|
523 |
\begin{center}
|
|
| 1657 | 524 |
@{text "fv(x) = {x}"} \hspace{5mm} @{text "fv(T\<^isub>1 \<rightarrow> T\<^isub>2) = fv(T\<^isub>1) \<union> fv(T\<^isub>2)"}
|
| 1572 | 525 |
\end{center}
|
526 |
||
527 |
\noindent |
|
| 1657 | 528 |
Now recall the examples shown in \eqref{ex1}, \eqref{ex2} and
|
529 |
\eqref{ex3}. It can be easily checked that @{text "({x,y}, x \<rightarrow> y)"} and
|
|
530 |
@{text "({y,x}, y \<rightarrow> x)"} are equal according to $\approx_{\textit{set}}$ and
|
|
531 |
$\approx_{\textit{res}}$ by taking @{text p} to be the swapping @{term "(x \<rightleftharpoons>
|
|
532 |
y)"}. In case of @{text "x \<noteq> y"}, then @{text "([x, y], x \<rightarrow> y)"}
|
|
533 |
$\not\approx_{\textit{list}}$ @{text "([y,x], x \<rightarrow> y)"} since there is no permutation
|
|
534 |
that makes the lists @{text "[x, y]"} and @{text "[y, x]"} equal, and also
|
|
535 |
leaves the type \mbox{@{text "x \<rightarrow> y"}} unchanged. Another example is
|
|
536 |
@{text "({x}, x)"} $\approx_{\textit{res}}$ @{text "({x,y}, x)"} which holds by
|
|
537 |
taking @{text p} to be the
|
|
538 |
identity permutation. However, if @{text "x \<noteq> y"}, then @{text "({x}, x)"}
|
|
539 |
$\not\approx_{\textit{set}}$ @{text "({x,y}, x)"} since there is no permutation
|
|
540 |
that makes the |
|
541 |
sets @{text "{x}"} and @{text "{x,y}"} equal (similarly for $\approx_{\textit{list}}$).
|
|
| 1579 | 542 |
\end{exmple}
|
543 |
||
| 1657 | 544 |
% looks too ugly |
545 |
%\noindent |
|
546 |
%Let $\star$ range over $\{set, res, list\}$. We prove next under which
|
|
547 |
%conditions the $\approx\hspace{0.05mm}_\star^{\fv, R, p}$ are equivalence
|
|
548 |
%relations and equivariant: |
|
549 |
% |
|
550 |
%\begin{lemma}
|
|
551 |
%{\it i)} Given the fact that $x\;R\;x$ holds, then
|
|
552 |
%$(as, x) \approx\hspace{0.05mm}^{\fv, R, 0}_\star (as, x)$. {\it ii)} Given
|
|
553 |
%that @{text "(p \<bullet> x) R y"} implies @{text "(-p \<bullet> y) R x"}, then
|
|
554 |
%$(as, x) \approx\hspace{0.05mm}^{\fv, R, p}_\star (bs, y)$ implies
|
|
555 |
%$(bs, y) \approx\hspace{0.05mm}^{\fv, R, - p}_\star (as, x)$. {\it iii)} Given
|
|
556 |
%that @{text "(p \<bullet> x) R y"} and @{text "(q \<bullet> y) R z"} implies
|
|
557 |
%@{text "((q + p) \<bullet> x) R z"}, then $(as, x) \approx\hspace{0.05mm}^{\fv, R, p}_\star (bs, y)$
|
|
558 |
%and $(bs, y) \approx\hspace{0.05mm}^{\fv, R, q}_\star (cs, z)$ implies
|
|
559 |
%$(as, x) \approx\hspace{0.05mm}^{\fv, R, q + p}_\star (cs, z)$. Given
|
|
560 |
%@{text "(q \<bullet> x) R y"} implies @{text "(p \<bullet> (q \<bullet> x)) R (p \<bullet> y)"} and
|
|
561 |
%@{text "p \<bullet> (fv x) = fv (p \<bullet> x)"} then @{text "p \<bullet> (fv y) = fv (p \<bullet> y)"}, then
|
|
562 |
%$(as, x) \approx\hspace{0.05mm}^{\fv, R, q}_\star (bs, y)$ implies
|
|
563 |
%$(p \;\isasymbullet\; as, p \;\isasymbullet\; x) \approx\hspace{0.05mm}^{\fv, R, q}_\star
|
|
564 |
%(p \;\isasymbullet\; bs, p \;\isasymbullet\; y)$. |
|
565 |
%\end{lemma}
|
|
566 |
||
567 |
%\begin{proof}
|
|
568 |
%All properties are by unfolding the definitions and simple calculations. |
|
569 |
%\end{proof}
|
|
570 |
||
571 |
||
572 |
In the rest of this section we are going to introduce a type- and term-constructor |
|
| 1662 | 573 |
for abstractions. For this we define (similarly for $\approx_{\textit{abs\_list}}$
|
574 |
and $\approx_{\textit{abs\_res}}$)
|
|
| 1657 | 575 |
% |
576 |
\begin{equation}
|
|
577 |
@{term "abs_set (as, x) (bs, x) \<equiv> \<exists>p. alpha_gen (as, x) equal supp p (bs, x)"}
|
|
578 |
\end{equation}
|
|
579 |
||
| 1579 | 580 |
\noindent |
| 1662 | 581 |
We can show that these relations are equivalence relations and equivariant |
| 1657 | 582 |
(we only show the $\approx_{\textit{abs\_set}}$-case).
|
| 1579 | 583 |
|
| 1662 | 584 |
\begin{lemma}\label{alphaeq}
|
| 1657 | 585 |
$\approx_{\textit{abs\_set}}$ is an equivalence
|
| 1662 | 586 |
relations, and if @{term "abs_set (as, x) (bs, y)"} then also
|
587 |
@{term "abs_set (p \<bullet> as, p \<bullet> x) (p \<bullet> bs, p \<bullet> y)"}.
|
|
| 1657 | 588 |
\end{lemma}
|
589 |
||
590 |
\begin{proof}
|
|
591 |
Reflexivity is by taking @{text "p"} to be @{text "0"}. For symmetry we have
|
|
592 |
a permutation @{text p} and for the proof obligation take @{term "-p"}. In case
|
|
| 1662 | 593 |
of transitivity, we have two permutations @{text p} and @{text q}, and for the
|
594 |
proof obligation use @{text "q + p"}. All conditions are then by simple
|
|
| 1657 | 595 |
calculations. |
596 |
\end{proof}
|
|
597 |
||
| 1662 | 598 |
\noindent |
599 |
We are also define the following two auxiliary functions taking a pair |
|
600 |
as argument. |
|
601 |
% |
|
602 |
\begin{equation}\label{aux}
|
|
603 |
\begin{array}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
|
|
604 |
@{text "aux (as, x)"} & @{text "\<equiv>"} & @{text "supp x - as"}\\
|
|
605 |
@{text "aux_list (bs, x)"} & @{text "\<equiv>"} & @{text "supp x - set bs"}
|
|
606 |
\end{array}
|
|
607 |
\end{equation}
|
|
608 |
||
| 1657 | 609 |
\noindent |
| 1662 | 610 |
The point of these two functions is that they are preserved under |
611 |
alpha-equivalence, that means for instance |
|
612 |
% |
|
613 |
\begin{equation}\label{auxpreserved}
|
|
614 |
@{term "abs_set (as, x) (bs, y)"} \;\;\text{implies}\;\;
|
|
615 |
@{term "aux (as, x) = aux (bs, y)"}
|
|
616 |
\end{equation}
|
|
| 1657 | 617 |
|
| 1662 | 618 |
Lemma \ref{alphaeq} allows us to use our quotient package and introduce
|
619 |
new types @{text "\<beta> abs_set"}, @{text "\<beta> abs_res"} and @{text "\<beta> abs_list"}
|
|
| 1657 | 620 |
representing the alpha-equivalence classes. Elements in these types |
621 |
we will, respectively, write as: |
|
622 |
||
623 |
\begin{center}
|
|
624 |
@{term "Abs as x"} \hspace{5mm}
|
|
625 |
@{term "Abs_lst as x"} \hspace{5mm}
|
|
626 |
@{term "Abs_res as x"}
|
|
627 |
\end{center}
|
|
628 |
||
| 1662 | 629 |
\noindent |
630 |
By definition we have |
|
631 |
||
632 |
\begin{center}
|
|
633 |
@{thm (lhs) abs_eq_iff(1)[where bs="as" and cs="bs", no_vars]} \;iff\;
|
|
634 |
@{thm (rhs) abs_eq_iff(1)[where bs="as" and cs="bs", no_vars]}
|
|
635 |
\end{center}
|
|
636 |
||
637 |
||
638 |
\noindent |
|
639 |
The following lemma (and similar ones for $\approx_{\textit{abs\_list}}$ and
|
|
640 |
$\approx_{\textit{abs\_res}}$) will be crucial below:
|
|
641 |
||
642 |
\begin{lemma}
|
|
643 |
@{thm[mode=IfThen] abs_swap1(1)[no_vars]}
|
|
644 |
\end{lemma}
|
|
645 |
||
646 |
\begin{proof}
|
|
647 |
This lemma is straightforward by observing that the assumptions give us |
|
648 |
@{term "(a \<rightleftharpoons> b) \<bullet> (supp x - bs) = (supp x - bs)"} and that @{text supp}
|
|
649 |
is equivariant. |
|
650 |
\end{proof}
|
|
| 1587 | 651 |
|
652 |
\begin{lemma}
|
|
653 |
$supp ([as]set. x) = supp x - as$ |
|
654 |
\end{lemma}
|
|
|
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
|
655 |
*} |
|
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
|
656 |
|
|
1491
f970ca9b5bec
paper uses now a heap file - does not compile so long anymore
Christian Urban <urbanc@in.tum.de>
parents:
1485
diff
changeset
|
657 |
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
|
658 |
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
659 |
text {*
|
| 1637 | 660 |
Our specifications for term-calculi are heavily inspired by the existing |
661 |
datatype package of Isabelle/HOL and by the syntax of the Ott-tool |
|
662 |
\cite{ott-jfp}. A specification is a collection of (possibly mutual
|
|
663 |
recursive) type declarations, say @{text "ty"}$^\alpha_1$, \ldots,
|
|
664 |
@{text ty}$^\alpha_n$, and an associated collection
|
|
665 |
of binding functions, say @{text bn}$^\alpha_1$, \ldots, @{text
|
|
666 |
bn}$^\alpha_m$. The syntax in Nominal Isabelle for such specifications is |
|
667 |
rougly as follows: |
|
| 1628 | 668 |
% |
| 1619 | 669 |
\begin{equation}\label{scheme}
|
| 1636 | 670 |
\mbox{\begin{tabular}{@ {\hspace{-5mm}}p{1.8cm}l}
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
671 |
type \mbox{declaration part} &
|
| 1611 | 672 |
$\begin{cases}
|
673 |
\mbox{\begin{tabular}{l}
|
|
| 1637 | 674 |
\isacommand{nominal\_datatype} @{text ty}$^\alpha_1 = \ldots$\\
|
675 |
\isacommand{and} @{text ty}$^\alpha_2 = \ldots$\\
|
|
| 1587 | 676 |
$\ldots$\\ |
| 1637 | 677 |
\isacommand{and} @{text ty}$^\alpha_n = \ldots$\\
|
| 1611 | 678 |
\end{tabular}}
|
679 |
\end{cases}$\\
|
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
680 |
binding \mbox{function part} &
|
| 1611 | 681 |
$\begin{cases}
|
682 |
\mbox{\begin{tabular}{l}
|
|
| 1637 | 683 |
\isacommand{with} @{text bn}$^\alpha_1$ \isacommand{and} \ldots \isacommand{and} @{text bn}$^\alpha_m$\\
|
| 1611 | 684 |
\isacommand{where}\\
|
| 1587 | 685 |
$\ldots$\\ |
| 1611 | 686 |
\end{tabular}}
|
687 |
\end{cases}$\\
|
|
| 1619 | 688 |
\end{tabular}}
|
689 |
\end{equation}
|
|
| 1587 | 690 |
|
691 |
\noindent |
|
| 1637 | 692 |
Every type declaration @{text ty}$^\alpha_{1..n}$ consists of a collection of
|
| 1611 | 693 |
term-constructors, each of which comes with a list of labelled |
| 1620 | 694 |
types that stand for the types of the arguments of the term-constructor. |
| 1637 | 695 |
For example a term-constructor @{text "C\<^sup>\<alpha>"} might have
|
| 1611 | 696 |
|
697 |
\begin{center}
|
|
| 1637 | 698 |
@{text "C\<^sup>\<alpha> label\<^isub>1::ty"}$'_1$ @{text "\<dots> label\<^isub>l::ty"}$'_l\;\;$ @{text "binding_clauses"}
|
| 1611 | 699 |
\end{center}
|
| 1587 | 700 |
|
| 1611 | 701 |
\noindent |
| 1637 | 702 |
whereby some of the @{text ty}$'_{1..l}$ (or their components) are contained in the collection
|
703 |
of @{text ty}$^\alpha_{1..n}$ declared in \eqref{scheme}. In this case we will call the
|
|
| 1636 | 704 |
corresponding argument a \emph{recursive argument}. The labels annotated on
|
705 |
the types are optional and can be used in the (possibly empty) list of |
|
| 1637 | 706 |
\emph{binding clauses}. These clauses indicate the binders and their scope of
|
707 |
in a term-constructor. They come in three \emph{modes}:
|
|
| 1636 | 708 |
|
| 1587 | 709 |
|
| 1611 | 710 |
\begin{center}
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
711 |
\begin{tabular}{l}
|
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
712 |
\isacommand{bind}\; {\it binders}\; \isacommand{in}\; {\it label}\\
|
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
713 |
\isacommand{bind\_set}\; {\it binders}\; \isacommand{in}\; {\it label}\\
|
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
714 |
\isacommand{bind\_res}\; {\it binders}\; \isacommand{in}\; {\it label}\\
|
|
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
715 |
\end{tabular}
|
| 1611 | 716 |
\end{center}
|
717 |
||
718 |
\noindent |
|
| 1636 | 719 |
The first mode is for binding lists of atoms (the order of binders matters); the second is for sets |
| 1637 | 720 |
of binders (the order does not matter, but the cardinality does) and the last is for |
| 1620 | 721 |
sets of binders (with vacuous binders preserving alpha-equivalence). |
722 |
||
723 |
In addition we distinguish between \emph{shallow} binders and \emph{deep}
|
|
724 |
binders. Shallow binders are of the form \isacommand{bind}\; {\it label}\;
|
|
| 1637 | 725 |
\isacommand{in}\; {\it label'} (similar for the other two modes). The
|
| 1620 | 726 |
restriction we impose on shallow binders is that the {\it label} must either
|
727 |
refer to a type that is an atom type or to a type that is a finite set or |
|
| 1637 | 728 |
list of an atom type. Two examples for the use of shallow binders are the |
729 |
specification of lambda-terms, where a single name is bound, and of |
|
730 |
type-schemes, where a finite set of names is bound: |
|
| 1611 | 731 |
|
732 |
\begin{center}
|
|
| 1612 | 733 |
\begin{tabular}{@ {}cc@ {}}
|
734 |
\begin{tabular}{@ {}l@ {\hspace{-1mm}}}
|
|
735 |
\isacommand{nominal\_datatype} {\it lam} =\\
|
|
736 |
\hspace{5mm}\phantom{$\mid$} Var\;{\it name}\\
|
|
737 |
\hspace{5mm}$\mid$ App\;{\it lam}\;{\it lam}\\
|
|
738 |
\hspace{5mm}$\mid$ Lam\;{\it x::name}\;{\it t::lam}\\
|
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
739 |
\hspace{21mm}\isacommand{bind} {\it x} \isacommand{in} {\it t}\\
|
| 1611 | 740 |
\end{tabular} &
|
| 1612 | 741 |
\begin{tabular}{@ {}l@ {}}
|
742 |
\isacommand{nominal\_datatype} {\it ty} =\\
|
|
743 |
\hspace{5mm}\phantom{$\mid$} TVar\;{\it name}\\
|
|
744 |
\hspace{5mm}$\mid$ TFun\;{\it ty}\;{\it ty}\\
|
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
745 |
\isacommand{and} {\it tsc} = All\;{\it xs::(name fset)}\;{\it T::ty}\\
|
| 1619 | 746 |
\hspace{24mm}\isacommand{bind\_res} {\it xs} \isacommand{in} {\it T}\\
|
| 1611 | 747 |
\end{tabular}
|
748 |
\end{tabular}
|
|
749 |
\end{center}
|
|
| 1587 | 750 |
|
| 1612 | 751 |
\noindent |
| 1637 | 752 |
Note that in this specification \emph{name} refers to an atom type.
|
| 1628 | 753 |
If we have shallow binders that ``share'' a body, for instance $t$ in |
| 1637 | 754 |
the following term-constructor |
| 1620 | 755 |
|
756 |
\begin{center}
|
|
757 |
\begin{tabular}{ll}
|
|
| 1637 | 758 |
\it {\rm Foo} x::name y::name t::lam & \it
|
| 1620 | 759 |
\isacommand{bind}\;x\;\isacommand{in}\;t,\;
|
760 |
\isacommand{bind}\;y\;\isacommand{in}\;t
|
|
761 |
\end{tabular}
|
|
762 |
\end{center}
|
|
763 |
||
764 |
\noindent |
|
| 1628 | 765 |
then we have to make sure the modes of the binders agree. We cannot |
| 1637 | 766 |
have, for instance, in the first binding clause the mode \isacommand{bind}
|
767 |
and in the second \isacommand{bind\_set}.
|
|
| 1620 | 768 |
|
769 |
A \emph{deep} binder uses an auxiliary binding function that ``picks'' out
|
|
| 1636 | 770 |
the atoms in one argument of the term-constructor, which can be bound in |
| 1628 | 771 |
other arguments and also in the same argument (we will |
| 1637 | 772 |
call such binders \emph{recursive}, see below).
|
| 1620 | 773 |
The binding functions are expected to return either a set of atoms |
774 |
(for \isacommand{bind\_set} and \isacommand{bind\_res}) or a list of atoms
|
|
775 |
(for \isacommand{bind}). They can be defined by primitive recursion over the
|
|
776 |
corresponding type; the equations must be given in the binding function part of |
|
| 1628 | 777 |
the scheme shown in \eqref{scheme}. For example for a calculus containing lets
|
| 1637 | 778 |
with tuple patterns, you might specify |
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
779 |
|
| 1619 | 780 |
\begin{center}
|
781 |
\begin{tabular}{l}
|
|
782 |
\isacommand{nominal\_datatype} {\it trm} =\\
|
|
783 |
\hspace{5mm}\phantom{$\mid$} Var\;{\it name}\\
|
|
784 |
\hspace{5mm}$\mid$ App\;{\it trm}\;{\it trm}\\
|
|
785 |
\hspace{5mm}$\mid$ Lam\;{\it x::name}\;{\it t::trm}
|
|
786 |
\;\;\isacommand{bind} {\it x} \isacommand{in} {\it t}\\
|
|
787 |
\hspace{5mm}$\mid$ Let\;{\it p::pat}\;{\it trm}\; {\it t::trm}
|
|
| 1636 | 788 |
\;\;\isacommand{bind} {\it bn(p)} \isacommand{in} {\it t}\\
|
| 1619 | 789 |
\isacommand{and} {\it pat} =\\
|
| 1637 | 790 |
\hspace{5mm}\phantom{$\mid$} PNil\\
|
791 |
\hspace{5mm}$\mid$ PVar\;{\it name}\\
|
|
792 |
\hspace{5mm}$\mid$ PTup\;{\it pat}\;{\it pat}\\
|
|
| 1636 | 793 |
\isacommand{with} {\it bn::pat $\Rightarrow$ atom list}\\
|
| 1637 | 794 |
\isacommand{where} $\textit{bn}(\textrm{PNil}) = []$\\
|
795 |
\hspace{5mm}$\mid$ $\textit{bn}(\textrm{PVar}\;x) = [\textit{atom}\; x]$\\
|
|
796 |
\hspace{5mm}$\mid$ $\textit{bn}(\textrm{PTup}\;p_1\;p_2) = \textit{bn}(p_1)\; @\;\textit{bn}(p_2)$\\
|
|
| 1619 | 797 |
\end{tabular}
|
798 |
\end{center}
|
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
799 |
|
| 1619 | 800 |
\noindent |
| 1637 | 801 |
In this specification the function @{text "bn"} determines which atoms of @{text p} are
|
802 |
bound in the argument @{text "t"}. Note that the second last clause the function @{text "atom"}
|
|
803 |
coerces a name into the generic atom type of Nominal Isabelle. This allows |
|
804 |
us to treat binders of different atom type uniformly. |
|
805 |
||
806 |
As will shortly become clear, we cannot return an atom in a binding function |
|
807 |
that is also bound in the corresponding term-constructor. That means in the |
|
808 |
example above that the term-constructors PVar and PTup must not have a |
|
809 |
binding clause. In the present version of Nominal Isabelle, we also adopted |
|
810 |
the restriction from the Ott-tool that binding functions can only return: |
|
811 |
the empty set or empty list (as in case PNil), a singleton set or singleton |
|
812 |
list containing an atom (case PVar), or unions of atom sets or appended atom |
|
813 |
lists (case PTup). This restriction will simplify proofs later on. |
|
814 |
The the most drastic restriction we have to impose on deep binders is that |
|
815 |
we cannot have ``overlapping'' deep binders. Consider for example the |
|
816 |
term-constructors: |
|
|
1617
99cee15cb5ff
more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents:
1613
diff
changeset
|
817 |
|
| 1620 | 818 |
\begin{center}
|
819 |
\begin{tabular}{ll}
|
|
| 1637 | 820 |
\it {\rm Foo} p::pat q::pat t::trm & \it \isacommand{bind}\;bn(p)\;\isacommand{in}\;t,\;
|
| 1620 | 821 |
\isacommand{bind}\;bn(q)\;\isacommand{in}\;t\\
|
| 1637 | 822 |
\it {\rm Foo}$'$x::name p::pat t::trm & \it \it \isacommand{bind}\;x\;\isacommand{in}\;t,\;
|
| 1620 | 823 |
\isacommand{bind}\;bn(p)\;\isacommand{in}\;t
|
824 |
||
825 |
\end{tabular}
|
|
826 |
\end{center}
|
|
827 |
||
828 |
\noindent |
|
| 1637 | 829 |
In the first case we bind all atoms from the pattern @{text p} in @{text t}
|
830 |
and also all atoms from @{text q} in @{text t}. As a result we have no way
|
|
831 |
to determine whether the binder came from the binding function @{text
|
|
832 |
"bn(p)"} or @{text "bn(q)"}. Similarly in the second case. There the binder
|
|
833 |
@{text "bn(p)"} overlaps with the shallow binder @{text x}. The reason why
|
|
834 |
we must exclude such specifiactions is that they cannot be represent by |
|
835 |
the general binders described in Section \ref{sec:binders}. However
|
|
836 |
the following two term-constructors are allowed |
|
| 1620 | 837 |
|
838 |
\begin{center}
|
|
839 |
\begin{tabular}{ll}
|
|
| 1637 | 840 |
\it {\rm Bar} p::pat t::trm s::trm & \it \isacommand{bind}\;bn(p)\;\isacommand{in}\;t,\;
|
| 1620 | 841 |
\isacommand{bind}\;bn(p)\;\isacommand{in}\;s\\
|
| 1637 | 842 |
\it {\rm Bar}$'$p::pat t::trm & \it \isacommand{bind}\;bn(p)\;\isacommand{in}\;p,\;
|
| 1620 | 843 |
\isacommand{bind}\;bn(p)\;\isacommand{in}\;t\\
|
844 |
\end{tabular}
|
|
845 |
\end{center}
|
|
846 |
||
847 |
\noindent |
|
| 1628 | 848 |
since there is no overlap of binders. |
| 1619 | 849 |
|
| 1637 | 850 |
Note that in the last example we wrote {\it\isacommand{bind}\;bn(p)\;\isacommand{in}\;p}.
|
851 |
Whenver such a binding clause is present, we will call the binder \emph{recursive}.
|
|
852 |
To see the purpose for this, consider ``plain'' Lets and Let\_recs: |
|
| 1636 | 853 |
|
854 |
\begin{center}
|
|
| 1637 | 855 |
\begin{tabular}{@ {}l@ {}}
|
| 1636 | 856 |
\isacommand{nominal\_datatype} {\it trm} =\\
|
857 |
\hspace{5mm}\phantom{$\mid$}\ldots\\
|
|
858 |
\hspace{5mm}$\mid$ Let\;{\it a::assn}\; {\it t::trm}
|
|
859 |
\;\;\isacommand{bind} {\it bn(a)} \isacommand{in} {\it t}\\
|
|
| 1637 | 860 |
\hspace{5mm}$\mid$ Let\_rec\;{\it a::assn}\; {\it t::trm}
|
861 |
\;\;\isacommand{bind} {\it bn(a)} \isacommand{in} {\it t},
|
|
862 |
\isacommand{bind} {\it bn(a)} \isacommand{in} {\it a}\\
|
|
| 1636 | 863 |
\isacommand{and} {\it assn} =\\
|
864 |
\hspace{5mm}\phantom{$\mid$} ANil\\
|
|
865 |
\hspace{5mm}$\mid$ ACons\;{\it name}\;{\it trm}\;{\it assn}\\
|
|
866 |
\isacommand{with} {\it bn::assn $\Rightarrow$ atom list}\\
|
|
867 |
\isacommand{where} $bn(\textrm{ANil}) = []$\\
|
|
868 |
\hspace{5mm}$\mid$ $bn(\textrm{ACons}\;x\;t\;a) = [atom\; x]\; @\; bn(a)$\\
|
|
869 |
\end{tabular}
|
|
870 |
\end{center}
|
|
871 |
||
872 |
\noindent |
|
| 1637 | 873 |
The difference is that with Let we only want to bind the atoms @{text
|
874 |
"bn(a)"} in the term @{text t}, but with Let\_rec we also want to bind the atoms
|
|
875 |
inside the assignment. This requires recursive binders and also has |
|
876 |
consequences for the free variable function and alpha-equivalence relation, |
|
877 |
which we are going to explain in the rest of this section. |
|
878 |
||
879 |
Having dealt with all syntax matters, the problem now is how we can turn |
|
880 |
specifications into actual type definitions in Isabelle/HOL and then |
|
881 |
establish a reasoning infrastructure for them. Because of the problem |
|
882 |
Pottier and Cheney pointed out, we cannot in general re-arrange arguments of |
|
883 |
term-constructors so that binders and their bodies are next to each other, and |
|
884 |
then use the type constructors @{text "abs_set"}, @{text "abs_res"} and
|
|
885 |
@{text "abs_list"} from Section \ref{sec:binders}. Therefore we will first
|
|
886 |
extract datatype definitions from the specification and then define an |
|
887 |
alpha-equiavlence relation over them. |
|
888 |
||
889 |
||
890 |
The datatype definition can be obtained by just stripping off the |
|
891 |
binding clauses and the labels on the types. We also have to invent |
|
892 |
new names for the types @{text "ty\<^sup>\<alpha>"} and term-constructors @{text "C\<^sup>\<alpha>"}
|
|
893 |
given by user. In our implementation we just use an affix like |
|
| 1636 | 894 |
|
895 |
\begin{center}
|
|
| 1637 | 896 |
@{text "ty\<^sup>\<alpha> \<mapsto> ty_raw"} \hspace{7mm} @{text "C\<^sup>\<alpha> \<mapsto> C_raw"}
|
| 1636 | 897 |
\end{center}
|
898 |
||
899 |
\noindent |
|
| 1637 | 900 |
The resulting datatype definition is legal in Isabelle/HOL provided the datatypes are |
901 |
non-empty and the types in the constructors only occur in positive |
|
902 |
position (see \cite{} for an indepth explanataion of the datatype package
|
|
903 |
in Isabelle/HOL). We then define the user-specified binding |
|
904 |
functions by primitive recursion over the raw datatypes. We can also |
|
905 |
easily define a permutation operation by primitive recursion so that for each |
|
906 |
term constructor @{text "C_raw ty\<^isub>1 \<dots> ty\<^isub>n"} we have that
|
|
| 1587 | 907 |
|
| 1628 | 908 |
\begin{center}
|
| 1637 | 909 |
@{text "p \<bullet> (C_raw x\<^isub>1 \<dots> x\<^isub>n) \<equiv> C_raw (p \<bullet> x\<^isub>1) \<dots> (p \<bullet> x\<^isub>n)"}
|
| 1628 | 910 |
\end{center}
|
911 |
||
912 |
\noindent |
|
| 1637 | 913 |
From this definition we can easily show that the raw datatypes are |
914 |
all permutation types (Def ??) by a simple structural induction over |
|
915 |
the @{text "ty_raw"}s.
|
|
916 |
||
917 |
The first non-trivial step we have to perform is the generatation free-variable |
|
918 |
functions from the specifications. Given types @{text "ty\<^isub>1, \<dots>, ty\<^isub>n"}
|
|
919 |
we need to define the free-variable functions |
|
920 |
||
921 |
\begin{center}
|
|
922 |
@{text "fv_ty\<^isub>1 :: ty\<^isub>1 \<Rightarrow> atom set \<dots> fv_ty\<^isub>n :: ty\<^isub>n \<Rightarrow> atom set"}
|
|
923 |
\end{center}
|
|
924 |
||
925 |
\noindent |
|
926 |
and given binding functions @{text "bn_ty\<^isub>1, \<dots>, bn_ty\<^isub>m"} we also need to define
|
|
927 |
the free-variable functions |
|
| 1628 | 928 |
|
| 1637 | 929 |
\begin{center}
|
930 |
@{text "fv_bn_ty\<^isub>1 :: ty\<^isub>1 \<Rightarrow> atom set \<dots> fv_bn_ty\<^isub>m :: ty\<^isub>m \<Rightarrow> atom set"}
|
|
931 |
\end{center}
|
|
| 1636 | 932 |
|
| 1637 | 933 |
\noindent |
934 |
The basic idea behind these free-variable functions is to collect all atoms |
|
935 |
that are not bound in a term constructor, but because of the rather |
|
936 |
complicated binding mechanisms the details are somewhat involved. |
|
937 |
||
938 |
Given a term-constructor @{text "C_raw ty\<^isub>1 \<dots> ty\<^isub>n"}, of type @{text ty} together with
|
|
939 |
some binding clauses, the function @{text "fv_ty (C_raw x\<^isub>1 \<dots> x\<^isub>n)"} will be
|
|
940 |
the union of the values defined below for each argument, say @{text "x\<^isub>i"} with type @{text "ty\<^isub>i"}.
|
|
941 |
From the binding clause of this term constructor, we can determine whether the |
|
942 |
argument @{text "x\<^isub>i"} is a shallow or deep binder, and in the latter case also
|
|
943 |
whether it is a recursive or non-recursive of a binder. In these cases the value is: |
|
| 1628 | 944 |
|
945 |
\begin{center}
|
|
| 1636 | 946 |
\begin{tabular}{cp{7cm}}
|
947 |
$\bullet$ & @{term "{}"} provided @{text "x\<^isub>i"} is a shallow binder\\
|
|
948 |
$\bullet$ & @{text "fv_bn_ty\<^isub>i x\<^isub>i"} provided @{text "x\<^isub>i"} is a deep non-recursive binder\\
|
|
949 |
$\bullet$ & @{text "fv_ty\<^isub>i x\<^isub>i - bn_ty\<^isub>i x\<^isub>i"} provided @{text "x\<^isub>i"} is a deep recursive binder\\
|
|
| 1628 | 950 |
\end{tabular}
|
951 |
\end{center}
|
|
952 |
||
| 1636 | 953 |
\noindent |
| 1637 | 954 |
In case the argument @{text "x\<^isub>i"} is not a binder, it might be a body of
|
955 |
one or more abstractions. There are two cases: either the |
|
| 1636 | 956 |
corresponding binders are all shallow or there is a single deep binder. |
957 |
In the former case we build the union of all shallow binders; in the |
|
958 |
later case we just take set or list of atoms the specified binding |
|
| 1637 | 959 |
function returns. Let @{text "bnds"} be an abbreviation of the bound
|
960 |
atoms. Then the value is given by: |
|
| 1636 | 961 |
|
962 |
\begin{center}
|
|
963 |
\begin{tabular}{cp{7cm}}
|
|
964 |
$\bullet$ & @{text "{atom x\<^isub>i} - bnds"} provided @{term "x\<^isub>i"} is an atom\\
|
|
965 |
$\bullet$ & @{text "(atoms x\<^isub>i) - bnds"} provided @{term "x\<^isub>i"} is a set of atoms\\
|
|
| 1657 | 966 |
$\bullet$ & @{text "(atoms (set x\<^isub>i)) - bnds"} provided @{term "x\<^isub>i"} is a list of atoms\\
|
| 1636 | 967 |
$\bullet$ & @{text "(fv_ty\<^isub>i x\<^isub>i) - bnds"} provided @{term "ty\<^isub>i"} is a nominal datatype\\
|
968 |
$\bullet$ & @{term "{}"} otherwise
|
|
969 |
\end{tabular}
|
|
970 |
\end{center}
|
|
| 1628 | 971 |
|
| 1636 | 972 |
\noindent |
| 1637 | 973 |
If the argument is neither a binder, nor a body of an abstraction, then the |
974 |
value is defined as above, except that @{text "bnds"} is empty. i.e.~no atoms
|
|
| 1636 | 975 |
are abstracted. |
| 1628 | 976 |
|
| 1637 | 977 |
TODO |
978 |
||
979 |
Given a clause of a binding function of the form |
|
980 |
||
981 |
\begin{center}
|
|
982 |
@{text "bn_ty (C_raw x\<^isub>1 \<dots> x\<^isub>n) = rhs"}
|
|
983 |
\end{center}
|
|
984 |
||
985 |
\noindent |
|
986 |
then the corresponding free-variable function @{text "fv_bn_ty\<^isub>i"} is the
|
|
987 |
union of the values calculated for the @{text "x\<^isub>j"} as follows:
|
|
988 |
||
989 |
\begin{center}
|
|
990 |
\begin{tabular}{cp{7cm}}
|
|
991 |
$\bullet$ & @{text "{}"} provided @{term "x\<^isub>j"} occurs in @{text "rhs"} and is an atom\\
|
|
992 |
$\bullet$ & @{text "fv_bn_ty x\<^isub>j"} provided @{term "x\<^isub>j"} occurs in @{text "rhs"}
|
|
993 |
with the recursive call @{text "bn_ty x\<^isub>j"}\\
|
|
994 |
$\bullet$ & @{text "(atoms x\<^isub>i) - bnds"} provided @{term "x\<^isub>i"} is a set of atoms\\
|
|
995 |
$\bullet$ & @{text "(atoml x\<^isub>i) - bnds"} provided @{term "x\<^isub>i"} is a list of atoms\\
|
|
996 |
$\bullet$ & @{text "(fv_ty\<^isub>i x\<^isub>i) - bnds"} provided @{term "ty\<^isub>i"} is a nominal datatype\\
|
|
997 |
$\bullet$ & @{term "{}"} otherwise
|
|
998 |
\end{tabular}
|
|
999 |
\end{center}
|
|
1000 |
||
| 1587 | 1001 |
*} |
1002 |
||
| 1637 | 1003 |
section {* The Lifting of Definitions and Properties *}
|
| 1587 | 1004 |
|
1005 |
text {*
|
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1006 |
Restrictions |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1007 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1008 |
\begin{itemize}
|
| 1572 | 1009 |
\item non-emptiness |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1010 |
\item positive datatype definitions |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1011 |
\item finitely supported abstractions |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1012 |
\item respectfulness of the bn-functions\bigskip |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1013 |
\item binders can only have a ``single scope'' |
| 1577 | 1014 |
\item all bindings must have the same mode |
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1015 |
\end{itemize}
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1016 |
*} |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1017 |
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
1018 |
section {* Examples *}
|
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
1019 |
|
|
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
|
1020 |
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
|
1021 |
|
|
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
|
1022 |
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
|
1023 |
|
| 1570 | 1024 |
text {*
|
1025 |
Ott is better with list dot specifications; subgrammars |
|
1026 |
||
1027 |
untyped; |
|
1028 |
||
1029 |
*} |
|
1030 |
||
1031 |
||
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
1032 |
section {* Conclusion *}
|
|
1485
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
1033 |
|
|
c004e7448dca
temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents:
1484
diff
changeset
|
1034 |
text {*
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1035 |
Complication when the single scopedness restriction is lifted (two |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1036 |
overlapping permutations) |
| 1662 | 1037 |
|
1038 |
||
1039 |
The formalisation presented here will eventually become part of the |
|
1040 |
Isabelle distribution, but for the moment it can be downloaded from |
|
1041 |
the Mercurial repository linked at |
|
1042 |
\href{http://isabelle.in.tum.de/nominal/download}
|
|
1043 |
{http://isabelle.in.tum.de/nominal/download}.\medskip
|
|
|
1520
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1044 |
*} |
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1045 |
|
|
6ac75fd979d4
more of the introduction
Christian Urban <urbanc@in.tum.de>
parents:
1517
diff
changeset
|
1046 |
text {*
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
1047 |
|
|
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
|
1048 |
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
|
1049 |
\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
|
1050 |
|
|
1493
52f68b524fd2
slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents:
1491
diff
changeset
|
1051 |
\noindent |
|
1528
d6ee4a1b34ce
more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents:
1524
diff
changeset
|
1052 |
{\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
|
1053 |
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
|
1054 |
making the informal notes \cite{SewellBestiary} available to us and
|
| 1556 | 1055 |
also for patiently explaining some of the finer points about the abstract |
| 1545 | 1056 |
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
|
1057 |
|
| 1577 | 1058 |
Lookup: Merlin paper by James Cheney; Mark Shinwell PhD |
|
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1059 |
|
| 1577 | 1060 |
Future work: distinct list abstraction |
1061 |
||
1062 |
||
|
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1063 |
*} |
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1064 |
|
| 1484 | 1065 |
|
1066 |
||
|
754
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1067 |
(*<*) |
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1068 |
end |
|
b85875d65b10
added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
|
1069 |
(*>*) |