LMCS-Paper/Paper.thy
changeset 3010 e842807d8268
parent 3009 41c1e98c686f
child 3011 a33e96e62a2b
equal deleted inserted replaced
3009:41c1e98c686f 3010:e842807d8268
   662   atoms; moreover there must be a permutation @{text \<pi>} such that {\it
   662   atoms; moreover there must be a permutation @{text \<pi>} such that {\it
   663   (ii)} @{text \<pi>} leaves the free atoms of @{text x} and @{text y} unchanged, but
   663   (ii)} @{text \<pi>} leaves the free atoms of @{text x} and @{text y} unchanged, but
   664   {\it (iii)} ``moves'' their bound names so that we obtain modulo a relation,
   664   {\it (iii)} ``moves'' their bound names so that we obtain modulo a relation,
   665   say \mbox{@{text "_ R _"}}, two equivalent terms. We also require that {\it (iv)}
   665   say \mbox{@{text "_ R _"}}, two equivalent terms. We also require that {\it (iv)}
   666   @{text \<pi>} makes the sets of abstracted atoms @{text as} and @{text bs} equal. The
   666   @{text \<pi>} makes the sets of abstracted atoms @{text as} and @{text bs} equal. The
   667   requirements {\it (i)} to {\it (iv)} can be stated formally as the conjunction of:
   667   requirements {\it (i)} to {\it (iv)} can be stated formally as:
   668 
   668 
   669   \begin{defi}[Alpha-Equivalence for Set-Bindings]\label{alphaset}\mbox{}\\
   669   \begin{defi}[Alpha-Equivalence for Set-Bindings]\label{alphaset}\mbox{}\\
   670   \begin{tabular}{@ {\hspace{10mm}}l@ {\hspace{5mm}}rl}  
   670   \begin{tabular}{@ {\hspace{10mm}}l@ {\hspace{5mm}}rl}  
   671   @{term "alpha_set_ex (as, x) R fa (bs, y)"}\hspace{2mm}@{text "\<equiv>"} & 
   671   @{term "alpha_set_ex (as, x) R fa (bs, y)"}\hspace{2mm}@{text "\<equiv>"} & 
   672     \multicolumn{2}{@ {}l}{if there exists a @{text "\<pi>"} such that:}\\ 
   672     \multicolumn{2}{@ {}l}{if there exists a @{text "\<pi>"} such that:}\\ 
   897   This is because for every finite sets of atoms, say @{text "bs"}, we have 
   897   This is because for every finite sets of atoms, say @{text "bs"}, we have 
   898   @{thm (concl) supp_finite_atom_set[where S="bs", no_vars]}.
   898   @{thm (concl) supp_finite_atom_set[where S="bs", no_vars]}.
   899   Finally, taking \eqref{halfone} and \eqref{halftwo} together establishes 
   899   Finally, taking \eqref{halfone} and \eqref{halftwo} together establishes 
   900   the first equation of Theorem~\ref{suppabs}. 
   900   the first equation of Theorem~\ref{suppabs}. 
   901 
   901 
       
   902   Recall the definition of support \eqref{suppdef}, and note the difference between 
       
   903   the support of a ``raw'' pair and an abstraction
       
   904 
       
   905   \[
       
   906   @{term "supp (as, x) = supp as \<union> supp x"}\hspace{15mm}
       
   907   @{term "supp (Abs_set as x) = supp x - as"}
       
   908   \]\smallskip
       
   909 
       
   910   \noindent
       
   911   While the permutation operations behave in both cases the same (the permutation
       
   912   is just moved to the arguments), the notion of equality is different for pairs and
       
   913   abstractions. Therefore we have different supports.
       
   914 
   902   The method of first considering abstractions of the form @{term "Abs_set as
   915   The method of first considering abstractions of the form @{term "Abs_set as
   903   x"} etc is motivated by the fact that we can conveniently establish at the
   916   x"} etc is motivated by the fact that we can conveniently establish at the
   904   Isabelle/HOL level properties about them.  It would be extremely laborious
   917   Isabelle/HOL level properties about them.  It would be extremely laborious
   905   to write custom ML-code that derives automatically such properties for every
   918   to write custom ML-code that derives automatically such properties for every
   906   term-constructor that binds some atoms. Also the generality of the
   919   term-constructor that binds some atoms. Also the generality of the
  1020 
  1033 
  1021   For binders we distinguish between \emph{shallow} and \emph{deep} binders.
  1034   For binders we distinguish between \emph{shallow} and \emph{deep} binders.
  1022   Shallow binders are just labels. The restriction we need to impose on them
  1035   Shallow binders are just labels. The restriction we need to impose on them
  1023   is that in case of \isacommand{binds (set)} and \isacommand{binds (set+)} the
  1036   is that in case of \isacommand{binds (set)} and \isacommand{binds (set+)} the
  1024   labels must either refer to atom types or to sets of atom types; in case of
  1037   labels must either refer to atom types or to sets of atom types; in case of
  1025   \isacommand{binds} the labels must refer to atom types or lists of atom
  1038   \isacommand{binds} the labels must refer to atom types or to lists of atom
  1026   types. Two examples for the use of shallow binders are the specification of
  1039   types. Two examples for the use of shallow binders are the specification of
  1027   lambda-terms, where a single name is bound, and type-schemes, where a finite
  1040   lambda-terms, where a single name is bound, and type-schemes, where a finite
  1028   set of names is bound:
  1041   set of names is bound:
  1029 
  1042 
  1030   \[\mbox{
  1043   \[\mbox{
  1031   \begin{tabular}{@ {}c@ {\hspace{5mm}}c@ {}}
  1044   \begin{tabular}{@ {}c@ {\hspace{8mm}}c@ {}}
  1032   \begin{tabular}{@ {}l}
  1045   \begin{tabular}{@ {}l}
  1033   \isacommand{nominal\_datatype} @{text lam} $=$\\
  1046   \isacommand{nominal\_datatype} @{text lam} $=$\\
  1034   \hspace{2mm}\phantom{$\mid$}~@{text "Var name"}\\
  1047   \hspace{2mm}\phantom{$\mid$}~@{text "Var name"}\\
  1035   \hspace{2mm}$\mid$~@{text "App lam lam"}\\
  1048   \hspace{2mm}$\mid$~@{text "App lam lam"}\\
  1036   \hspace{2mm}$\mid$~@{text "Lam x::name t::lam"}\hspace{3mm}%
  1049   \hspace{2mm}$\mid$~@{text "Lam x::name t::lam"}\hspace{3mm}%
  1037   \isacommand{binds} @{text x} \isacommand{in} @{text t}\\
  1050   \isacommand{binds} @{text x} \isacommand{in} @{text t}\\
       
  1051   \\
  1038   \end{tabular} &
  1052   \end{tabular} &
  1039   \begin{tabular}{@ {}l@ {}}
  1053   \begin{tabular}{@ {}l@ {}}
  1040   \isacommand{nominal\_datatype}~@{text ty} $=$\\
  1054   \isacommand{nominal\_datatype}~@{text ty} $=$\\
  1041   \hspace{5mm}\phantom{$\mid$}~@{text "TVar name"}\\
  1055   \hspace{2mm}\phantom{$\mid$}~@{text "TVar name"}\\
  1042   \hspace{5mm}$\mid$~@{text "TFun ty ty"}\\
  1056   \hspace{2mm}$\mid$~@{text "TFun ty ty"}\\
  1043   \isacommand{and}~@{text "tsc = All xs::(name fset) T::ty"}\hspace{3mm}%
  1057   \isacommand{and}~@{text "tsc ="}\\
       
  1058   \hspace{2mm}\phantom{$\mid$}~@{text "TAll xs::(name fset) T::ty"}\hspace{3mm}%
  1044   \isacommand{binds (set+)} @{text xs} \isacommand{in} @{text T}\\
  1059   \isacommand{binds (set+)} @{text xs} \isacommand{in} @{text T}\\
  1045   \end{tabular}
  1060   \end{tabular}
  1046   \end{tabular}}
  1061   \end{tabular}}
  1047   \]\smallskip
  1062   \]\smallskip
  1048 
  1063 
  1174   \hspace{5mm}$\mid$~@{text "bn(ACons' x y t as) = [atom x] @ bn(as)"}\\
  1189   \hspace{5mm}$\mid$~@{text "bn(ACons' x y t as) = [atom x] @ bn(as)"}\\
  1175   \end{tabular}}
  1190   \end{tabular}}
  1176   \end{equation}\smallskip
  1191   \end{equation}\smallskip
  1177 
  1192 
  1178   \noindent
  1193   \noindent
  1179   In this example the term constructor @{text "ACons'"} contains a binding 
  1194   In this example the term constructor @{text "ACons'"} has four arguments and
  1180   clause, and also is used in the definition of the binding function. The
  1195   contains a binding clause. This constructor is also used in the definition
  1181   restriction we have to impose is that the binding function can only return
  1196   of the binding function. The restriction we have to impose is that the
  1182   free atoms, that is the ones that are not mentioned in a binding clause.
  1197   binding function can only return free atoms, that is the ones that are not
  1183   Therefore @{text "y"} cannot be used in the binding function @{text "bn"}
  1198   mentioned in a binding clause.  Therefore @{text "y"} cannot be used in the
  1184   (since it is bound in @{text "ACons'"} by the binding clause), but @{text x}
  1199   binding function @{text "bn"} (since it is bound in @{text "ACons'"} by the
  1185   can (since it is a free atom). This restriction is sufficient for lifting 
  1200   binding clause), but @{text x} can (since it is a free atom). This
  1186   the binding function to alpha-equated terms. If we would permit that @{text "bn"}
  1201   restriction is sufficient for lifting the binding function to alpha-equated
  1187   can also return @{text "y"}, then it would not be respectful and therefore
  1202   terms. If we would permit that @{text "bn"} can also return @{text "y"},
  1188   cannot be lifted.
  1203   then it would not be respectful and therefore cannot be lifted.
  1189 
  1204 
  1190   In the version of Nominal Isabelle described here, we also adopted the
  1205   In the version of Nominal Isabelle described here, we also adopted the
  1191   restriction from the Ott-tool that binding functions can only return: the
  1206   restriction from the Ott-tool that binding functions can only return: the
  1192   empty set or empty list (as in case @{text ANil'}), a singleton set or
  1207   empty set or empty list (as in case @{text ANil'}), a singleton set or
  1193   singleton list containing an atom (case @{text PVar} in \eqref{letpat}), or
  1208   singleton list containing an atom (case @{text PVar} in \eqref{letpat}), or
  1497   {@{text "prems(bc\<^isub>1) \<dots> prems(bc\<^isub>k)"}}} 
  1512   {@{text "prems(bc\<^isub>1) \<dots> prems(bc\<^isub>k)"}}} 
  1498   \]\smallskip
  1513   \]\smallskip
  1499 
  1514 
  1500   \noindent
  1515   \noindent
  1501   The task below is to specify what the premises corresponding to a binding
  1516   The task below is to specify what the premises corresponding to a binding
  1502   clause are. To understand better whet the general pattern is, let us first 
  1517   clause are. To understand better what the general pattern is, let us first 
  1503   treat the special instance where @{text "bc\<^isub>i"} is the empty binding clause 
  1518   treat the special instance where @{text "bc\<^isub>i"} is the empty binding clause 
  1504   of the form
  1519   of the form
  1505 
  1520 
  1506   \[
  1521   \[
  1507   \mbox{\isacommand{binds (set)} @{term "{}"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}.}
  1522   \mbox{\isacommand{binds (set)} @{term "{}"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}.}
  1508   \]\smallskip
  1523   \]\smallskip
  1509 
  1524 
  1510   \noindent
  1525   \noindent
  1511   In this binding clause no atom is bound and we only have to `alpha-relate' the bodies. For this
  1526   In this binding clause no atom is bound and we only have to `alpha-relate'
  1512   we build first the tuples @{text "D \<equiv> (d\<^isub>1,\<dots>, d\<^isub>q)"} and @{text "D' \<equiv> (d\<PRIME>\<^isub>1,\<dots>, d\<PRIME>\<^isub>q)"}  
  1527   the bodies. For this we build first the tuples @{text "D \<equiv> (d\<^isub>1,\<dots>,
  1513   whereby the labels @{text "d"}$_{1..q}$ refer to arguments @{text "z"}$_{1..n}$ and
  1528   d\<^isub>q)"} and @{text "D' \<equiv> (d\<PRIME>\<^isub>1,\<dots>, d\<PRIME>\<^isub>q)"}
  1514   respectively @{text "d\<PRIME>"}$_{1..q}$ to @{text "z\<PRIME>"}$_{1..n}$. In order to relate
  1529   whereby the labels @{text "d"}$_{1..q}$ refer to the arguments @{text
  1515   two such tuples we define the compound alpha-equivalence relation @{text "R"} as follows
  1530   "z"}$_{1..n}$ and respectively @{text "d\<PRIME>"}$_{1..q}$ to @{text
  1516   
  1531   "z\<PRIME>"}$_{1..n}$ of the term-constructor. In order to relate two such
       
  1532   tuples we define the compound alpha-equivalence relation @{text "R"} as
       
  1533   follows
       
  1534 
  1517   \begin{equation}\label{rempty}
  1535   \begin{equation}\label{rempty}
  1518   \mbox{@{text "R \<equiv> (R\<^isub>1,\<dots>, R\<^isub>q)"}}
  1536   \mbox{@{text "R \<equiv> (R\<^isub>1,\<dots>, R\<^isub>q)"}}
  1519   \end{equation}
  1537   \end{equation}\smallskip
  1520 
  1538 
  1521   \noindent
  1539   \noindent
  1522   with @{text "R\<^isub>i"} being @{text "\<approx>ty\<^isub>i"} if the corresponding labels @{text "d\<^isub>i"} and 
  1540   with @{text "R\<^isub>i"} being @{text "\<approx>ty\<^isub>i"} if the corresponding
  1523   @{text "d\<PRIME>\<^isub>i"} refer
  1541   labels @{text "d\<^isub>i"} and @{text "d\<PRIME>\<^isub>i"} refer to a
  1524   to a recursive argument of @{text C} with type @{text "ty\<^isub>i"}; otherwise
  1542   recursive argument of @{text C} with type @{text "ty\<^isub>i"}; otherwise
  1525   we take @{text "R\<^isub>i"} to be the equality @{text "="}. This lets us define
  1543   we take @{text "R\<^isub>i"} to be the equality @{text "="}. Again the
  1526   the premise for an empty binding clause succinctly as @{text "prems(bc\<^isub>i) \<equiv> D R D'"},
  1544   latter is because @{text "ty\<^isub>i"} is not part of the specified types
  1527   which can be unfolded to the series of premises
  1545   and alpha-equivalence of any previously defined type is supposed to coincide
  1528   
  1546   with equality.  This lets us now define the premise for an empty binding
  1529   \begin{center}
  1547   clause succinctly as @{text "prems(bc\<^isub>i) \<equiv> D R D'"}, which can be
       
  1548   unfolded to the series of premises
       
  1549   
       
  1550   \[
  1530   @{text "d\<^isub>1 R\<^isub>1 d\<PRIME>\<^isub>1  \<dots> d\<^isub>q R\<^isub>q d\<PRIME>\<^isub>q"}.
  1551   @{text "d\<^isub>1 R\<^isub>1 d\<PRIME>\<^isub>1  \<dots> d\<^isub>q R\<^isub>q d\<PRIME>\<^isub>q"}.
  1531   \end{center}
  1552   \]\smallskip
  1532   
  1553   
  1533   \noindent
  1554   \noindent
  1534   We will use the unfolded version in the examples below.
  1555   We will use the unfolded version in the examples below.
  1535 
  1556 
  1536   Now suppose the binding clause @{text "bc\<^isub>i"} is of the general form 
  1557   Now suppose the binding clause @{text "bc\<^isub>i"} is of the general form 
  1537   
  1558   
  1538   \begin{equation}\label{nonempty}
  1559   \begin{equation}\label{nonempty}
  1539   \mbox{\isacommand{binds (set)} @{text "b\<^isub>1\<dots>b\<^isub>p"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}.}
  1560   \mbox{\isacommand{binds (set)} @{text "b\<^isub>1\<dots>b\<^isub>p"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}.}
  1540   \end{equation}
  1561   \end{equation}\smallskip
  1541 
  1562 
  1542   \noindent
  1563   \noindent
  1543   In this case we define a premise @{text P} using the relation
  1564   In this case we define a premise @{text P} using the relation
  1544   $\approx_{\,\textit{set}}$ given in Section~\ref{sec:binders} (similarly
  1565   $\approx_{\,\textit{set}}$ given in Section~\ref{sec:binders} (similarly
  1545   $\approx_{\,\textit{set+}}$ and $\approx_{\,\textit{list}}$ for the other
  1566   $\approx_{\,\textit{set+}}$ and $\approx_{\,\textit{list}}$ for the other
  1548   @{text "D'"} for the bodies @{text "d"}$_{1..q}$, and the corresponding
  1569   @{text "D'"} for the bodies @{text "d"}$_{1..q}$, and the corresponding
  1549   compound alpha-relation @{text "R"} (shown in \eqref{rempty}). 
  1570   compound alpha-relation @{text "R"} (shown in \eqref{rempty}). 
  1550   For $\approx_{\,\textit{set}}$  we also need
  1571   For $\approx_{\,\textit{set}}$  we also need
  1551   a compound free-atom function for the bodies defined as
  1572   a compound free-atom function for the bodies defined as
  1552   
  1573   
  1553   \begin{center}
  1574   \[
  1554   \mbox{@{text "fa \<equiv> (fa_ty\<^isub>1,\<dots>, fa_ty\<^isub>q)"}}
  1575   \mbox{@{text "fa \<equiv> (fa_ty\<^isub>1,\<dots>, fa_ty\<^isub>q)"}}
  1555   \end{center}
  1576   \]\smallskip
  1556 
  1577 
  1557   \noindent
  1578   \noindent
  1558   with the assumption that the @{text "d"}$_{1..q}$ refer to arguments of types @{text "ty"}$_{1..q}$.
  1579   with the assumption that the @{text "d"}$_{1..q}$ refer to arguments of types @{text "ty"}$_{1..q}$.
  1559   The last ingredient we need are the sets of atoms bound in the bodies.
  1580   The last ingredient we need are the sets of atoms bound in the bodies.
  1560   For this we take
  1581   For this we take
  1561 
  1582 
  1562   \begin{center}
  1583   \[
  1563   @{text "B \<equiv> bn_ty\<^isub>1 b\<^isub>1 \<union> \<dots> \<union> bn_ty\<^isub>p b\<^isub>p"}\;.\\
  1584   @{text "B \<equiv> bn_ty\<^isub>1 b\<^isub>1 \<union> \<dots> \<union> bn_ty\<^isub>p b\<^isub>p"}\;.\\
  1564   \end{center}
  1585   \]\smallskip
  1565 
  1586 
  1566   \noindent
  1587   \noindent
  1567   Similarly for @{text "B'"} using the labels @{text "b\<PRIME>"}$_{1..p}$. This 
  1588   Similarly for @{text "B'"} using the labels @{text "b\<PRIME>"}$_{1..p}$. This 
  1568   lets us formally define the premise @{text P} for a non-empty binding clause as:
  1589   lets us formally define the premise @{text P} for a non-empty binding clause as:
  1569   
  1590   
  1570   \begin{center}
  1591   \[
  1571   \mbox{@{term "P \<equiv> alpha_set_ex (B, D) R fa (B', D')"}}\;.
  1592   \mbox{@{term "P \<equiv> alpha_set_ex (B, D) R fa (B', D')"}}\;.
  1572   \end{center}
  1593   \]\smallskip
  1573 
  1594 
  1574   \noindent
  1595   \noindent
  1575   This premise accounts for alpha-equivalence of the bodies of the binding
  1596   This premise accounts for alpha-equivalence of the bodies of the binding
  1576   clause. 
  1597   clause. However, in case the binders have non-recursive deep binders, this
  1577   However, in case the binders have non-recursive deep binders, this premise
  1598   premise is not enough: we also have to ``propagate'' alpha-equivalence
  1578   is not enough:
  1599   inside the structure of these binders. An example is @{text "Let"} where we
  1579   we also have to ``propagate'' alpha-equivalence inside the structure of
  1600   have to make sure the right-hand sides of assignments are
  1580   these binders. An example is @{text "Let"} where we have to make sure the
  1601   alpha-equivalent. For this we use relations @{text "\<approx>bn"}$_{1..m}$ (which we
  1581   right-hand sides of assignments are alpha-equivalent. For this we use 
  1602   will formally define shortly).  Let us assume the non-recursive deep binders
  1582   relations @{text "\<approx>bn"}$_{1..m}$ (which we will formally define shortly).
  1603   in @{text "bc\<^isub>i"} are
  1583   Let us assume the non-recursive deep binders in @{text "bc\<^isub>i"} are
  1604   
  1584   
  1605   \[
  1585   \begin{center}
       
  1586   @{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}.
  1606   @{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}.
  1587   \end{center}
  1607   \]\smallskip
  1588   
  1608   
  1589   \noindent
  1609   \noindent
  1590   The tuple @{text L} is then @{text "(l\<^isub>1,\<dots>,l\<^isub>r)"} (similarly @{text "L'"})
  1610   The tuple @{text L} consists then of all these binders @{text "(l\<^isub>1,\<dots>,l\<^isub>r)"} 
  1591   and the compound equivalence relation @{text "R'"} is @{text "(\<approx>bn\<^isub>1,\<dots>,\<approx>bn\<^isub>r)"}. 
  1611   (similarly @{text "L'"}) and the compound equivalence relation @{text "R'"} 
  1592   All premises for @{text "bc\<^isub>i"} are then given by
  1612   is @{text "(\<approx>bn\<^isub>1,\<dots>,\<approx>bn\<^isub>r)"}.  All premises for @{text "bc\<^isub>i"} are then given by
  1593   
  1613   
  1594   \begin{center}
  1614   \[
  1595   @{text "prems(bc\<^isub>i) \<equiv> P  \<and>   L R' L'"}
  1615   @{text "prems(bc\<^isub>i) \<equiv> P  \<and>   L R' L'"}
  1596   \end{center} 
  1616   \]\smallskip
  1597 
  1617 
  1598   \noindent 
  1618   \noindent 
  1599   The auxiliary alpha-equivalence relations @{text "\<approx>bn"}$_{1..m}$ 
  1619   The auxiliary alpha-equivalence relations @{text "\<approx>bn"}$_{1..m}$ 
  1600   in @{text "R'"} are defined as follows: assuming a @{text bn}-clause is of the form
  1620   in @{text "R'"} are defined as follows: assuming a @{text bn}-clause is of the form
  1601   
  1621   
  1602   \begin{center}
  1622   \[
  1603   @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
  1623   @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
  1604   \end{center}
  1624   \]\smallskip
  1605   
  1625   
  1606   \noindent
  1626   \noindent
  1607   where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$,
  1627   where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$,
  1608   then the corresponding alpha-equivalence clause for @{text "\<approx>bn"} has the form
  1628   then the corresponding alpha-equivalence clause for @{text "\<approx>bn"} has the form
  1609   
  1629   
  1610   \begin{center}
  1630   \[
  1611   \mbox{\infer{@{text "C z\<^isub>1 \<dots> z\<^isub>s \<approx>bn C z\<PRIME>\<^isub>1 \<dots> z\<PRIME>\<^isub>s"}}
  1631   \mbox{\infer{@{text "C z\<^isub>1 \<dots> z\<^isub>s \<approx>bn C z\<PRIME>\<^isub>1 \<dots> z\<PRIME>\<^isub>s"}}
  1612   {@{text "z\<^isub>1 R\<^isub>1 z\<PRIME>\<^isub>1 \<dots> z\<^isub>s R\<^isub>s z\<PRIME>\<^isub>s"}}}
  1632   {@{text "z\<^isub>1 R\<^isub>1 z\<PRIME>\<^isub>1 \<dots> z\<^isub>s R\<^isub>s z\<PRIME>\<^isub>s"}}}
  1613   \end{center}
  1633   \]\smallskip
  1614   
  1634   
  1615   \noindent
  1635   \noindent
  1616   In this clause the relations @{text "R"}$_{1..s}$ are given by 
  1636   In this clause the relations @{text "R"}$_{1..s}$ are given by 
  1617 
  1637 
  1618   \begin{center}
  1638   \[\mbox{
  1619   \begin{tabular}{c@ {\hspace{2mm}}p{0.9\textwidth}}
  1639   \begin{tabular}{c@ {\hspace{2mm}}p{0.9\textwidth}}
  1620   $\bullet$ & @{text "z\<^isub>i \<approx>ty z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs} and 
  1640   $\bullet$ & @{text "z\<^isub>i \<approx>ty z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs} and 
  1621   is a recursive argument of @{text C},\\
  1641   is a recursive argument of @{text C},\smallskip\\
  1622   $\bullet$ & @{text "z\<^isub>i = z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs}
  1642   $\bullet$ & @{text "z\<^isub>i = z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs}
  1623   and is a non-recursive argument of @{text C},\\
  1643   and is a non-recursive argument of @{text C},\smallskip\\
  1624   $\bullet$ & @{text "z\<^isub>i \<approx>bn\<^isub>i z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} occurs in @{text rhs}
  1644   $\bullet$ & @{text "z\<^isub>i \<approx>bn\<^isub>i z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} occurs in @{text rhs}
  1625   with the recursive call @{text "bn\<^isub>i x\<^isub>i"} and\\
  1645   with the recursive call @{text "bn\<^isub>i x\<^isub>i"} and\smallskip\\
  1626   $\bullet$ & @{text True} provided @{text "z\<^isub>i"} occurs in @{text rhs} but without a
  1646   $\bullet$ & @{text True} provided @{text "z\<^isub>i"} occurs in @{text rhs} but without a
  1627   recursive call.
  1647   recursive call.
  1628   \end{tabular}
  1648   \end{tabular}}
  1629   \end{center}
  1649   \]\smallskip
  1630 
  1650 
  1631   \noindent
  1651   \noindent
  1632   This completes the definition of alpha-equivalence. As a sanity check, we can show
  1652   This completes the definition of alpha-equivalence. As a sanity check, we can show
  1633   that the premises of empty binding clauses are a special case of the clauses for 
  1653   that the premises of empty binding clauses are a special case of the clauses for 
  1634   non-empty ones (we just have to unfold the definition of $\approx_{\,\textit{set}}$ and take @{text "0"}
  1654   non-empty ones (we just have to unfold the definition of $\approx_{\,\textit{set}}$ and take @{text "0"}
  1636 
  1656 
  1637   Again let us take a look at a concrete example for these definitions. For \eqref{letrecs}
  1657   Again let us take a look at a concrete example for these definitions. For \eqref{letrecs}
  1638   we have three relations $\approx_{\textit{trm}}$, $\approx_{\textit{assn}}$ and
  1658   we have three relations $\approx_{\textit{trm}}$, $\approx_{\textit{assn}}$ and
  1639   $\approx_{\textit{bn}}$ with the following clauses:
  1659   $\approx_{\textit{bn}}$ with the following clauses:
  1640 
  1660 
  1641   \begin{center}
  1661   \[\mbox{
  1642   \begin{tabular}{@ {}c @ {}}
  1662   \begin{tabular}{@ {}c @ {}}
  1643   \infer{@{text "Let as t \<approx>\<^bsub>trm\<^esub> Let as' t'"}}
  1663   \infer{@{text "Let as t \<approx>\<^bsub>trm\<^esub> Let as' t'"}}
  1644   {@{term "alpha_lst_ex (bn as, t) alpha_trm fa_trm (bn as', t')"} & @{text "as \<approx>\<^bsub>bn\<^esub> as'"}}\smallskip\\
  1664   {@{term "alpha_lst_ex (bn as, t) alpha_trm fa_trm (bn as', t')"} & 
       
  1665   \hspace{5mm}@{text "as \<approx>\<^bsub>bn\<^esub> as'"}}\\
       
  1666   \\
  1645   \makebox[0mm]{\infer{@{text "Let_rec as t \<approx>\<^bsub>trm\<^esub> Let_rec as' t'"}}
  1667   \makebox[0mm]{\infer{@{text "Let_rec as t \<approx>\<^bsub>trm\<^esub> Let_rec as' t'"}}
  1646   {@{term "alpha_lst_ex (bn as, ast) alpha_trm2 fa_trm2 (bn as', ast')"}}}
  1668   {@{term "alpha_lst_ex (bn as, ast) alpha_trm2 fa_trm2 (bn as', ast')"}}}\\
  1647   \end{tabular}
  1669   \\
  1648   \end{center}
  1670 
  1649 
       
  1650   \begin{center}
       
  1651   \begin{tabular}{@ {}c @ {}}
  1671   \begin{tabular}{@ {}c @ {}}
  1652   \infer{@{text "ANil \<approx>\<^bsub>assn\<^esub> ANil"}}{}\hspace{9mm}
  1672   \infer{@{text "ANil \<approx>\<^bsub>assn\<^esub> ANil"}}{}\hspace{9mm}
  1653   \infer{@{text "ACons a t as \<approx>\<^bsub>assn\<^esub> ACons a' t' as"}}
  1673   \infer{@{text "ACons a t as \<approx>\<^bsub>assn\<^esub> ACons a' t' as"}}
  1654   {@{text "a = a'"} & @{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>assn\<^esub> as'"}}
  1674   {@{text "a = a'"} & \hspace{5mm}@{text "t \<approx>\<^bsub>trm\<^esub> t'"} & \hspace{5mm}@{text "as \<approx>\<^bsub>assn\<^esub> as'"}}
  1655   \end{tabular}
  1675   \end{tabular}\\
  1656   \end{center}
  1676   \\
  1657 
  1677 
  1658   \begin{center}
       
  1659   \begin{tabular}{@ {}c @ {}}
  1678   \begin{tabular}{@ {}c @ {}}
  1660   \infer{@{text "ANil \<approx>\<^bsub>bn\<^esub> ANil"}}{}\hspace{9mm}
  1679   \infer{@{text "ANil \<approx>\<^bsub>bn\<^esub> ANil"}}{}\hspace{9mm}
  1661   \infer{@{text "ACons a t as \<approx>\<^bsub>bn\<^esub> ACons a' t' as"}}
  1680   \infer{@{text "ACons a t as \<approx>\<^bsub>bn\<^esub> ACons a' t' as"}}
  1662   {@{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>bn\<^esub> as'"}}
  1681   {@{text "t \<approx>\<^bsub>trm\<^esub> t'"} & \hspace{5mm}@{text "as \<approx>\<^bsub>bn\<^esub> as'"}}
  1663   \end{tabular}
  1682   \end{tabular}
  1664   \end{center}
  1683   \end{tabular}}
       
  1684   \]\smallskip
  1665 
  1685 
  1666   \noindent
  1686   \noindent
  1667   Note the difference between  $\approx_{\textit{assn}}$ and
  1687   Note the difference between  $\approx_{\textit{assn}}$ and
  1668   $\approx_{\textit{bn}}$: the latter only ``tracks'' alpha-equivalence of 
  1688   $\approx_{\textit{bn}}$: the latter only ``tracks'' alpha-equivalence of 
  1669   the components in an assignment that are \emph{not} bound. This is needed in the 
  1689   the components in an assignment that are \emph{not} bound. This is needed in the 
  1675 *}
  1695 *}
  1676 
  1696 
  1677 section {* Establishing the Reasoning Infrastructure *}
  1697 section {* Establishing the Reasoning Infrastructure *}
  1678 
  1698 
  1679 text {*
  1699 text {*
  1680   Having made all necessary definitions for raw terms, we can start
  1700   Having made all necessary definitions for raw terms, we can start with
  1681   with establishing the reasoning infrastructure for the alpha-equated types
  1701   establishing the reasoning infrastructure for the alpha-equated types @{text
  1682   @{text "ty\<AL>"}$_{1..n}$, that is the types the user originally specified. We sketch
  1702   "ty\<AL>"}$_{1..n}$, that is the types the user originally specified. We
  1683   in this section the proofs we need for establishing this infrastructure. One
  1703   give in this section and the next the proofs we need for establishing this
  1684   main point of our work is that we have completely automated these proofs in Isabelle/HOL.
  1704   infrastructure. One main point of our work is that we have completely
  1685 
  1705   automated these proofs in Isabelle/HOL.
  1686   First we establish that the
  1706 
  1687   alpha-equivalence relations defined in the previous section are 
  1707   First we establish that the free-variable functions, the binding functions and the
       
  1708   alpha-equivalences are equivariant.
       
  1709 
       
  1710   \begin{lem}\mbox{}\\
       
  1711   @{text "(i)"} The functions @{text "fa_ty"}$_{1..n}$, @{text "fa_bn"}$_{1..m}$ and
       
  1712   @{text "bn"}$_{1..m}$ are equivariant.\\
       
  1713   @{text "(ii)"} The relations @{text "\<approx>ty"}$_{1..n}$ and
       
  1714   @{text "\<approx>bn"}$_{1..m}$ are equivariant.
       
  1715   \end{lem}
       
  1716 
       
  1717   \begin{proof}
       
  1718   The function package of Isabelle/HOL allows us to prove the first part is by mutual 
       
  1719   induction over the definitions of the functions. The second is by a straightforward
       
  1720   induction over the rules of @{text "\<approx>ty"}$_{1..n}$ and @{text "\<approx>bn"}$_{1..m}$ using 
       
  1721   the first part.
       
  1722   \end{proof}
       
  1723 
       
  1724   \noindent
       
  1725   Next we establish that the alpha-equivalence relations defined in the
       
  1726   previous section are equivalence relations.
       
  1727 
       
  1728   \begin{lem}\label{equiv} 
       
  1729   The relations @{text "\<approx>ty"}$_{1..n}$ and @{text "\<approx>bn"}$_{1..m}$ are
  1688   equivalence relations.
  1730   equivalence relations.
  1689 
       
  1690   \begin{lem}\label{equiv} 
       
  1691   Given the raw types @{text "ty"}$_{1..n}$ and binding functions
       
  1692   @{text "bn"}$_{1..m}$, the relations @{text "\<approx>ty"}$_{1..n}$ and 
       
  1693   @{text "\<approx>bn"}$_{1..m}$ are equivalence relations. and equivariant.
       
  1694   \end{lem}
  1731   \end{lem}
  1695 
  1732 
  1696   \begin{proof} 
  1733   \begin{proof} 
  1697   The proof is by mutual induction over the definitions. The non-trivial
  1734   The proof is by mutual induction over the definitions. The non-trivial
  1698   cases involve premises built up by $\approx_{\textit{set}}$, 
  1735   cases involve premises built up by $\approx_{\textit{set}}$, 
  1699   $\approx_{\textit{set+}}$ and $\approx_{\textit{list}}$. They 
  1736   $\approx_{\textit{set+}}$ and $\approx_{\textit{list}}$. They 
  1700   can be dealt with as in Lemma~\ref{alphaeq}.
  1737   can be dealt with as in Lemma~\ref{alphaeq}. However, the transitivity
       
  1738   case needs in addition the fact that the relations are equivariant. 
  1701   \end{proof}
  1739   \end{proof}
  1702 
  1740 
  1703   \noindent 
  1741   \noindent 
  1704   We can feed this lemma into our quotient package and obtain new types @{text
  1742   We can feed this lemma into our quotient package and obtain new types @{text
  1705   "ty"}$^\alpha_{1..n}$ representing alpha-equated terms of types @{text "ty"}$_{1..n}$. 
  1743   "ty"}$^\alpha_{1..n}$ representing alpha-equated terms of types @{text "ty"}$_{1..n}$. 
       
  1744   
  1706   We also obtain definitions for the term-constructors @{text
  1745   We also obtain definitions for the term-constructors @{text
  1707   "C"}$^\alpha_{1..k}$ from the raw term-constructors @{text
  1746   "C"}$^\alpha_{1..k}$ from the raw term-constructors @{text "C"}$_{1..k}$,
  1708   "C"}$_{1..k}$, and similar definitions for the free-atom functions @{text
  1747   and similar definitions for the free-atom functions @{text
  1709   "fa_ty"}$^\alpha_{1..n}$ and @{text "fa_bn"}$^\alpha_{1..m}$ as well as the binding functions @{text
  1748   "fa_ty"}$^\alpha_{1..n}$ and @{text "fa_bn"}$^\alpha_{1..m}$ as well as the
  1710   "bn"}$^\alpha_{1..m}$. However, these definitions are not really useful to the 
  1749   binding functions @{text "bn"}$^\alpha_{1..m}$. For this we have to show
       
  1750   by induction over the definitions of alpha-equivalences that the ``raw'' 
       
  1751   functions are respectful. This means we need to establish that
       
  1752 
       
  1753   \[\mbox{
       
  1754   \begin{tabular}{lll}
       
  1755   @{text "x \<approx>ty\<^isub>i x'"} & implies & @{text "fa_ty\<^isub>i x = fa_ty\<^isub>i x'"}\\
       
  1756   @{text "x \<approx>ty\<^isub>l x'"} & implies & @{text "fa_bn\<^isub>j x = fa_bn\<^isub>j x'"}\\
       
  1757   @{text "x \<approx>ty\<^isub>l x'"} & implies & @{text "bn\<^isub>j x = bn\<^isub>j x'"}\\
       
  1758   \end{tabular}
       
  1759   }\]\smallskip
       
  1760   
       
  1761   \noindent
       
  1762   holds whereby @{text "ty\<^isub>l"} is the type over which @{text "bn\<^isub>j"} is defined. A 
       
  1763   similar property is needed for the constructors @{text "C"}$_{1..k}$. In order 
       
  1764   to establish it we need to prove that
       
  1765 
       
  1766   \[\mbox{
       
  1767   \begin{tabular}{lll}
       
  1768   @{text "x \<approx>ty\<^isub>l x'"} & implies & @{text "x \<approx>bn\<^isub>j x'"}\\
       
  1769   \end{tabular}
       
  1770   }\]\smallskip
       
  1771 
       
  1772   \noindent
       
  1773   The respectfulness properties are crucial, ... ???
       
  1774   However, these definitions are not really useful to the 
  1711   user, since they are given in terms of the isomorphisms we obtained by 
  1775   user, since they are given in terms of the isomorphisms we obtained by 
  1712   creating new types in Isabelle/HOL (recall the picture shown in the 
  1776   creating new types in Isabelle/HOL (recall the picture shown in the 
  1713   Introduction).
  1777   Introduction).
  1714 
  1778 
  1715   The first useful property for the user is the fact that distinct 
  1779   The first useful property for the user is the fact that distinct 
  1716   term-constructors are not 
  1780   term-constructors are not 
  1717   equal, that is
  1781   equal, that is
  1718   
  1782   
  1719   \begin{equation}\label{distinctalpha}
  1783   \[\label{distinctalpha}
  1720   \mbox{@{text "C"}$^\alpha$~@{text "x\<^isub>1 \<dots> x\<^isub>r"}~@{text "\<noteq>"}~% 
  1784   \mbox{@{text "C"}$^\alpha$~@{text "x\<^isub>1 \<dots> x\<^isub>r"}~@{text "\<noteq>"}~% 
  1721   @{text "D"}$^\alpha$~@{text "y\<^isub>1 \<dots> y\<^isub>s"}} 
  1785   @{text "D"}$^\alpha$~@{text "y\<^isub>1 \<dots> y\<^isub>s"}} 
  1722   \end{equation}
  1786   \]\smallskip
  1723   
  1787   
  1724   \noindent
  1788   \noindent
  1725   whenever @{text "C"}$^\alpha$~@{text "\<noteq>"}~@{text "D"}$^\alpha$.
  1789   whenever @{text "C"}$^\alpha$~@{text "\<noteq>"}~@{text "D"}$^\alpha$.
  1726   In order to derive this fact, we use the definition of alpha-equivalence
  1790   In order to derive this fact, we use the definition of alpha-equivalence
  1727   and establish that
  1791   and establish that
  1728   
  1792   
  1729   \begin{equation}\label{distinctraw}
  1793   \[\label{distinctraw}
  1730   \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r"}\;$\not\approx$@{text ty}\;@{text "D y\<^isub>1 \<dots> y\<^isub>s"}}
  1794   \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r"}\;$\not\approx$@{text ty}\;@{text "D y\<^isub>1 \<dots> y\<^isub>s"}}
  1731   \end{equation}
  1795   \]\smallskip
  1732 
  1796 
  1733   \noindent
  1797   \noindent
  1734   holds for the corresponding raw term-constructors.
  1798   holds for the corresponding raw term-constructors.
  1735   In order to deduce \eqref{distinctalpha} from \eqref{distinctraw}, our quotient
  1799   In order to deduce \eqref{distinctalpha} from \eqref{distinctraw}, our quotient
  1736   package needs to know that the raw term-constructors @{text "C"} and @{text "D"} 
  1800   package needs to know that the raw term-constructors @{text "C"} and @{text "D"} 
  1772   result is that the lifting of the corresponding binding functions in Ott to alpha-equated
  1836   result is that the lifting of the corresponding binding functions in Ott to alpha-equated
  1773   terms is impossible.
  1837   terms is impossible.
  1774 
  1838 
  1775   Having established respectfulness for the raw term-constructors, the 
  1839   Having established respectfulness for the raw term-constructors, the 
  1776   quotient package is able to automatically deduce \eqref{distinctalpha} from 
  1840   quotient package is able to automatically deduce \eqref{distinctalpha} from 
  1777   \eqref{distinctraw}. Having the facts \eqref{fnresp} at our disposal, we can 
  1841   \eqref{distinctraw}. ??? Having the facts \eqref{fnresp} at our disposal, we can 
  1778   also lift properties that characterise when two raw terms of the form
  1842   also lift properties that characterise when two raw terms of the form
  1779   %
  1843   
  1780   \begin{center}
  1844   \[
  1781   @{text "C x\<^isub>1 \<dots> x\<^isub>r \<approx>ty C x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}
  1845   \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r \<approx>ty C x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}}
  1782   \end{center}
  1846   \]\smallskip
  1783 
  1847 
  1784   \noindent
  1848   \noindent
  1785   are alpha-equivalent. This gives us conditions when the corresponding
  1849   are alpha-equivalent. This gives us conditions when the corresponding
  1786   alpha-equated terms are \emph{equal}, namely
  1850   alpha-equated terms are \emph{equal}, namely
  1787   
  1851   
  1788   \begin{center}
  1852   \[
  1789   @{text "C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r = C\<^sup>\<alpha> x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}.
  1853   @{text "C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r = C\<^sup>\<alpha> x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}.
  1790   \end{center}
  1854   \]\smallskip
  1791   
  1855   
  1792   \noindent
  1856   \noindent
  1793   We call these conditions as \emph{quasi-injectivity}. They correspond to
  1857   We call these conditions as \emph{quasi-injectivity}. They correspond to
  1794   the premises in our alpha-equivalence relations.
  1858   the premises in our alpha-equivalence relations.
  1795 
  1859 
  1801   , which we already established 
  1865   , which we already established 
  1802   in Lemma~\ref{equiv}. 
  1866   in Lemma~\ref{equiv}. 
  1803   As a result we can add the equations
  1867   As a result we can add the equations
  1804   
  1868   
  1805   \begin{equation}\label{calphaeqvt}
  1869   \begin{equation}\label{calphaeqvt}
  1806   @{text "p \<bullet> (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r) = C\<^sup>\<alpha> (p \<bullet> x\<^isub>1) \<dots> (p \<bullet> x\<^isub>r)"}
  1870   @{text "\<pi> \<bullet> (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r) = C\<^sup>\<alpha> (\<pi> \<bullet> x\<^isub>1) \<dots> (\<pi> \<bullet> x\<^isub>r)"}
  1807   \end{equation}
  1871   \end{equation}\smallskip
  1808 
  1872 
  1809   \noindent
  1873   \noindent
  1810   to our infrastructure. In a similar fashion we can lift the defining equations
  1874   to our infrastructure. In a similar fashion we can lift the defining equations
  1811   of the free-atom functions @{text "fn_ty\<AL>"}$_{1..n}$ and
  1875   of the free-atom functions @{text "fn_ty\<AL>"}$_{1..n}$ and
  1812   @{text "fa_bn\<AL>"}$_{1..m}$ as well as of the binding functions @{text
  1876   @{text "fa_bn\<AL>"}$_{1..m}$ as well as of the binding functions @{text
  1819   for the types @{text "ty\<AL>"}$_{1..n}$. The conclusion of the induction principle is
  1883   for the types @{text "ty\<AL>"}$_{1..n}$. The conclusion of the induction principle is
  1820   of the form
  1884   of the form
  1821   
  1885   
  1822   \begin{equation}\label{weakinduct}
  1886   \begin{equation}\label{weakinduct}
  1823   \mbox{@{text "P\<^isub>1 x\<^isub>1 \<and> \<dots> \<and> P\<^isub>n x\<^isub>n "}}
  1887   \mbox{@{text "P\<^isub>1 x\<^isub>1 \<and> \<dots> \<and> P\<^isub>n x\<^isub>n "}}
  1824   \end{equation} 
  1888   \end{equation} \smallskip
  1825   
  1889   
  1826   \noindent
  1890   \noindent
  1827   whereby the @{text P}$_{1..n}$ are predicates and the @{text x}$_{1..n}$ 
  1891   whereby the @{text P}$_{1..n}$ are predicates and the @{text x}$_{1..n}$ 
  1828   have types @{text "ty\<AL>"}$_{1..n}$. This induction principle has for each
  1892   have types @{text "ty\<AL>"}$_{1..n}$. This induction principle has for each
  1829   term constructor @{text "C"}$^\alpha$ a premise of the form
  1893   term constructor @{text "C"}$^\alpha$ a premise of the form
  1830   
  1894   
  1831   \begin{equation}\label{weakprem}
  1895   \begin{equation}\label{weakprem}
  1832   \mbox{@{text "\<forall>x\<^isub>1\<dots>x\<^isub>r. P\<^isub>i x\<^isub>i \<and> \<dots> \<and> P\<^isub>j x\<^isub>j \<Rightarrow> P (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r)"}} 
  1896   \mbox{@{text "\<forall>x\<^isub>1\<dots>x\<^isub>r. P\<^isub>i x\<^isub>i \<and> \<dots> \<and> P\<^isub>j x\<^isub>j \<Rightarrow> P (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r)"}} 
  1833   \end{equation}
  1897   \end{equation}\smallskip
  1834 
  1898 
  1835   \noindent 
  1899   \noindent 
  1836   in which the @{text "x"}$_{i..j}$ @{text "\<subseteq>"} @{text "x"}$_{1..r}$ are 
  1900   in which the @{text "x"}$_{i..j}$ @{text "\<subseteq>"} @{text "x"}$_{1..r}$ are 
  1837   the recursive arguments of @{text "C\<AL>"}. 
  1901   the recursive arguments of @{text "C\<AL>"}. 
  1838 
  1902 
  1839   By working now completely on the alpha-equated level, we
  1903   By working now completely on the alpha-equated level, we
  1840   can first show that the free-atom functions and binding functions are
  1904   can first show that the free-atom functions and binding functions are
  1841   equivariant, namely
  1905   equivariant, namely
  1842   
  1906   
  1843   \begin{center}
  1907   \[\mbox{
  1844   \begin{tabular}{rcl@ {\hspace{10mm}}rcl}
  1908   \begin{tabular}{rcl}
  1845   @{text "p \<bullet> (fa_ty\<AL>\<^isub>i  x)"} & $=$ & @{text "fa_ty\<AL>\<^isub>i (p \<bullet> x)"} &
  1909   @{text "\<pi> \<bullet> (fa_ty\<AL>\<^isub>i  x)"} & $=$ & @{text "fa_ty\<AL>\<^isub>i (\<pi> \<bullet> x)"}\\
  1846   @{text "p \<bullet> (bn\<AL>\<^isub>j  x)"}    & $=$ & @{text "bn\<AL>\<^isub>j (p \<bullet> x)"}\\
  1910   @{text "\<pi> \<bullet> (fa_bn\<AL>\<^isub>j  x)"} & $=$ & @{text "fa_bn\<AL>\<^isub>j (\<pi> \<bullet> x)"}\\
  1847   @{text "p \<bullet> (fa_bn\<AL>\<^isub>j  x)"} & $=$ & @{text "fa_bn\<AL>\<^isub>j (p \<bullet> x)"}\\
  1911   @{text "\<pi> \<bullet> (bn\<AL>\<^isub>j  x)"}    & $=$ & @{text "bn\<AL>\<^isub>j (\<pi> \<bullet> x)"}\\
  1848   \end{tabular}
  1912   \end{tabular}}
  1849   \end{center}
  1913   \]
  1850   
  1914 
  1851   \noindent
  1915   
  1852   These properties can be established using the induction principle for the types @{text "ty\<AL>"}$_{1..n}$.
  1916   \noindent
  1853   in \eqref{weakinduct}.
  1917   These properties can be established using the induction principle for the
  1854   Having these equivariant properties established, we can
  1918   types @{text "ty\<AL>"}$_{1..n}$.  in \eqref{weakinduct}.  Having these
  1855   show that the support of term-constructors @{text "C\<^sup>\<alpha>"} is included in
  1919   equivariant properties established, we can show that the support of
  1856   the support of its arguments, that means 
  1920   term-constructors @{text "C\<^sup>\<alpha>"} is included in the support of its
  1857 
  1921   arguments, that means
  1858   \begin{center}
  1922 
       
  1923   \[
  1859   @{text "supp (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r) \<subseteq> (supp x\<^isub>1 \<union> \<dots> \<union> supp x\<^isub>r)"}
  1924   @{text "supp (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r) \<subseteq> (supp x\<^isub>1 \<union> \<dots> \<union> supp x\<^isub>r)"}
  1860   \end{center}
  1925   \]\smallskip
  1861  
  1926  
  1862   \noindent
  1927   \noindent
  1863   holds. This allows us to prove by induction that
  1928   holds. This allows us to prove by induction that
  1864   every @{text x} of type @{text "ty\<AL>"}$_{1..n}$ is finitely supported. 
  1929   every @{text x} of type @{text "ty\<AL>"}$_{1..n}$ is finitely supported. 
  1865   This can be again shown by induction 
  1930   This can be again shown by induction 
  2242 
  2307 
  2243 section {* Related Work\label{related} *}
  2308 section {* Related Work\label{related} *}
  2244 
  2309 
  2245 text {*
  2310 text {*
  2246   To our knowledge the earliest usage of general binders in a theorem prover
  2311   To our knowledge the earliest usage of general binders in a theorem prover
  2247   is described in \cite{NaraschewskiNipkow99} about a formalisation of the
  2312   is described by Nara\-schew\-ski and Nipkow \cite{NaraschewskiNipkow99} with a
  2248   algorithm W. This formalisation implements binding in type-schemes using a
  2313   formalisation of the algorithm W. This formalisation implements binding in
  2249   de-Bruijn indices representation. Since type-schemes in W contain only a single
  2314   type-schemes using a de-Bruijn indices representation. Since type-schemes in
  2250   place where variables are bound, different indices do not refer to different binders (as in the usual
  2315   W contain only a single place where variables are bound, different indices
  2251   de-Bruijn representation), but to different bound variables. A similar idea
  2316   do not refer to different binders (as in the usual de-Bruijn
  2252   has been recently explored for general binders in the locally nameless
  2317   representation), but to different bound variables. A similar idea has been
  2253   approach to binding \cite{chargueraud09}.  There, de-Bruijn indices consist
  2318   recently explored for general binders by Chargu\'eraud in the locally nameless 
  2254   of two numbers, one referring to the place where a variable is bound, and the
  2319   approach to
  2255   other to which variable is bound. The reasoning infrastructure for both
  2320   binding \cite{chargueraud09}.  There, de-Bruijn indices consist of two
  2256   representations of bindings comes for free in theorem provers like Isabelle/HOL or
  2321   numbers, one referring to the place where a variable is bound, and the other
  2257   Coq, since the corresponding term-calculi can be implemented as ``normal''
  2322   to which variable is bound. The reasoning infrastructure for both
  2258   datatypes.  However, in both approaches it seems difficult to achieve our
  2323   representations of bindings comes for free in theorem provers like
  2259   fine-grained control over the ``semantics'' of bindings (i.e.~whether the
  2324   Isabelle/HOL or Coq, since the corresponding term-calculi can be implemented
  2260   order of binders should matter, or vacuous binders should be taken into
  2325   as ``normal'' datatypes.  However, in both approaches it seems difficult to
  2261   account). To do so, one would require additional predicates that filter out
  2326   achieve our fine-grained control over the ``semantics'' of bindings
  2262   unwanted terms. Our guess is that such predicates result in rather
  2327   (i.e.~whether the order of binders should matter, or vacuous binders should
  2263   intricate formal reasoning.
  2328   be taken into account). To do so, one would require additional predicates
       
  2329   that filter out unwanted terms. Our guess is that such predicates result in
       
  2330   rather intricate formal reasoning. We are not aware of any non-trivial 
       
  2331   formalisation that uses Chargu\'eraud's idea.
       
  2332 
  2264 
  2333 
  2265   Another technique for representing binding is higher-order abstract syntax
  2334   Another technique for representing binding is higher-order abstract syntax
  2266   (HOAS). , which for example is implemented in the Twelf system. 
  2335   (HOAS), which for example is implemented in the Twelf system. This
  2267   This representation
  2336   representation technique supports very elegantly many aspects of
  2268   technique supports very elegantly many aspects of \emph{single} binding, and
  2337   \emph{single} binding, and impressive work by Lee et al has been done that
  2269   impressive work has been done that uses HOAS for mechanising the metatheory
  2338   uses HOAS for mechanising the metatheory of SML~\cite{LeeCraryHarper07}. We
  2270   of SML~\cite{LeeCraryHarper07}. We are, however, not aware how multiple
  2339   are, however, not aware how multiple binders of SML are represented in this
  2271   binders of SML are represented in this work. Judging from the submitted
  2340   work. Judging from the submitted Twelf-solution for the POPLmark challenge,
  2272   Twelf-solution for the POPLmark challenge, HOAS cannot easily deal with
  2341   HOAS cannot easily deal with binding constructs where the number of bound
  2273   binding constructs where the number of bound variables is not fixed. For example 
  2342   variables is not fixed. For example In the second part of this challenge,
  2274   In the second part of this challenge, @{text "Let"}s involve
  2343   @{text "Let"}s involve patterns that bind multiple variables at once. In
  2275   patterns that bind multiple variables at once. In such situations, HOAS
  2344   such situations, HOAS seems to have to resort to the
  2276   seems to have to resort to the iterated-single-binders-approach with
  2345   iterated-single-binders-approach with all the unwanted consequences when
  2277   all the unwanted consequences when reasoning about the resulting terms.
  2346   reasoning about the resulting terms.
       
  2347 
  2278 
  2348 
  2279   Two formalisations involving general binders have been 
  2349   Two formalisations involving general binders have been 
  2280   performed in older
  2350   performed in older
  2281   versions of Nominal Isabelle (one about Psi-calculi and one about algorithm W 
  2351   versions of Nominal Isabelle (one about Psi-calculi and one about algorithm W 
  2282   \cite{BengtsonParow09,UrbanNipkow09}).  Both
  2352   \cite{BengtsonParow09,UrbanNipkow09}).  Both
  2283   use the approach based on iterated single binders. Our experience with
  2353   use the approach based on iterated single binders. Our experience with
  2284   the latter formalisation has been disappointing. The major pain arose from
  2354   the latter formalisation has been disappointing. The major pain arose from
  2285   the need to ``unbind'' variables. This can be done in one step with our
  2355   the need to ``unbind'' variables. This can be done in one step with our
  2286   general binders described in this paper, but needs a cumbersome
  2356   general binders described in this paper, but needs a cumbersome
  2287   iteration with single binders. The resulting formal reasoning turned out to
  2357   iteration with single binders. The resulting formal reasoning turned out to
  2288   be rather unpleasant. The hope is that the extension presented in this paper
  2358   be rather unpleasant. 
  2289   is a substantial improvement.
       
  2290  
  2359  
  2291   The most closely related work to the one presented here is the Ott-tool
  2360   The most closely related work to the one presented here is the Ott-tool by
  2292   \cite{ott-jfp} and the C$\alpha$ml language \cite{Pottier06}. Ott is a nifty
  2361   Sewell et al \cite{ott-jfp} and the C$\alpha$ml language by Pottier
  2293   front-end for creating \LaTeX{} documents from specifications of
  2362   \cite{Pottier06}. Ott is a nifty front-end for creating \LaTeX{} documents
  2294   term-calculi involving general binders. For a subset of the specifications
  2363   from specifications of term-calculi involving general binders. For a subset
  2295   Ott can also generate theorem prover code using a raw representation of
  2364   of the specifications Ott can also generate theorem prover code using a raw
  2296   terms, and in Coq also a locally nameless representation. The developers of
  2365   representation of terms, and in Coq also a locally nameless
  2297   this tool have also put forward (on paper) a definition for
  2366   representation. The developers of this tool have also put forward (on paper)
  2298   alpha-equivalence of terms that can be specified in Ott.  This definition is
  2367   a definition for alpha-equivalence and free variables for terms that can be
  2299   rather different from ours, not using any nominal techniques.  To our
  2368   specified in Ott.  This definition is rather different from ours, not using
  2300   knowledge there is no concrete mathematical result concerning this
  2369   any nominal techniques.  To our knowledge there is no concrete mathematical
  2301   notion of alpha-equivalence.  Also the definition for the 
  2370   result concerning this notion of alpha-equivalence and free variables. We
  2302   notion of free variables
  2371   have proved that our definitions lead to alpha-equated terms, whose support
  2303   is work in progress.
  2372   is as expected (that means bound names are removed from the support). We
  2304 
  2373   also showed that our specifications lift from a raw type to a type of
  2305   Although we were heavily inspired by the syntax of Ott,
  2374   alpha-equivalence classes. For this we were able to establish then every
  2306   its definition of alpha-equi\-valence is unsuitable for our extension of
  2375   term-constructor and function is repectful w.r.t.~alpha-equivalence.
  2307   Nominal Isabelle. First, it is far too complicated to be a basis for
  2376 
  2308   automated proofs implemented on the ML-level of Isabelle/HOL. Second, it
  2377   Although we were heavily inspired by the syntax of Ott, its definition of
  2309   covers cases of binders depending on other binders, which just do not make
  2378   alpha-equi\-valence is unsuitable for our extension of Nominal
  2310   sense for our alpha-equated terms. Third, it allows empty types that have no
  2379   Isabelle. First, it is far too complicated to be a basis for automated
  2311   meaning in a HOL-based theorem prover. We also had to generalise slightly Ott's 
  2380   proofs implemented on the ML-level of Isabelle/HOL. Second, it covers cases
  2312   binding clauses. In Ott you specify binding clauses with a single body; we 
  2381   of binders depending on other binders, which just do not make sense for our
  2313   allow more than one. We have to do this, because this makes a difference 
  2382   alpha-equated terms. Third, it allows empty types that have no meaning in a
  2314   for our notion of alpha-equivalence in case of \isacommand{binds (set)} and 
  2383   HOL-based theorem prover. We also had to generalise slightly Ott's binding
  2315   \isacommand{binds (set+)}. 
  2384   clauses. In Ott one specifies binding clauses with a single body; we allow
  2316   
  2385   more than one. We have to do this, because this makes a difference for our
  2317   Consider the examples
  2386   notion of alpha-equivalence in case of \isacommand{binds (set)} and
  2318   
  2387   \isacommand{binds (set+)}. Consider the examples
  2319   \begin{center}
  2388   
       
  2389   \[\mbox{
  2320   \begin{tabular}{@ {}l@ {\hspace{2mm}}l@ {}}
  2390   \begin{tabular}{@ {}l@ {\hspace{2mm}}l@ {}}
  2321   @{text "Foo\<^isub>1 xs::name fset t::trm s::trm"} &  
  2391   @{text "Foo\<^isub>1 xs::name fset t::trm s::trm"} &  
  2322       \isacommand{binds (set)} @{text "xs"} \isacommand{in} @{text "t s"}\\
  2392       \isacommand{binds (set)} @{text "xs"} \isacommand{in} @{text "t s"}\\
  2323   @{text "Foo\<^isub>2 xs::name fset t::trm s::trm"} &  
  2393   @{text "Foo\<^isub>2 xs::name fset t::trm s::trm"} &  
  2324       \isacommand{binds (set)} @{text "xs"} \isacommand{in} @{text "t"}, 
  2394       \isacommand{binds (set)} @{text "xs"} \isacommand{in} @{text "t"}, 
  2325       \isacommand{binds (set)} @{text "xs"} \isacommand{in} @{text "s"}\\
  2395       \isacommand{binds (set)} @{text "xs"} \isacommand{in} @{text "s"}\\
  2326   \end{tabular}
  2396   \end{tabular}}
  2327   \end{center}
  2397   \]\smallskip
  2328   
  2398   
  2329   \noindent
  2399   \noindent
  2330   In the first term-constructor we have a single
  2400   In the first term-constructor we have a single body that happens to be
  2331   body that happens to be ``spread'' over two arguments; in the second term-constructor we have
  2401   ``spread'' over two arguments; in the second term-constructor we have two
  2332   two independent bodies in which the same variables are bound. As a result we 
  2402   independent bodies in which the same variables are bound. As a result we
  2333   have
  2403   have\footnote{Assuming @{term "a \<noteq> b"}, there is no permutation that can
       
  2404   make @{text "(a, b)"} equal with @{text "(a, b)"} and @{text "(b, a)"}, but
       
  2405   there are two permutations so that we can make @{text "(a, b)"} and @{text
       
  2406   "(a, b)"} equal with one permutation, and @{text "(a, b)"} and @{text "(b,
       
  2407   a)"} with the other.}
       
  2408 
  2334    
  2409    
  2335   \begin{center}
  2410   \[\mbox{
  2336   \begin{tabular}{r@ {\hspace{1.5mm}}c@ {\hspace{1.5mm}}l}
  2411   \begin{tabular}{r@ {\hspace{1.5mm}}c@ {\hspace{1.5mm}}l}
  2337   @{text "Foo\<^isub>1 {a, b} (a, b) (a, b)"} & $\not=$ & 
  2412   @{text "Foo\<^isub>1 {a, b} (a, b) (a, b)"} & $\not=$ & 
  2338   @{text "Foo\<^isub>1 {a, b} (a, b) (b, a)"}\\
  2413   @{text "Foo\<^isub>1 {a, b} (a, b) (b, a)"}
       
  2414   \end{tabular}}
       
  2415   \]\smallskip
       
  2416  
       
  2417   \noindent
       
  2418   but 
       
  2419 
       
  2420   \[\mbox{
       
  2421   \begin{tabular}{r@ {\hspace{1.5mm}}c@ {\hspace{1.5mm}}l}
  2339   @{text "Foo\<^isub>2 {a, b} (a, b) (a, b)"} & $=$ & 
  2422   @{text "Foo\<^isub>2 {a, b} (a, b) (a, b)"} & $=$ & 
  2340   @{text "Foo\<^isub>2 {a, b} (a, b) (b, a)"}\\
  2423   @{text "Foo\<^isub>2 {a, b} (a, b) (b, a)"}\\
  2341   \end{tabular}
  2424   \end{tabular}}
  2342   \end{center}
  2425   \]\smallskip
  2343   
  2426   
  2344   \noindent
  2427   \noindent
  2345   and therefore need the extra generality to be able to distinguish between 
  2428   and therefore need the extra generality to be able to distinguish between
  2346   both specifications.
  2429   both specifications.  Because of how we set up our definitions, we also had
  2347   Because of how we set up our definitions, we also had to impose some restrictions
  2430   to impose some restrictions (like a single binding function for a deep
  2348   (like a single binding function for a deep binder) that are not present in Ott. 
  2431   binder) that are not present in Ott. Our expectation is that we can still
  2349   Our
  2432   cover many interesting term-calculi from programming language research, for
  2350   expectation is that we can still cover many interesting term-calculi from
  2433   example Core-Haskell. ???
  2351   programming language research, for example Core-Haskell. 
  2434 
  2352 
  2435   Pottier presents a programming language, called C$\alpha$ml, for
  2353   Pottier presents in \cite{Pottier06} a language, called C$\alpha$ml, for 
  2436   representing terms with general binders inside OCaml \cite{Pottier06}. This
  2354   representing terms with general binders inside OCaml. This language is
  2437   language is implemented as a front-end that can be translated to OCaml with
  2355   implemented as a front-end that can be translated to OCaml with the help of
  2438   the help of a library. He presents a type-system in which the scope of
  2356   a library. He presents a type-system in which the scope of general binders
  2439   general binders can be specified using special markers, written @{text
  2357   can be specified using special markers, written @{text "inner"} and 
  2440   "inner"} and @{text "outer"}. It seems our and his specifications can be
  2358   @{text "outer"}. It seems our and his specifications can be
  2441   inter-translated as long as ours use the binding mode \isacommand{binds}
  2359   inter-translated as long as ours use the binding mode 
  2442   only.  However, we have not proved this. Pottier gives a definition for
  2360   \isacommand{binds} only.
       
  2361   However, we have not proved this. Pottier gives a definition for 
       
  2362   alpha-equivalence, which also uses a permutation operation (like ours).
  2443   alpha-equivalence, which also uses a permutation operation (like ours).
  2363   Still, this definition is rather different from ours and he only proves that
  2444   Still, this definition is rather different from ours and he only proves that
  2364   it defines an equivalence relation. A complete
  2445   it defines an equivalence relation. A complete reasoning infrastructure is
  2365   reasoning infrastructure is well beyond the purposes of his language. 
  2446   well beyond the purposes of his language. Similar work for Haskell with
  2366   Similar work for Haskell with similar results was reported by Cheney \cite{Cheney05a}.
  2447   similar results was reported by Cheney \cite{Cheney05a} and more recently 
  2367   
  2448   by ???
  2368   In a slightly different domain (programming with dependent types), the 
  2449 
  2369   paper \cite{Altenkirch10} presents a calculus with a notion of 
  2450   In a slightly different domain (programming with dependent types),
  2370   alpha-equivalence related to our binding mode \isacommand{binds (set+)}.
  2451   Altenkirch et al present a calculus with a notion of alpha-equivalence
  2371   The definition in \cite{Altenkirch10} is similar to the one by Pottier, except that it
  2452   related to our binding mode \isacommand{binds (set+)} \cite{Altenkirch10}.
  2372   has a more operational flavour and calculates a partial (renaming) map. 
  2453   Their definition is similar to the one by Pottier, except that it has a more
  2373   In this way, the definition can deal with vacuous binders. However, to our
  2454   operational flavour and calculates a partial (renaming) map. In this way,
  2374   best knowledge, no concrete mathematical result concerning this
  2455   the definition can deal with vacuous binders. However, to our best
  2375   definition of alpha-equivalence has been proved.  
  2456   knowledge, no concrete mathematical result concerning this definition of
       
  2457   alpha-equivalence has been proved.
  2376 *}
  2458 *}
  2377 
  2459 
  2378 section {* Conclusion *}
  2460 section {* Conclusion *}
  2379 
  2461 
  2380 text {*
  2462 text {*
  2381   Telsescopes by de Bruijn (AUTOMATH project does not provide an automatic infrastructure).
  2463   %%Telsescopes by de Bruijn (AUTOMATH project does not provide an automatic infrastructure).
  2382 
  2464 
  2383 
  2465 
  2384   We have presented an extension of Nominal Isabelle for dealing with
  2466   We have presented an extension of Nominal Isabelle for dealing with general
  2385   general binders, that is term-constructors having multiple bound 
  2467   binders, that is term-constructors having multiple bound variables. For this
  2386   variables. For this extension we introduced new definitions of 
  2468   extension we introduced new definitions of alpha-equivalence and automated
  2387   alpha-equivalence and automated all necessary proofs in Isabelle/HOL.
  2469   all necessary proofs in Isabelle/HOL.  To specify general binders we used
  2388   To specify general binders we used the specifications from Ott, but extended them 
  2470   the syntax from Ott, but extended it in some places and restricted
  2389   in some places and restricted
  2471   it in others so that they make sense in the context of alpha-equated
  2390   them in others so that they make sense in the context of alpha-equated terms. 
  2472   terms. We also introduced two binding modes (set and set+) that do not exist
  2391   We also introduced two binding modes (set and set+) that do not 
  2473   in Ott. We have tried out the extension with calculi such as Core-Haskell,
  2392   exist in Ott. 
  2474   type-schemes and approximately a dozen of other typical examples from
  2393   We have tried out the extension with calculi such as Core-Haskell, type-schemes 
  2475   programming language research~\cite{SewellBestiary}. The code will
  2394   and approximately a  dozen of other typical examples from programming 
  2476   eventually become part of the next Isabelle distribution.\footnote{It 
  2395   language research~\cite{SewellBestiary}. 
  2477   can be downloaded already from the Mercurial repository linked at
  2396   The code
       
  2397   will eventually become part of the next Isabelle distribution.\footnote{For the moment
       
  2398   it can be downloaded from the Mercurial repository linked at
       
  2399   \href{http://isabelle.in.tum.de/nominal/download}
  2478   \href{http://isabelle.in.tum.de/nominal/download}
  2400   {http://isabelle.in.tum.de/nominal/download}.}
  2479   {http://isabelle.in.tum.de/nominal/download}.}
  2401 
  2480 
  2402   We have left out a discussion about how functions can be defined over
  2481   We have left out a discussion about how functions can be defined over
  2403   alpha-equated terms involving general binders. In earlier versions of Nominal
  2482   alpha-equated terms involving general binders. In earlier versions of Nominal
  2410   There are some restrictions we imposed in this paper that we would like to lift in
  2489   There are some restrictions we imposed in this paper that we would like to lift in
  2411   future work. One is the exclusion of nested datatype definitions. Nested
  2490   future work. One is the exclusion of nested datatype definitions. Nested
  2412   datatype definitions allow one to specify, for instance, the function kinds
  2491   datatype definitions allow one to specify, for instance, the function kinds
  2413   in Core-Haskell as @{text "TFun string (ty list)"} instead of the unfolded
  2492   in Core-Haskell as @{text "TFun string (ty list)"} instead of the unfolded
  2414   version @{text "TFun string ty_list"} (see Figure~\ref{nominalcorehas}). To
  2493   version @{text "TFun string ty_list"} (see Figure~\ref{nominalcorehas}). To
  2415   achieve this, we need a slightly more clever implementation than we have at the moment. 
  2494   achieve this, we need more clever implementation than we have 
       
  2495   at the moment. However, really lifting this restriction will involve major
       
  2496   work on the datatype package of Isabelle/HOL.
  2416 
  2497 
  2417   A more interesting line of investigation is whether we can go beyond the 
  2498   A more interesting line of investigation is whether we can go beyond the 
  2418   simple-minded form of binding functions that we adopted from Ott. At the moment, binding
  2499   simple-minded form of binding functions that we adopted from Ott. At the moment, binding
  2419   functions can only return the empty set, a singleton atom set or unions
  2500   functions can only return the empty set, a singleton atom set or unions
  2420   of atom sets (similarly for lists). It remains to be seen whether 
  2501   of atom sets (similarly for lists). It remains to be seen whether 
  2421   properties like
  2502   properties like
  2422   
  2503   
  2423   \begin{center}
  2504   \[
  2424   @{text "fa_ty x  =  bn x \<union> fa_bn x"}.
  2505   \mbox{@{text "fa_ty x  =  bn x \<union> fa_bn x"}}
  2425   \end{center}
  2506   \]\smallskip
  2426   
  2507   
  2427   \noindent
  2508   \noindent
  2428   allow us to support more interesting binding functions. 
  2509   allow us to support more interesting binding functions. 
  2429   
  2510   
  2430   We have also not yet played with other binding modes. For example we can
  2511   We have also not yet played with other binding modes. For example we can
  2431   imagine that there is need for a binding mode where instead of lists, we
  2512   imagine that there is need for a binding mode where instead of usual lists,
  2432   abstract lists of distinct elements.  Once we feel confident about such
  2513   we abstract lists of distinct elements (the corresponding type @{text
  2433   binding modes, our implementation can be easily extended to accommodate
  2514   "dlist"} already exists in the library of Isabelle/HOL). We expect the
  2434   them.\medskip
  2515   presented work can be easily extended to accommodate them.\medskip
  2435   
  2516   
  2436   \noindent
  2517   \noindent
  2437   {\bf Acknowledgements:} We are very grateful to Andrew Pitts for many
  2518   {\bf Acknowledgements:} We are very grateful to Andrew Pitts for many
  2438   discussions about Nominal Isabelle. We thank Peter Sewell for making the
  2519   discussions about Nominal Isabelle. We thank Peter Sewell for making the
  2439   informal notes \cite{SewellBestiary} available to us and also for patiently
  2520   informal notes \cite{SewellBestiary} available to us and also for patiently