Paper/Paper.thy
changeset 2510 734341a79028
parent 2509 679cef364022
child 2511 2ccf3086142b
equal deleted inserted replaced
2509:679cef364022 2510:734341a79028
   285   \draw[rounded corners=1mm, very thick] (-1.95,0.85) rectangle (-2.85,-0.05);
   285   \draw[rounded corners=1mm, very thick] (-1.95,0.85) rectangle (-2.85,-0.05);
   286   
   286   
   287   \draw (-2.0, 0.845) --  (0.7,0.845);
   287   \draw (-2.0, 0.845) --  (0.7,0.845);
   288   \draw (-2.0,-0.045)  -- (0.7,-0.045);
   288   \draw (-2.0,-0.045)  -- (0.7,-0.045);
   289 
   289 
   290   \draw ( 0.7, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-\\[-1mm]clas.\end{tabular}};
   290   \draw ( 0.7, 0.4) node {\footnotesize\begin{tabular}{@ {}c@ {}}$\alpha$-\\[-1mm]clas.\end{tabular}};
   291   \draw (-2.4, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-eq.\\[-1mm]terms\end{tabular}};
   291   \draw (-2.4, 0.4) node {\footnotesize\begin{tabular}{@ {}c@ {}}$\alpha$-eq.\\[-1mm]terms\end{tabular}};
   292   \draw (1.8, 0.48) node[right=-0.1mm]
   292   \draw (1.8, 0.48) node[right=-0.1mm]
   293     {\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ (sets of raw terms)\end{tabular}};
   293     {\footnotesize\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ (sets of raw terms)\end{tabular}};
   294   \draw (0.9, -0.35) node {\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}};
   294   \draw (0.9, -0.35) node {\footnotesize\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}};
   295   \draw (-3.25, 0.55) node {\begin{tabular}{@ {}l@ {}}new\\[-1mm]type\end{tabular}};
   295   \draw (-3.25, 0.55) node {\footnotesize\begin{tabular}{@ {}l@ {}}new\\[-1mm]type\end{tabular}};
   296   
   296   
   297   \draw[<->, very thick] (-1.8, 0.3) -- (-0.1,0.3);
   297   \draw[<->, very thick] (-1.8, 0.3) -- (-0.1,0.3);
   298   \draw (-0.95, 0.3) node[above=0mm] {isomorphism};
   298   \draw (-0.95, 0.3) node[above=0mm] {\footnotesize{}isomorphism};
   299 
   299 
   300   \end{tikzpicture}
   300   \end{tikzpicture}
   301   \end{center}
   301   \end{center}
   302   %
   302   %
   303   \noindent
   303   \noindent
   351   this function can be defined for raw terms, it does not respect
   351   this function can be defined for raw terms, it does not respect
   352   $\alpha$-equivalence and therefore cannot be lifted. To sum up, every lifting
   352   $\alpha$-equivalence and therefore cannot be lifted. To sum up, every lifting
   353   of theorems to the quotient level needs proofs of some respectfulness
   353   of theorems to the quotient level needs proofs of some respectfulness
   354   properties (see \cite{Homeier05}). In the paper we show that we are able to
   354   properties (see \cite{Homeier05}). In the paper we show that we are able to
   355   automate these proofs and as a result can automatically establish a reasoning 
   355   automate these proofs and as a result can automatically establish a reasoning 
   356   infrastructure for $\alpha$-equated terms.
   356   infrastructure for $\alpha$-equated terms.\smallskip
   357 
   357 
   358   The examples we have in mind where our reasoning infrastructure will be
   358   %The examples we have in mind where our reasoning infrastructure will be
   359   helpful includes the term language of Core-Haskell. This term language
   359   %helpful includes the term language of Core-Haskell. This term language
   360   involves patterns that have lists of type-, coercion- and term-variables,
   360   %involves patterns that have lists of type-, coercion- and term-variables,
   361   all of which are bound in @{text "\<CASE>"}-expressions. In these
   361   %all of which are bound in @{text "\<CASE>"}-expressions. In these
   362   patterns we do not know in advance how many variables need to
   362   %patterns we do not know in advance how many variables need to
   363   be bound. Another example is the specification of SML, which includes
   363   %be bound. Another example is the specification of SML, which includes
   364   includes bindings as in type-schemes.\medskip
   364   %includes bindings as in type-schemes.\medskip
   365 
   365 
   366   \noindent
   366   \noindent
   367   {\bf Contributions:}  We provide three new definitions for when terms
   367   {\bf Contributions:}  We provide three new definitions for when terms
   368   involving general binders are $\alpha$-equivalent. These definitions are
   368   involving general binders are $\alpha$-equivalent. These definitions are
   369   inspired by earlier work of Pitts \cite{Pitts04}. By means of automatic
   369   inspired by earlier work of Pitts \cite{Pitts04}. By means of automatic
   434   Two central notions in the nominal logic work are sorted atoms and
   434   Two central notions in the nominal logic work are sorted atoms and
   435   sort-respecting permutations of atoms. We will use the letters @{text "a,
   435   sort-respecting permutations of atoms. We will use the letters @{text "a,
   436   b, c, \<dots>"} to stand for atoms and @{text "p, q, \<dots>"} to stand for
   436   b, c, \<dots>"} to stand for atoms and @{text "p, q, \<dots>"} to stand for
   437   permutations. The purpose of atoms is to represent variables, be they bound or free. 
   437   permutations. The purpose of atoms is to represent variables, be they bound or free. 
   438   The sorts of atoms can be used to represent different kinds of
   438   The sorts of atoms can be used to represent different kinds of
   439   variables, such as the term-, coercion- and type-variables in Core-Haskell.
   439   variables.
       
   440   %%, such as the term-, coercion- and type-variables in Core-Haskell.
   440   It is assumed that there is an infinite supply of atoms for each
   441   It is assumed that there is an infinite supply of atoms for each
   441   sort. However, in the interest of brevity, we shall restrict ourselves 
   442   sort. However, in the interest of brevity, we shall restrict ourselves 
   442   in what follows to only one sort of atoms.
   443   in what follows to only one sort of atoms.
   443 
   444 
   444   Permutations are bijective functions from atoms to atoms that are 
   445   Permutations are bijective functions from atoms to atoms that are 
   678   where @{term set} is the function that coerces a list of atoms into a set of atoms.
   679   where @{term set} is the function that coerces a list of atoms into a set of atoms.
   679   Now the last clause ensures that the order of the binders matters (since @{text as}
   680   Now the last clause ensures that the order of the binders matters (since @{text as}
   680   and @{text bs} are lists of atoms).
   681   and @{text bs} are lists of atoms).
   681 
   682 
   682   If we do not want to make any difference between the order of binders \emph{and}
   683   If we do not want to make any difference between the order of binders \emph{and}
   683   also allow vacuous binders, then we keep sets of binders, but drop the fourth 
   684   also allow vacuous binders, that means \emph{restrict} names, then we keep sets of binders, but drop 
   684   condition in \eqref{alphaset}:
   685   condition {\it (iv)} in \eqref{alphaset}:
   685   %
   686   %
   686   \begin{equation}\label{alphares}
   687   \begin{equation}\label{alphares}
   687   \begin{array}{@ {\hspace{10mm}}l@ {\hspace{5mm}}l@ {\hspace{10mm}}l@ {\hspace{5mm}}l}
   688   \begin{array}{@ {\hspace{10mm}}l@ {\hspace{5mm}}l@ {\hspace{10mm}}l@ {\hspace{5mm}}l}
   688   \multicolumn{2}{l}{@{term "(as, x) \<approx>res R fa p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}}\\[1mm]
   689   \multicolumn{2}{l}{@{term "(as, x) \<approx>res R fa p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}}\\[1mm]
   689              \mbox{\it (i)}   & @{term "fa(x) - as = fa(y) - bs"} & 
   690              \mbox{\it (i)}   & @{term "fa(x) - as = fa(y) - bs"} & 
   778   \end{tabular}
   779   \end{tabular}
   779   \end{center}
   780   \end{center}
   780   \end{theorem}
   781   \end{theorem}
   781 
   782 
   782   \noindent
   783   \noindent
   783   This theorem states that the bound names do not appear in the support, as expected.
   784   This theorem states that the bound names do not appear in the support.
   784   For brevity we omit the proof of this resul and again refer the reader to
   785   For brevity we omit the proof and again refer the reader to
   785   our formalisation in Isabelle/HOL.
   786   our formalisation in Isabelle/HOL.
   786 
   787 
   787   %\noindent
   788   %\noindent
   788   %Below we will show the first equation. The others 
   789   %Below we will show the first equation. The others 
   789   %follow by similar arguments. By definition of the abstraction type @{text "abs_set"} 
   790   %follow by similar arguments. By definition of the abstraction type @{text "abs_set"} 
   859   form @{term "Abs_set as x"} etc is motivated by the fact that 
   860   form @{term "Abs_set as x"} etc is motivated by the fact that 
   860   we can conveniently establish  at the Isabelle/HOL level
   861   we can conveniently establish  at the Isabelle/HOL level
   861   properties about them.  It would be
   862   properties about them.  It would be
   862   laborious to write custom ML-code that derives automatically such properties 
   863   laborious to write custom ML-code that derives automatically such properties 
   863   for every term-constructor that binds some atoms. Also the generality of
   864   for every term-constructor that binds some atoms. Also the generality of
   864   the definitions for $\alpha$-equivalence will help us in the next section.
   865   the definitions for $\alpha$-equivalence will help us in the next sections.
   865 *}
   866 *}
   866 
   867 
   867 section {* Specifying General Bindings\label{sec:spec} *}
   868 section {* Specifying General Bindings\label{sec:spec} *}
   868 
   869 
   869 text {*
   870 text {*
   880   type \mbox{declaration part} &
   881   type \mbox{declaration part} &
   881   $\begin{cases}
   882   $\begin{cases}
   882   \mbox{\begin{tabular}{l}
   883   \mbox{\begin{tabular}{l}
   883   \isacommand{nominal\_datatype} @{text "ty\<AL>\<^isub>1 = \<dots>"}\\
   884   \isacommand{nominal\_datatype} @{text "ty\<AL>\<^isub>1 = \<dots>"}\\
   884   \isacommand{and} @{text "ty\<AL>\<^isub>2 = \<dots>"}\\
   885   \isacommand{and} @{text "ty\<AL>\<^isub>2 = \<dots>"}\\
   885   $\ldots$\\ 
   886   \raisebox{2mm}{$\ldots$}\\[-2mm] 
   886   \isacommand{and} @{text "ty\<AL>\<^isub>n = \<dots>"}\\ 
   887   \isacommand{and} @{text "ty\<AL>\<^isub>n = \<dots>"}\\ 
   887   \end{tabular}}
   888   \end{tabular}}
   888   \end{cases}$\\
   889   \end{cases}$\\
   889   binding \mbox{function part} &
   890   binding \mbox{function part} &
   890   $\begin{cases}
   891   $\begin{cases}
   891   \mbox{\begin{tabular}{l}
   892   \mbox{\begin{tabular}{l}
   892   \isacommand{binder} @{text "bn\<AL>\<^isub>1"} \isacommand{and} \ldots \isacommand{and} @{text "bn\<AL>\<^isub>m"}\\
   893   \isacommand{binder} @{text "bn\<AL>\<^isub>1"} \isacommand{and} \ldots \isacommand{and} @{text "bn\<AL>\<^isub>m"}\\
   893   \isacommand{where}\\
   894   \isacommand{where}\\
   894   $\ldots$\\
   895   \raisebox{2mm}{$\ldots$}\\[-2mm]
   895   \end{tabular}}
   896   \end{tabular}}
   896   \end{cases}$\\
   897   \end{cases}$\\
   897   \end{tabular}}
   898   \end{tabular}}
   898   \end{equation}
   899   \end{equation}
   899 
   900 
   906   \begin{center}
   907   \begin{center}
   907   @{text "C\<^sup>\<alpha> label\<^isub>1::ty"}$'_1$ @{text "\<dots> label\<^isub>l::ty"}$'_l\;\;$  @{text "binding_clauses"} 
   908   @{text "C\<^sup>\<alpha> label\<^isub>1::ty"}$'_1$ @{text "\<dots> label\<^isub>l::ty"}$'_l\;\;$  @{text "binding_clauses"} 
   908   \end{center}
   909   \end{center}
   909   
   910   
   910   \noindent
   911   \noindent
   911   whereby some of the @{text ty}$'_{1..l}$ (or their components) can be contained
   912   whereby some of the @{text ty}$'_{1..l}$ %%(or their components) 
       
   913   can be contained
   912   in the collection of @{text ty}$^\alpha_{1..n}$ declared in
   914   in the collection of @{text ty}$^\alpha_{1..n}$ declared in
   913   \eqref{scheme}. 
   915   \eqref{scheme}. 
   914   In this case we will call the corresponding argument a
   916   In this case we will call the corresponding argument a
   915   \emph{recursive argument} of @{text "C\<^sup>\<alpha>"}. 
   917   \emph{recursive argument} of @{text "C\<^sup>\<alpha>"}. 
   916   %The types of such recursive 
   918   %The types of such recursive 
   935   the second is for sets of binders (the order does not matter, but the
   937   the second is for sets of binders (the order does not matter, but the
   936   cardinality does) and the last is for sets of binders (with vacuous binders
   938   cardinality does) and the last is for sets of binders (with vacuous binders
   937   preserving $\alpha$-equivalence). As indicated, the labels in the ``\isacommand{in}-part'' of a binding
   939   preserving $\alpha$-equivalence). As indicated, the labels in the ``\isacommand{in}-part'' of a binding
   938   clause will be called \emph{bodies}; the
   940   clause will be called \emph{bodies}; the
   939   ``\isacommand{bind}-part'' will be called \emph{binders}. In contrast to
   941   ``\isacommand{bind}-part'' will be called \emph{binders}. In contrast to
   940   Ott, we allow multiple labels in binders and bodies. For example we allow
   942   Ott, we allow multiple labels in binders and bodies. 
   941   binding clauses of the form:
   943 
   942 
   944   %For example we allow
   943   \begin{center}
   945   %binding clauses of the form:
   944   \begin{tabular}{@ {}ll@ {}}
   946   %
   945   @{text "Foo\<^isub>1 x::name y::name t::trm s::trm"} &  
   947   %\begin{center}
   946       \isacommand{bind} @{text "x y"} \isacommand{in} @{text "t s"}\\
   948   %\begin{tabular}{@ {}ll@ {}}
   947   @{text "Foo\<^isub>2 x::name y::name t::trm s::trm"} &  
   949   %@{text "Foo\<^isub>1 x::name y::name t::trm s::trm"} &  
   948       \isacommand{bind} @{text "x y"} \isacommand{in} @{text "t"}, 
   950   %    \isacommand{bind} @{text "x y"} \isacommand{in} @{text "t s"}\\
   949       \isacommand{bind} @{text "x y"} \isacommand{in} @{text "s"}\\
   951   %@{text "Foo\<^isub>2 x::name y::name t::trm s::trm"} &  
   950   \end{tabular}
   952   %    \isacommand{bind} @{text "x y"} \isacommand{in} @{text "t"}, 
   951   \end{center}
   953   %    \isacommand{bind} @{text "x y"} \isacommand{in} @{text "s"}\\
   952 
   954   %\end{tabular}
   953   \noindent
   955   %\end{center}
   954   Similarly for the other binding modes. 
   956 
       
   957   \noindent
       
   958   %Similarly for the other binding modes. 
   955   %Interestingly, in case of \isacommand{bind (set)}
   959   %Interestingly, in case of \isacommand{bind (set)}
   956   %and \isacommand{bind (res)} the binding clauses above will make a difference to the semantics
   960   %and \isacommand{bind (res)} the binding clauses above will make a difference to the semantics
   957   %of the specifications (the corresponding $\alpha$-equivalence will differ). We will 
   961   %of the specifications (the corresponding $\alpha$-equivalence will differ). We will 
   958   %show this later with an example.
   962   %show this later with an example.
   959   
   963   
   981   \begin{tabular}{@ {}l}
   985   \begin{tabular}{@ {}l}
   982   \isacommand{nominal\_datatype} @{text lam} $=$\\
   986   \isacommand{nominal\_datatype} @{text lam} $=$\\
   983   \hspace{5mm}\phantom{$\mid$}~@{text "Var name"}\\
   987   \hspace{5mm}\phantom{$\mid$}~@{text "Var name"}\\
   984   \hspace{5mm}$\mid$~@{text "App lam lam"}\\
   988   \hspace{5mm}$\mid$~@{text "App lam lam"}\\
   985   \hspace{5mm}$\mid$~@{text "Lam x::name t::lam"}\\
   989   \hspace{5mm}$\mid$~@{text "Lam x::name t::lam"}\\
   986   \hspace{21mm}\isacommand{bind} @{text x} \isacommand{in} @{text t}\\
   990   \hspace{24mm}\isacommand{bind} @{text x} \isacommand{in} @{text t}\\
   987   \end{tabular} &
   991   \end{tabular} &
   988   \begin{tabular}{@ {}l@ {}}
   992   \begin{tabular}{@ {}l@ {}}
   989   \isacommand{nominal\_datatype}~@{text ty} $=$\\
   993   \isacommand{nominal\_datatype}~@{text ty} $=$\\
   990   \hspace{5mm}\phantom{$\mid$}~@{text "TVar name"}\\
   994   \hspace{5mm}\phantom{$\mid$}~@{text "TVar name"}\\
   991   \hspace{5mm}$\mid$~@{text "TFun ty ty"}\\
   995   \hspace{5mm}$\mid$~@{text "TFun ty ty"}\\
   992   \isacommand{and}~@{text "tsc = All xs::(name fset) T::ty"}\\
   996   \isacommand{and}~@{text "tsc = All xs::(name fset) T::ty"}\\
   993   \hspace{21mm}\isacommand{bind (res)} @{text xs} \isacommand{in} @{text T}\\
   997   \hspace{29mm}\isacommand{bind (res)} @{text xs} \isacommand{in} @{text T}\\
   994   \end{tabular}
   998   \end{tabular}
   995   \end{tabular}
   999   \end{tabular}
   996   \end{center}
  1000   \end{center}
   997 
  1001 
   998   \noindent
  1002   \noindent
  1059   specification:
  1063   specification:
  1060   %
  1064   %
  1061   \begin{equation}\label{letrecs}
  1065   \begin{equation}\label{letrecs}
  1062   \mbox{%
  1066   \mbox{%
  1063   \begin{tabular}{@ {}l@ {}}
  1067   \begin{tabular}{@ {}l@ {}}
  1064   \isacommand{nominal\_datatype}~@{text "trm ="}\\
  1068   \isacommand{nominal\_datatype}~@{text "trm ="}\ldots\\
  1065   \hspace{5mm}\phantom{$\mid$}\ldots\\
       
  1066   \hspace{5mm}$\mid$~@{text "Let as::assn t::trm"} 
  1069   \hspace{5mm}$\mid$~@{text "Let as::assn t::trm"} 
  1067      \;\;\isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text t}\\
  1070      \;\;\isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text t}\\
  1068   \hspace{5mm}$\mid$~@{text "Let_rec as::assn t::trm"}
  1071   \hspace{5mm}$\mid$~@{text "Let_rec as::assn t::trm"}
  1069      \;\;\isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text "as t"}\\
  1072      \;\;\isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text "as t"}\\
  1070   \isacommand{and} @{text "ass"} =\\
  1073   \isacommand{and} @{text "ass"} =\\
  1109   that the term-constructors @{text PVar} and @{text PTup} may
  1112   that the term-constructors @{text PVar} and @{text PTup} may
  1110   not have a binding clause (all arguments are used to define @{text "bn"}).
  1113   not have a binding clause (all arguments are used to define @{text "bn"}).
  1111   In contrast, in case of \eqref{letrecs} the term-constructor @{text ACons}
  1114   In contrast, in case of \eqref{letrecs} the term-constructor @{text ACons}
  1112   may have a binding clause involving the argument @{text t} (the only one that
  1115   may have a binding clause involving the argument @{text t} (the only one that
  1113   is \emph{not} used in the definition of the binding function). This restriction
  1116   is \emph{not} used in the definition of the binding function). This restriction
  1114   is sufficient for having the binding function over $\alpha$-equated terms.
  1117   is sufficient for lifting the binding function to $\alpha$-equated terms.
  1115 
  1118 
  1116   In the version of
  1119   In the version of
  1117   Nominal Isabelle described here, we also adopted the restriction from the
  1120   Nominal Isabelle described here, we also adopted the restriction from the
  1118   Ott-tool that binding functions can only return: the empty set or empty list
  1121   Ott-tool that binding functions can only return: the empty set or empty list
  1119   (as in case @{text PNil}), a singleton set or singleton list containing an
  1122   (as in case @{text PNil}), a singleton set or singleton list containing an
  1125   we shall assume specifications 
  1128   we shall assume specifications 
  1126   of term-calculi are implicitly \emph{completed}. By this we mean that  
  1129   of term-calculi are implicitly \emph{completed}. By this we mean that  
  1127   for every argument of a term-constructor that is \emph{not} 
  1130   for every argument of a term-constructor that is \emph{not} 
  1128   already part of a binding clause given by the user, we add implicitly a special \emph{empty} binding
  1131   already part of a binding clause given by the user, we add implicitly a special \emph{empty} binding
  1129   clause, written \isacommand{bind}~@{term "{}"}~\isacommand{in}~@{text "labels"}. In case
  1132   clause, written \isacommand{bind}~@{term "{}"}~\isacommand{in}~@{text "labels"}. In case
  1130   of the lambda-calculus, the completion produces
  1133   of the lambda-terms, the completion produces
  1131 
  1134 
  1132   \begin{center}
  1135   \begin{center}
  1133   \begin{tabular}{@ {}l@ {\hspace{-1mm}}}
  1136   \begin{tabular}{@ {}l@ {\hspace{-1mm}}}
  1134   \isacommand{nominal\_datatype} @{text lam} =\\
  1137   \isacommand{nominal\_datatype} @{text lam} =\\
  1135   \hspace{5mm}\phantom{$\mid$}~@{text "Var x::name"}
  1138   \hspace{5mm}\phantom{$\mid$}~@{text "Var x::name"}
  1165   The ``raw'' datatype definition can be obtained by stripping off the 
  1168   The ``raw'' datatype definition can be obtained by stripping off the 
  1166   binding clauses and the labels from the types. We also have to invent
  1169   binding clauses and the labels from the types. We also have to invent
  1167   new names for the types @{text "ty\<^sup>\<alpha>"} and term-constructors @{text "C\<^sup>\<alpha>"}
  1170   new names for the types @{text "ty\<^sup>\<alpha>"} and term-constructors @{text "C\<^sup>\<alpha>"}
  1168   given by the user. In our implementation we just use the affix ``@{text "_raw"}''.
  1171   given by the user. In our implementation we just use the affix ``@{text "_raw"}''.
  1169   But for the purpose of this paper, we use the superscript @{text "_\<^sup>\<alpha>"} to indicate 
  1172   But for the purpose of this paper, we use the superscript @{text "_\<^sup>\<alpha>"} to indicate 
  1170   that a notion is defined over $\alpha$-equivalence classes and leave it out 
  1173   that a notion is given for $\alpha$-equivalence classes and leave it out 
  1171   for the corresponding notion defined on the ``raw'' level. So for example 
  1174   for the corresponding notion given on the ``raw'' level. So for example 
  1172   we have
  1175   we have
  1173   
  1176   
  1174   \begin{center}
  1177   \begin{center}
  1175   @{text "ty\<^sup>\<alpha> \<mapsto> ty"} \hspace{2mm}and\hspace{2mm} @{text "C\<^sup>\<alpha> \<mapsto> C"}
  1178   @{text "ty\<^sup>\<alpha> \<mapsto> ty"} \hspace{2mm}and\hspace{2mm} @{text "C\<^sup>\<alpha> \<mapsto> C"}
  1176   \end{center}
  1179   \end{center}
  1222   "fa_ty (C z\<^isub>1 \<dots> z\<^isub>n)"} will be the union @{text
  1225   "fa_ty (C z\<^isub>1 \<dots> z\<^isub>n)"} will be the union @{text
  1223   "fa(bc\<^isub>1) \<union> \<dots> \<union> fa(bc\<^isub>k)"} where we will define below what @{text "fa"} for a binding
  1226   "fa(bc\<^isub>1) \<union> \<dots> \<union> fa(bc\<^isub>k)"} where we will define below what @{text "fa"} for a binding
  1224   clause means. We only show the details for the mode \isacommand{bind (set)} (the other modes are similar). 
  1227   clause means. We only show the details for the mode \isacommand{bind (set)} (the other modes are similar). 
  1225   Suppose the binding clause @{text bc\<^isub>i} is of the form 
  1228   Suppose the binding clause @{text bc\<^isub>i} is of the form 
  1226   %
  1229   %
  1227   \begin{center}
  1230   %\begin{center}
  1228   \mbox{\isacommand{bind (set)} @{text "b\<^isub>1\<dots>b\<^isub>p"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}}
  1231   \mbox{\isacommand{bind (set)} @{text "b\<^isub>1\<dots>b\<^isub>p"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}}
  1229   \end{center}
  1232   %\end{center}
  1230 
  1233   %
  1231   \noindent
  1234   %\noindent
  1232   in which the body-labels @{text "d"}$_{1..q}$ refer to types @{text ty}$_{1..q}$,
  1235   in which the body-labels @{text "d"}$_{1..q}$ refer to types @{text ty}$_{1..q}$,
  1233   and the binders @{text b}$_{1..p}$
  1236   and the binders @{text b}$_{1..p}$
  1234   either refer to labels of atom types (in case of shallow binders) or to binding 
  1237   either refer to labels of atom types (in case of shallow binders) or to binding 
  1235   functions taking a single label as argument (in case of deep binders). Assuming 
  1238   functions taking a single label as argument (in case of deep binders). Assuming 
  1236   @{text "D"} stands for the set of free atoms of the bodies, @{text B} for the 
  1239   @{text "D"} stands for the set of free atoms of the bodies, @{text B} for the 
  1256   (see \eqref{fvars}); otherwise we set @{text "fa_ty\<^isub>i d\<^isub>i = supp d\<^isub>i"}.
  1259   (see \eqref{fvars}); otherwise we set @{text "fa_ty\<^isub>i d\<^isub>i = supp d\<^isub>i"}.
  1257   
  1260   
  1258   In order to formally define the set @{text B} we use the following auxiliary @{text "bn"}-functions
  1261   In order to formally define the set @{text B} we use the following auxiliary @{text "bn"}-functions
  1259   for atom types to which shallow binders may refer
  1262   for atom types to which shallow binders may refer
  1260   %
  1263   %
  1261   \begin{center}
  1264   %\begin{center}
  1262   \begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
  1265   %\begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
  1263   @{text "bn_atom a"} & @{text "\<equiv>"} & @{text "{atom a}"}\\
  1266   %@{text "bn_atom a"} & @{text "\<equiv>"} & @{text "{atom a}"}\\
  1264   @{text "bn_atom_set as"} & @{text "\<equiv>"} & @{text "atoms as"}\\
  1267   %@{text "bn_atom_set as"} & @{text "\<equiv>"} & @{text "atoms as"}\\
  1265   @{text "bn_atom_list as"} & @{text "\<equiv>"} & @{text "atoms (set as)"}
  1268   %@{text "bn_atom_list as"} & @{text "\<equiv>"} & @{text "atoms (set as)"}
  1266   \end{tabular}
  1269   %\end{tabular}
       
  1270   %\end{center}
       
  1271   %
       
  1272   \begin{center}
       
  1273   @{text "bn_atom a \<equiv> {atom a}"}\hspace{17mm}
       
  1274   @{text "bn_atom_set as \<equiv> atoms as"}\\
       
  1275   @{text "bn_atom_list as \<equiv> atoms (set as)"}
  1267   \end{center}
  1276   \end{center}
  1268 
  1277 
  1269   \noindent 
  1278   \noindent 
  1270   Like the function @{text atom}, the function @{text "atoms"} coerces 
  1279   Like the function @{text atom}, the function @{text "atoms"} coerces 
  1271   a set of atoms to a set of the generic atom type. It is defined as 
  1280   a set of atoms to a set of the generic atom type. It is defined as 
  1279   \noindent 
  1288   \noindent 
  1280   where we use the auxiliary binding functions for shallow binders. 
  1289   where we use the auxiliary binding functions for shallow binders. 
  1281   The set @{text "B'"} collects all free atoms in non-recursive deep
  1290   The set @{text "B'"} collects all free atoms in non-recursive deep
  1282   binders. Let us assume these binders in @{text "bc\<^isub>i"} are
  1291   binders. Let us assume these binders in @{text "bc\<^isub>i"} are
  1283   %
  1292   %
  1284   \begin{center}
  1293   %\begin{center}
  1285   @{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}
  1294   \mbox{@{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}}
  1286   \end{center}
  1295   %\end{center}
  1287 
  1296   %
  1288   \noindent
  1297   %\noindent
  1289   with @{text "l"}$_{1..r}$ $\subseteq$ @{text "b"}$_{1..p}$ and none of the 
  1298   with @{text "l"}$_{1..r}$ $\subseteq$ @{text "b"}$_{1..p}$ and none of the 
  1290   @{text "l"}$_{1..r}$ being among the bodies @{text
  1299   @{text "l"}$_{1..r}$ being among the bodies @{text
  1291   "d"}$_{1..q}$. The set @{text "B'"} is defined as
  1300   "d"}$_{1..q}$. The set @{text "B'"} is defined as
  1292   %
  1301   %
  1293   \begin{center}
  1302   \begin{center}
  1301   the set of atoms that are left unbound by the binding functions @{text
  1310   the set of atoms that are left unbound by the binding functions @{text
  1302   "bn"}$_{1..m}$. We used for the definition of
  1311   "bn"}$_{1..m}$. We used for the definition of
  1303   this set the functions @{text "fa_bn"}$_{1..m}$, which are also defined by mutual
  1312   this set the functions @{text "fa_bn"}$_{1..m}$, which are also defined by mutual
  1304   recursion. Assume the user specified a @{text bn}-clause of the form
  1313   recursion. Assume the user specified a @{text bn}-clause of the form
  1305   %
  1314   %
  1306   \begin{center}
  1315   %\begin{center}
  1307   @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
  1316   @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
  1308   \end{center}
  1317   %\end{center}
  1309 
  1318   %
  1310   \noindent
  1319   %\noindent
  1311   where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$. For each of
  1320   where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$. For each of
  1312   the arguments we calculate the free atoms as follows:
  1321   the arguments we calculate the free atoms as follows:
  1313   %
  1322   %
  1314   \begin{center}
  1323   \begin{center}
  1315   \begin{tabular}{c@ {\hspace{2mm}}p{7cm}}
  1324   \begin{tabular}{c@ {\hspace{2mm}}p{0.9\textwidth}}
  1316   $\bullet$ & @{term "fa_ty\<^isub>i z\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text "rhs"} 
  1325   $\bullet$ & @{term "fa_ty\<^isub>i z\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text "rhs"} 
  1317   (that means nothing is bound in @{text "z\<^isub>i"} by the binding function),\\
  1326   (that means nothing is bound in @{text "z\<^isub>i"} by the binding function),\\
  1318   $\bullet$ & @{term "fa_bn\<^isub>i z\<^isub>i"} provided @{text "z\<^isub>i"} occurs in  @{text "rhs"}
  1327   $\bullet$ & @{term "fa_bn\<^isub>i z\<^isub>i"} provided @{text "z\<^isub>i"} occurs in  @{text "rhs"}
  1319   with the recursive call @{text "bn\<^isub>i z\<^isub>i"}, and\\
  1328   with the recursive call @{text "bn\<^isub>i z\<^isub>i"}, and\\
  1320   $\bullet$ & @{term "{}"} provided @{text "z\<^isub>i"} occurs in  @{text "rhs"},
  1329   $\bullet$ & @{term "{}"} provided @{text "z\<^isub>i"} occurs in  @{text "rhs"},
  1321   but without a recursive call.
  1330   but without a recursive call.
  1322   \end{tabular}
  1331   \end{tabular}
  1323   \end{center}
  1332   \end{center}
  1324 
  1333   %
  1325   \noindent
  1334   \noindent
  1326   For defining @{text "fa_bn (C z\<^isub>1 \<dots> z\<^isub>n)"} we just union up all these sets.
  1335   For defining @{text "fa_bn (C z\<^isub>1 \<dots> z\<^isub>n)"} we just union up all these sets.
  1327  
  1336  
  1328   To see how these definitions work in practice, let us reconsider the
  1337   To see how these definitions work in practice, let us reconsider the
  1329   term-constructors @{text "Let"} and @{text "Let_rec"} shown in
  1338   term-constructors @{text "Let"} and @{text "Let_rec"} shown in
  1360   free in @{text "as"}. This is
  1369   free in @{text "as"}. This is
  1361   in contrast with @{text "Let_rec"} where we have a recursive
  1370   in contrast with @{text "Let_rec"} where we have a recursive
  1362   binder to bind all occurrences of the atoms in @{text
  1371   binder to bind all occurrences of the atoms in @{text
  1363   "set (bn as)"} also inside @{text "as"}. Therefore we have to subtract
  1372   "set (bn as)"} also inside @{text "as"}. Therefore we have to subtract
  1364   @{text "set (bn as)"} from both @{text "fa\<^bsub>trm\<^esub> t"} and @{text "fa\<^bsub>assn\<^esub> as"}. 
  1373   @{text "set (bn as)"} from both @{text "fa\<^bsub>trm\<^esub> t"} and @{text "fa\<^bsub>assn\<^esub> as"}. 
  1365   Like the function @{text "bn"}, the function @{text "fa\<^bsub>bn\<^esub>"} traverses the 
  1374   %Like the function @{text "bn"}, the function @{text "fa\<^bsub>bn\<^esub>"} traverses the 
  1366   list of assignments, but instead returns the free atoms, which means in this 
  1375   %list of assignments, but instead returns the free atoms, which means in this 
  1367   example the free atoms in the argument @{text "t"}.  
  1376   %example the free atoms in the argument @{text "t"}.  
  1368 
  1377 
  1369   An interesting point in this
  1378   An interesting point in this
  1370   example is that a ``naked'' assignment (@{text "ANil"} or @{text "ACons"}) does not bind any
  1379   example is that a ``naked'' assignment (@{text "ANil"} or @{text "ACons"}) does not bind any
  1371   atoms, even if the binding function is specified over assignments. 
  1380   atoms, even if the binding function is specified over assignments. 
  1372   Only in the context of a @{text Let} or @{text "Let_rec"}, where the binding clauses are given, will
  1381   Only in the context of a @{text Let} or @{text "Let_rec"}, where the binding clauses are given, will
  1377   $\alpha$-equivalence.
  1386   $\alpha$-equivalence.
  1378 
  1387 
  1379   Next we define the $\alpha$-equivalence relations for the raw types @{text
  1388   Next we define the $\alpha$-equivalence relations for the raw types @{text
  1380   "ty"}$_{1..n}$ from the specification. We write them as
  1389   "ty"}$_{1..n}$ from the specification. We write them as
  1381   %
  1390   %
  1382   \begin{center}
  1391   %\begin{center}
  1383   @{text "\<approx>ty\<^isub>1, \<dots>, \<approx>ty\<^isub>n"}. 
  1392   @{text "\<approx>ty\<^isub>1, \<dots>, \<approx>ty\<^isub>n"}. 
  1384   \end{center}
  1393   %\end{center}
  1385 
  1394   %
  1386   \noindent
  1395   %\noindent
  1387   Like with the free-atom functions, we also need to
  1396   Like with the free-atom functions, we also need to
  1388   define auxiliary $\alpha$-equivalence relations 
  1397   define auxiliary $\alpha$-equivalence relations 
  1389   %
  1398   %
  1390   \begin{center}
  1399   %\begin{center}
  1391   @{text "\<approx>bn\<^isub>1, \<dots>, \<approx>bn\<^isub>m"}
  1400   @{text "\<approx>bn\<^isub>1, \<dots>, \<approx>bn\<^isub>m"}
  1392   \end{center}
  1401   %\end{center}
  1393 
  1402   %
  1394   \noindent
  1403   %\noindent
  1395   for the binding functions @{text "bn"}$_{1..m}$, 
  1404   for the binding functions @{text "bn"}$_{1..m}$, 
  1396   To simplify our definitions we will use the following abbreviations for
  1405   To simplify our definitions we will use the following abbreviations for
  1397   \emph{compound equivalence relations} and \emph{compound free-atom functions} acting on tuples
  1406   \emph{compound equivalence relations} and \emph{compound free-atom functions} acting on tuples
  1398   %
  1407   %
  1399   \begin{center}
  1408   \begin{center}
  1400   \begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
  1409   \begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
  1401   @{text "(x\<^isub>1,.., x\<^isub>n) (R\<^isub>1,.., R\<^isub>n) (x\<PRIME>\<^isub>1,.., x\<PRIME>\<^isub>n)"} & @{text "\<equiv>"} & \\
  1410   @{text "(x\<^isub>1,.., x\<^isub>n) (R\<^isub>1,.., R\<^isub>n) (x\<PRIME>\<^isub>1,.., x\<PRIME>\<^isub>n)"} & @{text "\<equiv>"} &
  1402   \multicolumn{3}{r}{@{text "x\<^isub>1 R\<^isub>1 x\<PRIME>\<^isub>1 \<and> .. \<and> x\<^isub>n R\<^isub>n x\<PRIME>\<^isub>n"}}\\
  1411   @{text "x\<^isub>1 R\<^isub>1 x\<PRIME>\<^isub>1 \<and> .. \<and> x\<^isub>n R\<^isub>n x\<PRIME>\<^isub>n"}\\
  1403   @{text "(fa\<^isub>1,.., fa\<^isub>n) (x\<^isub>1,.., x\<^isub>n)"} & @{text "\<equiv>"} & @{text "fa\<^isub>1 x\<^isub>1 \<union> .. \<union> fa\<^isub>n x\<^isub>n"}\\
  1412   @{text "(fa\<^isub>1,.., fa\<^isub>n) (x\<^isub>1,.., x\<^isub>n)"} & @{text "\<equiv>"} & @{text "fa\<^isub>1 x\<^isub>1 \<union> .. \<union> fa\<^isub>n x\<^isub>n"}\\
  1404   \end{tabular}
  1413   \end{tabular}
  1405   \end{center}
  1414   \end{center}
  1406 
  1415 
  1407 
  1416 
  1441   to a recursive argument of @{text C} with type @{text "ty\<^isub>i"}; otherwise
  1450   to a recursive argument of @{text C} with type @{text "ty\<^isub>i"}; otherwise
  1442   we take @{text "R\<^isub>i"} to be the equality @{text "="}. This lets us define
  1451   we take @{text "R\<^isub>i"} to be the equality @{text "="}. This lets us define
  1443   the premise for an empty binding clause succinctly as @{text "prems(bc\<^isub>i) \<equiv> D R D'"},
  1452   the premise for an empty binding clause succinctly as @{text "prems(bc\<^isub>i) \<equiv> D R D'"},
  1444   which can be unfolded to the series of premises
  1453   which can be unfolded to the series of premises
  1445   %
  1454   %
  1446   \begin{center}
  1455   %\begin{center}
  1447   @{text "d\<^isub>1 R\<^isub>1 d\<PRIME>\<^isub>1  \<dots> d\<^isub>q R\<^isub>q d\<PRIME>\<^isub>q"}
  1456   @{text "d\<^isub>1 R\<^isub>1 d\<PRIME>\<^isub>1  \<dots> d\<^isub>q R\<^isub>q d\<PRIME>\<^isub>q"}.
  1448   \end{center}
  1457   %\end{center}
  1449 
  1458   %
  1450   \noindent
  1459   %\noindent
  1451   We will use the unfolded version in the examples below.
  1460   We will use the unfolded version in the examples below.
  1452 
  1461 
  1453   Now suppose the binding clause @{text "bc\<^isub>i"} is of the general form 
  1462   Now suppose the binding clause @{text "bc\<^isub>i"} is of the general form 
  1454   %
  1463   %
  1455   \begin{equation}\label{nonempty}
  1464   \begin{equation}\label{nonempty}
  1497   these binders. An example is @{text "Let"} where we have to make sure the
  1506   these binders. An example is @{text "Let"} where we have to make sure the
  1498   right-hand sides of assignments are $\alpha$-equivalent. For this we use 
  1507   right-hand sides of assignments are $\alpha$-equivalent. For this we use 
  1499   relations @{text "\<approx>bn"}$_{1..m}$ (which we will formally define shortly).
  1508   relations @{text "\<approx>bn"}$_{1..m}$ (which we will formally define shortly).
  1500   Let us assume the non-recursive deep binders in @{text "bc\<^isub>i"} are
  1509   Let us assume the non-recursive deep binders in @{text "bc\<^isub>i"} are
  1501   %
  1510   %
  1502   \begin{center}
  1511   %\begin{center}
  1503   @{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}.
  1512   @{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}.
  1504   \end{center}
  1513   %\end{center}
  1505 
  1514   %
  1506   \noindent
  1515   %\noindent
  1507   The tuple @{text L} is then @{text "(l\<^isub>1,\<dots>,l\<^isub>r)"} (similarly @{text "L'"})
  1516   The tuple @{text L} is then @{text "(l\<^isub>1,\<dots>,l\<^isub>r)"} (similarly @{text "L'"})
  1508   and the compound equivalence relation @{text "R'"} is @{text "(\<approx>bn\<^isub>1,\<dots>,\<approx>bn\<^isub>r)"}. 
  1517   and the compound equivalence relation @{text "R'"} is @{text "(\<approx>bn\<^isub>1,\<dots>,\<approx>bn\<^isub>r)"}. 
  1509   All premises for @{text "bc\<^isub>i"} are then given by
  1518   All premises for @{text "bc\<^isub>i"} are then given by
  1510   %
  1519   %
  1511   \begin{center}
  1520   \begin{center}
  1514 
  1523 
  1515   \noindent 
  1524   \noindent 
  1516   The auxiliary $\alpha$-equivalence relations @{text "\<approx>bn"}$_{1..m}$ 
  1525   The auxiliary $\alpha$-equivalence relations @{text "\<approx>bn"}$_{1..m}$ 
  1517   in @{text "R'"} are defined as follows: assuming a @{text bn}-clause is of the form
  1526   in @{text "R'"} are defined as follows: assuming a @{text bn}-clause is of the form
  1518   %
  1527   %
  1519   \begin{center}
  1528   %\begin{center}
  1520   @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
  1529   @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
  1521   \end{center}
  1530   %\end{center}
  1522 
  1531   %
  1523   \noindent
  1532   %\noindent
  1524   where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$,
  1533   where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$,
  1525   then the corresponding $\alpha$-equivalence clause for @{text "\<approx>bn"} has the form
  1534   then the corresponding $\alpha$-equivalence clause for @{text "\<approx>bn"} has the form
  1526   %
  1535   %
  1527   \begin{center}
  1536   \begin{center}
  1528   \mbox{\infer{@{text "C z\<^isub>1 \<dots> z\<^isub>s \<approx>bn C z\<PRIME>\<^isub>1 \<dots> z\<PRIME>\<^isub>s"}}
  1537   \mbox{\infer{@{text "C z\<^isub>1 \<dots> z\<^isub>s \<approx>bn C z\<PRIME>\<^isub>1 \<dots> z\<PRIME>\<^isub>s"}}
  1531   
  1540   
  1532   \noindent
  1541   \noindent
  1533   In this clause the relations @{text "R"}$_{1..s}$ are given by 
  1542   In this clause the relations @{text "R"}$_{1..s}$ are given by 
  1534 
  1543 
  1535   \begin{center}
  1544   \begin{center}
  1536   \begin{tabular}{c@ {\hspace{2mm}}p{7cm}}
  1545   \begin{tabular}{c@ {\hspace{2mm}}p{0.9\textwidth}}
  1537   $\bullet$ & @{text "z\<^isub>i \<approx>ty z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs} and 
  1546   $\bullet$ & @{text "z\<^isub>i \<approx>ty z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs} and 
  1538   is a recursive argument of @{text C},\\
  1547   is a recursive argument of @{text C},\\
  1539   $\bullet$ & @{text "z\<^isub>i = z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs}
  1548   $\bullet$ & @{text "z\<^isub>i = z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs}
  1540   and is a non-recursive argument of @{text C},\\
  1549   and is a non-recursive argument of @{text C},\\
  1541   $\bullet$ & @{text "z\<^isub>i \<approx>bn\<^isub>i z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} occurs in @{text rhs}
  1550   $\bullet$ & @{text "z\<^isub>i \<approx>bn\<^isub>i z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} occurs in @{text rhs}
  1564   \end{tabular}
  1573   \end{tabular}
  1565   \end{center}
  1574   \end{center}
  1566 
  1575 
  1567   \begin{center}
  1576   \begin{center}
  1568   \begin{tabular}{@ {}c @ {}}
  1577   \begin{tabular}{@ {}c @ {}}
  1569   \infer{@{text "ANil \<approx>\<^bsub>assn\<^esub> ANil"}}{}\smallskip\\
  1578   \infer{@{text "ANil \<approx>\<^bsub>assn\<^esub> ANil"}}{}\hspace{9mm}
  1570   \infer{@{text "ACons a t as \<approx>\<^bsub>assn\<^esub> ACons a' t' as"}}
  1579   \infer{@{text "ACons a t as \<approx>\<^bsub>assn\<^esub> ACons a' t' as"}}
  1571   {@{text "a = a'"} & @{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>assn\<^esub> as'"}}
  1580   {@{text "a = a'"} & @{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>assn\<^esub> as'"}}
  1572   \end{tabular}
  1581   \end{tabular}
  1573   \end{center}
  1582   \end{center}
  1574 
  1583 
  1575   \begin{center}
  1584   \begin{center}
  1576   \begin{tabular}{@ {}c @ {}}
  1585   \begin{tabular}{@ {}c @ {}}
  1577   \infer{@{text "ANil \<approx>\<^bsub>bn\<^esub> ANil"}}{}\smallskip\\
  1586   \infer{@{text "ANil \<approx>\<^bsub>bn\<^esub> ANil"}}{}\hspace{9mm}
  1578   \infer{@{text "ACons a t as \<approx>\<^bsub>bn\<^esub> ACons a' t' as"}}
  1587   \infer{@{text "ACons a t as \<approx>\<^bsub>bn\<^esub> ACons a' t' as"}}
  1579   {@{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>bn\<^esub> as'"}}
  1588   {@{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>bn\<^esub> as'"}}
  1580   \end{tabular}
  1589   \end{tabular}
  1581   \end{center}
  1590   \end{center}
  1582 
  1591 
  1583   \noindent
  1592   \noindent
  1584   Note the difference between  $\approx_{\textit{assn}}$ and
  1593   Note the difference between  $\approx_{\textit{assn}}$ and
  1585   $\approx_{\textit{bn}}$: the latter only ``tracks'' $\alpha$-equivalence of 
  1594   $\approx_{\textit{bn}}$: the latter only ``tracks'' $\alpha$-equivalence of 
  1586   the components in an assignment that are \emph{not} bound. This is needed in the 
  1595   the components in an assignment that are \emph{not} bound. This is needed in the 
  1587   in the clause for @{text "Let"} (which is has
  1596   in the clause for @{text "Let"} (which is has
  1588   a non-recursive binder). The underlying reason is that the terms inside an assignment are not meant 
  1597   a non-recursive binder). 
  1589   to be ``under'' the binder. Such a premise is \emph{not} needed in @{text "Let_rec"}, 
  1598   %The underlying reason is that the terms inside an assignment are not meant 
  1590   because there all components of an assignment are ``under'' the binder. 
  1599   %to be ``under'' the binder. Such a premise is \emph{not} needed in @{text "Let_rec"}, 
       
  1600   %because there all components of an assignment are ``under'' the binder. 
  1591 *}
  1601 *}
  1592 
  1602 
  1593 section {* Establishing the Reasoning Infrastructure *}
  1603 section {* Establishing the Reasoning Infrastructure *}
  1594 
  1604 
  1595 text {*
  1605 text {*