LMCS-Paper/Paper.thy
changeset 3025 204a488c71c6
parent 3024 10e476d6f4b8
child 3029 6fd3fc3254ee
equal deleted inserted replaced
3024:10e476d6f4b8 3025:204a488c71c6
   233   and @{text bn} an auxiliary function identifying the variables to be bound
   233   and @{text bn} an auxiliary function identifying the variables to be bound
   234   by the @{text "\<LET>"}. This function can be defined by recursion over @{text
   234   by the @{text "\<LET>"}. This function can be defined by recursion over @{text
   235   assn} as follows
   235   assn} as follows
   236 
   236 
   237   \[
   237   \[
   238   @{text "bn(\<ANIL>) ="} @{term "{}"} \hspace{10mm} 
   238   @{text "bn(\<ANIL>) ="}~@{term "{}"} \hspace{10mm} 
   239   @{text "bn(\<ACONS> x t as) = {x} \<union> bn(as)"} 
   239   @{text "bn(\<ACONS> x t as) = {x} \<union> bn(as)"} 
   240   \]\smallskip
   240   \]\smallskip
   241 
   241 
   242   \noindent
   242   \noindent
   243   The scope of the binding is indicated by labels given to the types, for
   243   The scope of the binding is indicated by labels given to the types, for
   259   type theory (which Ott supports), but not at all in a HOL-based environment
   259   type theory (which Ott supports), but not at all in a HOL-based environment
   260   where every datatype must have a non-empty set-theoretic model
   260   where every datatype must have a non-empty set-theoretic model
   261   \cite{Berghofer99}.  Another reason is that we establish the reasoning
   261   \cite{Berghofer99}.  Another reason is that we establish the reasoning
   262   infrastructure for alpha-\emph{equated} terms. In contrast, Ott produces a
   262   infrastructure for alpha-\emph{equated} terms. In contrast, Ott produces a
   263   reasoning infrastructure in Isabelle/HOL for \emph{non}-alpha-equated, or
   263   reasoning infrastructure in Isabelle/HOL for \emph{non}-alpha-equated, or
   264   `raw', terms. While our alpha-equated terms and the raw terms produced by
   264   `raw', terms. While our alpha-equated terms and the `raw' terms produced by
   265   Ott use names for bound variables, there is a key difference: working with
   265   Ott use names for bound variables, there is a key difference: working with
   266   alpha-equated terms means, for example, that the two type-schemes
   266   alpha-equated terms means, for example, that the two type-schemes
   267 
   267 
   268   \[
   268   \[
   269   @{text "\<forall>{x}. x \<rightarrow> y  = \<forall>{x, z}. x \<rightarrow> y"} 
   269   @{text "\<forall>{x}. x \<rightarrow> y  = \<forall>{x, z}. x \<rightarrow> y"} 
   277   to).  
   277   to).  
   278 
   278 
   279   Our insistence on reasoning with alpha-equated terms comes from the
   279   Our insistence on reasoning with alpha-equated terms comes from the
   280   wealth of experience we gained with the older version of Nominal Isabelle:
   280   wealth of experience we gained with the older version of Nominal Isabelle:
   281   for non-trivial properties, reasoning with alpha-equated terms is much
   281   for non-trivial properties, reasoning with alpha-equated terms is much
   282   easier than reasoning with raw terms. The fundamental reason for this is
   282   easier than reasoning with `raw' terms. The fundamental reason for this is
   283   that the HOL-logic underlying Nominal Isabelle allows us to replace
   283   that the HOL-logic underlying Nominal Isabelle allows us to replace
   284   `equals-by-equals'. In contrast, replacing
   284   `equals-by-equals'. In contrast, replacing
   285   `alpha-equals-by-alpha-equals' in a representation based on `raw' terms
   285   `alpha-equals-by-alpha-equals' in a representation based on `raw' terms
   286   requires a lot of extra reasoning work.
   286   requires a lot of extra reasoning work.
   287 
   287 
   392   inspired by earlier work of Pitts \cite{Pitts04}. By means of automatic
   392   inspired by earlier work of Pitts \cite{Pitts04}. By means of automatic
   393   proofs, we establish a reasoning infrastructure for alpha-equated terms,
   393   proofs, we establish a reasoning infrastructure for alpha-equated terms,
   394   including properties about support, freshness and equality conditions for
   394   including properties about support, freshness and equality conditions for
   395   alpha-equated terms. We are also able to automatically derive strong
   395   alpha-equated terms. We are also able to automatically derive strong
   396   induction principles that have the variable convention already built in.
   396   induction principles that have the variable convention already built in.
   397   For this we simplify the earlier automated proofs by using the proof tools
   397   For this we simplify the earlier automated proofs by using the proving tools
   398   from the function package~\cite{Krauss09} of Isabelle/HOL.  The method
   398   from the function package~\cite{Krauss09} of Isabelle/HOL.  The method
   399   behind our specification of general binders is taken from the Ott-tool, but
   399   behind our specification of general binders is taken from the Ott-tool, but
   400   we introduce crucial restrictions, and also extensions, so that our
   400   we introduce crucial restrictions, and also extensions, so that our
   401   specifications make sense for reasoning about alpha-equated terms.  The main
   401   specifications make sense for reasoning about alpha-equated terms.  The main
   402   improvement over Ott is that we introduce three binding modes (only one is
   402   improvement over Ott is that we introduce three binding modes (only one is
   602   From property \eqref{equivariancedef} and the definition of @{text supp}, we 
   602   From property \eqref{equivariancedef} and the definition of @{text supp}, we 
   603   can easily deduce that equivariant functions have empty support. There is
   603   can easily deduce that equivariant functions have empty support. There is
   604   also a similar notion for equivariant relations, say @{text R}, namely the property
   604   also a similar notion for equivariant relations, say @{text R}, namely the property
   605   that
   605   that
   606   
   606   
   607   \begin{center}
   607   \[
   608   @{text "x R y"} \;\;\textit{implies}\;\; @{text "(\<pi> \<bullet> x) R (\<pi> \<bullet> y)"}
   608   @{text "x R y"} \;\;\textit{implies}\;\; @{text "(\<pi> \<bullet> x) R (\<pi> \<bullet> y)"}
   609   \end{center}
   609   \]\smallskip
   610   
   610   
   611   Using freshness, the nominal logic work provides us with general means for renaming 
   611   Using freshness, the nominal logic work provides us with general means for renaming 
   612   binders. 
   612   binders. 
   613   
   613   
   614   \noindent
   614   \noindent
   694  
   694  
   695   \noindent
   695   \noindent
   696   Note that the relation is
   696   Note that the relation is
   697   dependent on a free-atom function @{text "fa"} and a relation @{text
   697   dependent on a free-atom function @{text "fa"} and a relation @{text
   698   "R"}. The reason for this extra generality is that we will use
   698   "R"}. The reason for this extra generality is that we will use
   699   $\approx_{\,\textit{set}}^{\textit{R}, \textit{fa}}$ for both `raw' terms and 
   699   $\approx_{\,\textit{set}}^{\textit{R}, \textit{fa}}$ for both raw terms and 
   700   alpha-equated terms. In
   700   alpha-equated terms. In
   701   the latter case, @{text R} will be replaced by equality @{text "="} and we
   701   the latter case, @{text R} will be replaced by equality @{text "="} and we
   702   will prove that @{text "fa"} is equal to @{text "supp"}.
   702   will prove that @{text "fa"} is equal to @{text "supp"}.
   703 
   703 
   704   Definition \ref{alphaset} does not make any distinction between the
   704   Definition \ref{alphaset} does not make any distinction between the
   765   (similarly for $\approx_{\,\textit{list}}$).  It can also relatively easily be
   765   (similarly for $\approx_{\,\textit{list}}$).  It can also relatively easily be
   766   shown that all three notions of alpha-equivalence coincide, if we only
   766   shown that all three notions of alpha-equivalence coincide, if we only
   767   abstract a single atom.
   767   abstract a single atom.
   768 
   768 
   769   In the rest of this section we are going to show that the alpha-equivalences
   769   In the rest of this section we are going to show that the alpha-equivalences
   770   really lead to abstractions where some atoms are bound (more precisely
   770   really lead to abstractions where some atoms are bound (or more precisely
   771   removed from the support).  For this we will consider three abstraction
   771   removed from the support).  For this we will consider three abstraction
   772   types that are quotients of the relations
   772   types that are quotients of the relations
   773 
   773 
   774   \begin{equation}
   774   \begin{equation}
   775   \begin{array}{r}
   775   \begin{array}{r}
   841   \]\smallskip
   841   \]\smallskip
   842   \end{thm}
   842   \end{thm}
   843 
   843 
   844   \noindent
   844   \noindent
   845   In effect, this theorem states that the atoms @{text "as"} are bound in the
   845   In effect, this theorem states that the atoms @{text "as"} are bound in the
   846   abstraction. As stated earlier, this can be seen as litmus test that our
   846   abstraction. As stated earlier, this can be seen as a litmus test that our
   847   Definitions \ref{alphaset}, \ref{alphalist} and \ref{alphares} capture the
   847   Definitions \ref{alphaset}, \ref{alphalist} and \ref{alphares} capture the
   848   idea of alpha-equivalence relations. Below we will give the proof for the
   848   idea of alpha-equivalence relations. Below we will give the proof for the
   849   first equation of Theorem \ref{suppabs}. The others follow by similar
   849   first equation of Theorem \ref{suppabs}. The others follow by similar
   850   arguments. By definition of the abstraction type @{text
   850   arguments. By definition of the abstraction type @{text
   851   "abs\<^bsub>set\<^esub>"} we have
   851   "abs\<^bsub>set\<^esub>"} we have
   873   @{thm (prem 2) Abs_swap1(1)[where bs="as", no_vars]} then 
   873   @{thm (prem 2) Abs_swap1(1)[where bs="as", no_vars]} then 
   874   @{thm (concl) Abs_swap1(1)[where bs="as", no_vars]}
   874   @{thm (concl) Abs_swap1(1)[where bs="as", no_vars]}
   875   \end{lem}
   875   \end{lem}
   876   
   876   
   877   \begin{proof}
   877   \begin{proof}
   878   If @{term "a = b"} the lemma is immediate, since @{term "(a \<rightleftharpoons> b) = 0"}.
   878   If @{term "a = b"} the lemma is immediate, since @{term "(a \<rightleftharpoons> b)"} is then
       
   879   the identity permutation.
   879   Also in the other case the lemma is straightforward using \eqref{abseqiff}
   880   Also in the other case the lemma is straightforward using \eqref{abseqiff}
   880   and observing that the assumptions give us @{term "(a \<rightleftharpoons> b) \<bullet> (supp x - as) =
   881   and observing that the assumptions give us @{term "(a \<rightleftharpoons> b) \<bullet> (supp x - as) =
   881   (supp x - as)"}.  We therefore can use the swapping @{term "(a \<rightleftharpoons> b)"}. as
   882   (supp x - as)"}.  We therefore can use the swapping @{term "(a \<rightleftharpoons> b)"} as
   882   the permutation fpr the proof obligation.
   883   the permutation for the proof obligation.
   883   \end{proof}
   884   \end{proof}
   884   
   885   
   885   \noindent
   886   \noindent
   886   Assuming that @{text "x"} has finite support, this lemma together 
   887   Assuming that @{text "x"} has finite support, this lemma together 
   887   with \eqref{absperm} allows us to show
   888   with \eqref{absperm} allows us to show
   920   
   921   
   921   \noindent
   922   \noindent
   922   This is because for every finite sets of atoms, say @{text "bs"}, we have 
   923   This is because for every finite sets of atoms, say @{text "bs"}, we have 
   923   @{thm (concl) supp_finite_atom_set[where S="bs", no_vars]}.
   924   @{thm (concl) supp_finite_atom_set[where S="bs", no_vars]}.
   924   Finally, taking \eqref{halfone} and \eqref{halftwo} together establishes 
   925   Finally, taking \eqref{halfone} and \eqref{halftwo} together establishes 
   925   the first equation of Theorem~\ref{suppabs}. 
   926   the first equation of Theorem~\ref{suppabs}. The others are similar.
   926 
   927 
   927   Recall the definition of support given in \eqref{suppdef}, and note the difference between 
   928   Recall the definition of support given in \eqref{suppdef}, and note the difference between 
   928   the support of a `raw' pair and an abstraction
   929   the support of a raw pair and an abstraction
   929 
   930 
   930   \[
   931   \[
   931   @{term "supp (as, x) = supp as \<union> supp x"}\hspace{15mm}
   932   @{term "supp (as, x) = supp as \<union> supp x"}\hspace{15mm}
   932   @{term "supp (Abs_set as x) = supp x - as"}
   933   @{term "supp (Abs_set as x) = supp x - as"}
   933   \]\smallskip
   934   \]\smallskip
  1276   define explicitly an alpha-equivalence relation over them. We subsequently
  1277   define explicitly an alpha-equivalence relation over them. We subsequently
  1277   construct the quotient of the datatypes according to our alpha-equivalence.
  1278   construct the quotient of the datatypes according to our alpha-equivalence.
  1278 
  1279 
  1279 
  1280 
  1280   The `raw' datatype definition can be obtained by stripping off the 
  1281   The `raw' datatype definition can be obtained by stripping off the 
  1281   binding clauses and the labels from the types. We also have to invent
  1282   binding clauses and the labels from the types given by the user. We also have to invent
  1282   new names for the types @{text "ty\<^sup>\<alpha>"} and term-constructors @{text "C\<^sup>\<alpha>"}
  1283   new names for the  types @{text "ty\<^sup>\<alpha>"} and the term-constructors @{text "C\<^sup>\<alpha>"}. 
  1283   given by the user. In our implementation we just use the affix `@{text "_raw"}'.
  1284   In our implementation we just use the affix ``@{text "_raw"}''.
  1284   But for the purpose of this paper, we use the superscript @{text "_\<^sup>\<alpha>"} to indicate 
  1285   But for the purpose of this paper, we use the superscript @{text "_\<^sup>\<alpha>"} to indicate 
  1285   that a notion is given for alpha-equivalence classes and leave it out 
  1286   that a notion is given for alpha-equivalence classes and leave it out 
  1286   for the corresponding notion given on the `raw' level. So for example 
  1287   for the corresponding notion given on the raw level. So for example 
  1287   we have @{text "ty\<^sup>\<alpha> / ty"} and @{text "C\<^sup>\<alpha> / C"}
  1288   we have @{text "ty\<^sup>\<alpha> / ty"} and @{text "C\<^sup>\<alpha> / C"}
  1288   where @{term ty} is the type used in the quotient construction for 
  1289   where @{term ty} is the type used in the quotient construction for 
  1289   @{text "ty\<^sup>\<alpha>"} and @{text "C"} is the term-constructor of the `raw' type @{text "ty"},
  1290   @{text "ty\<^sup>\<alpha>"} and @{text "C"} is the term-constructor of the raw type @{text "ty"},
  1290   respectively @{text "C\<^sup>\<alpha>"} is the corresponding term-constructor of @{text "ty\<^sup>\<alpha>"}. 
  1291   respectively @{text "C\<^sup>\<alpha>"} is the corresponding term-constructor of @{text "ty\<^sup>\<alpha>"}. 
  1291 
  1292 
  1292   The resulting datatype definition is legal in Isabelle/HOL provided the datatypes are 
  1293   The resulting datatype definition is legal in Isabelle/HOL provided the datatypes are 
  1293   non-empty and the types in the constructors only occur in positive 
  1294   non-empty and the types in the constructors only occur in positive 
  1294   position (see \cite{Berghofer99} for an in-depth description of the datatype package
  1295   position (see \cite{Berghofer99} for an in-depth description of the datatype package
  1295   in Isabelle/HOL). 
  1296   in Isabelle/HOL). 
  1296   We subsequently define each of the user-specified binding 
  1297   We subsequently define each of the user-specified binding 
  1297   functions @{term "bn"}$_{1..m}$ by recursion over the corresponding 
  1298   functions @{term "bn"}$_{1..m}$ by recursion over the corresponding 
  1298   `raw' datatype. We also define permutation operations by 
  1299   raw datatype. We also define permutation operations by 
  1299   recursion so that for each term constructor @{text "C"} we have that
  1300   recursion so that for each term constructor @{text "C"} we have that
  1300   
  1301   
  1301   \begin{equation}\label{ceqvt}
  1302   \begin{equation}\label{ceqvt}
  1302   @{text "\<pi> \<bullet> (C z\<^isub>1 \<dots> z\<^isub>n) = C (\<pi> \<bullet> z\<^isub>1) \<dots> (\<pi> \<bullet> z\<^isub>n)"}
  1303   @{text "\<pi> \<bullet> (C z\<^isub>1 \<dots> z\<^isub>n) = C (\<pi> \<bullet> z\<^isub>1) \<dots> (\<pi> \<bullet> z\<^isub>n)"}
  1303   \end{equation}\smallskip
  1304   \end{equation}\smallskip
  1333   therefore functions that calculate those free atoms in deep binders.
  1334   therefore functions that calculate those free atoms in deep binders.
  1334 
  1335 
  1335   While the idea behind these free-atom functions is simple (they just
  1336   While the idea behind these free-atom functions is simple (they just
  1336   collect all atoms that are not bound), because of our rather complicated
  1337   collect all atoms that are not bound), because of our rather complicated
  1337   binding mechanisms their definitions are somewhat involved.  Given
  1338   binding mechanisms their definitions are somewhat involved.  Given
  1338   a `raw' term-constructor @{text "C"} of type @{text ty} and some associated
  1339   a raw term-constructor @{text "C"} of type @{text ty} and some associated
  1339   binding clauses @{text "bc\<^isub>1\<dots>bc\<^isub>k"}, the result of @{text
  1340   binding clauses @{text "bc\<^isub>1\<dots>bc\<^isub>k"}, the result of @{text
  1340   "fa_ty (C z\<^isub>1 \<dots> z\<^isub>n)"} will be the union @{text
  1341   "fa_ty (C z\<^isub>1 \<dots> z\<^isub>n)"} will be the union @{text
  1341   "fa(bc\<^isub>1) \<union> \<dots> \<union> fa(bc\<^isub>k)"} where we will define below what @{text "fa"} for a binding
  1342   "fa(bc\<^isub>1) \<union> \<dots> \<union> fa(bc\<^isub>k)"} where we will define below what @{text "fa"} for a binding
  1342   clause means. We only show the details for the mode \isacommand{binds (set)} (the other modes are similar). 
  1343   clause means. We only show the details for the mode \isacommand{binds (set)} (the other modes are similar). 
  1343   Suppose the binding clause @{text bc\<^isub>i} is of the form 
  1344   Suppose the binding clause @{text bc\<^isub>i} is of the form 
  1757 
  1758 
  1758   \begin{proof}
  1759   \begin{proof}
  1759   The function package of Isabelle/HOL allows us to prove the first part by
  1760   The function package of Isabelle/HOL allows us to prove the first part by
  1760   mutual induction over the definitions of the functions.\footnote{We have
  1761   mutual induction over the definitions of the functions.\footnote{We have
  1761   that the free-atom functions are terminating. From this the function
  1762   that the free-atom functions are terminating. From this the function
  1762   package derives an induction principle \cite{Krauss09}.} The second is by a
  1763   package derives an induction principle~\cite{Krauss09}.} The second is by a
  1763   straightforward induction over the rules of @{text "\<approx>ty"}$_{1..n}$ and
  1764   straightforward induction over the rules of @{text "\<approx>ty"}$_{1..n}$ and
  1764   @{text "\<approx>bn"}$_{1..m}$ using the first part.
  1765   @{text "\<approx>bn"}$_{1..m}$ using the first part.
  1765   \end{proof}
  1766   \end{proof}
  1766 
  1767 
  1767   \noindent
  1768   \noindent
  1783 
  1784 
  1784   \noindent 
  1785   \noindent 
  1785   We can feed the last lemma into our quotient package and obtain new types
  1786   We can feed the last lemma into our quotient package and obtain new types
  1786   @{text "ty"}$^\alpha_{1..n}$ representing alpha-equated terms of types
  1787   @{text "ty"}$^\alpha_{1..n}$ representing alpha-equated terms of types
  1787   @{text "ty"}$_{1..n}$. We also obtain definitions for the term-constructors
  1788   @{text "ty"}$_{1..n}$. We also obtain definitions for the term-constructors
  1788   @{text "C"}$^\alpha_{1..k}$ from the `raw' term-constructors @{text
  1789   @{text "C"}$^\alpha_{1..k}$ from the raw term-constructors @{text
  1789   "C"}$_{1..k}$, and similar definitions for the free-atom functions @{text
  1790   "C"}$_{1..k}$, and similar definitions for the free-atom functions @{text
  1790   "fa_ty"}$^\alpha_{1..n}$ and @{text "fa_bn"}$^\alpha_{1..m}$ as well as the
  1791   "fa_ty"}$^\alpha_{1..n}$ and @{text "fa_bn"}$^\alpha_{1..m}$ as well as the
  1791   binding functions @{text "bn"}$^\alpha_{1..m}$. However, these definitions
  1792   binding functions @{text "bn"}$^\alpha_{1..m}$. However, these definitions
  1792   are not really useful to the user, since they are given in terms of the
  1793   are not really useful to the user, since they are given in terms of the
  1793   isomorphisms we obtained by creating new types in Isabelle/HOL (recall the
  1794   isomorphisms we obtained by creating new types in Isabelle/HOL (recall the
  1809   \begin{equation}\label{distinctraw}
  1810   \begin{equation}\label{distinctraw}
  1810   \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r"}\;$\not\approx$@{text ty}\;@{text "D y\<^isub>1 \<dots> y\<^isub>s"}}
  1811   \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r"}\;$\not\approx$@{text ty}\;@{text "D y\<^isub>1 \<dots> y\<^isub>s"}}
  1811   \end{equation}\smallskip
  1812   \end{equation}\smallskip
  1812 
  1813 
  1813   \noindent
  1814   \noindent
  1814   holds for the corresponding `raw' term-constructors.
  1815   holds for the corresponding raw term-constructors.
  1815   In order to deduce \eqref{distinctalpha} from \eqref{distinctraw}, our quotient
  1816   In order to deduce \eqref{distinctalpha} from \eqref{distinctraw}, our quotient
  1816   package needs to know that the `raw' term-constructors @{text "C"} and @{text "D"} 
  1817   package needs to know that the raw term-constructors @{text "C"} and @{text "D"} 
  1817   are \emph{respectful} w.r.t.~the alpha-equivalence relations (see \cite{Homeier05}).
  1818   are \emph{respectful} w.r.t.~the alpha-equivalence relations (see \cite{Homeier05}).
  1818   Given, for example, @{text "C"} is of type @{text "ty"} with argument types
  1819   Given, for example, @{text "C"} is of type @{text "ty"} with argument types
  1819   @{text "ty"}$_{1..r}$, respectfulness amounts to showing that
  1820   @{text "ty"}$_{1..r}$, respectfulness amounts to showing that
  1820   
  1821   
  1821   \[\mbox{
  1822   \[\mbox{
  1847   restriction imposed on the form of the binding functions---namely \emph{not}
  1848   restriction imposed on the form of the binding functions---namely \emph{not}
  1848   to return any bound atoms. In Ott, in contrast, the user may define @{text
  1849   to return any bound atoms. In Ott, in contrast, the user may define @{text
  1849   "bn"}$_{1..m}$ so that they return bound atoms and in this case the third
  1850   "bn"}$_{1..m}$ so that they return bound atoms and in this case the third
  1850   implication is \emph{not} true. A result is that in general the lifting of the
  1851   implication is \emph{not} true. A result is that in general the lifting of the
  1851   corresponding binding functions in Ott to alpha-equated terms is impossible.
  1852   corresponding binding functions in Ott to alpha-equated terms is impossible.
  1852   Having established respectfulness for the `raw' term-constructors, the 
  1853   Having established respectfulness for the raw term-constructors, the 
  1853   quotient package is able to automatically deduce \eqref{distinctalpha} from 
  1854   quotient package is able to automatically deduce \eqref{distinctalpha} from 
  1854   \eqref{distinctraw}.
  1855   \eqref{distinctraw}.
  1855 
  1856 
  1856   Next we can lift the permutation operations defined in \eqref{ceqvt}. In
  1857   Next we can lift the permutation operations defined in \eqref{ceqvt}. In
  1857   order to make this lifting to go through, we have to show that the
  1858   order to make this lifting to go through, we have to show that the
  1867   \noindent
  1868   \noindent
  1868   to our infrastructure. In a similar fashion we can lift the defining equations
  1869   to our infrastructure. In a similar fashion we can lift the defining equations
  1869   of the free-atom functions @{text "fa_ty\<AL>"}$_{1..n}$ and
  1870   of the free-atom functions @{text "fa_ty\<AL>"}$_{1..n}$ and
  1870   @{text "fa_bn\<AL>"}$_{1..m}$ as well as of the binding functions @{text
  1871   @{text "fa_bn\<AL>"}$_{1..m}$ as well as of the binding functions @{text
  1871   "bn\<AL>"}$_{1..m}$ and size functions @{text "size_ty\<AL>"}$_{1..n}$.
  1872   "bn\<AL>"}$_{1..m}$ and size functions @{text "size_ty\<AL>"}$_{1..n}$.
  1872   The latter are defined automatically for the `raw' types @{text "ty"}$_{1..n}$
  1873   The latter are defined automatically for the raw types @{text "ty"}$_{1..n}$
  1873   by the datatype package of Isabelle/HOL.
  1874   by the datatype package of Isabelle/HOL.
  1874 
  1875 
  1875   We also need to lift the properties that characterise when two `raw' terms of the form
  1876   We also need to lift the properties that characterise when two raw terms of the form
  1876   
  1877   
  1877   \[
  1878   \[
  1878   \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r \<approx>ty C x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}}
  1879   \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r \<approx>ty C x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}}
  1879   \]\smallskip
  1880   \]\smallskip
  1880 
  1881 
  1907   \end{equation}\smallskip
  1908   \end{equation}\smallskip
  1908 
  1909 
  1909   We can also add to our infrastructure cases lemmas and a (mutual)
  1910   We can also add to our infrastructure cases lemmas and a (mutual)
  1910   induction principle for the types @{text "ty\<AL>"}$_{1..n}$. The cases
  1911   induction principle for the types @{text "ty\<AL>"}$_{1..n}$. The cases
  1911   lemmas allow the user to deduce a property @{text "P"} by exhaustively
  1912   lemmas allow the user to deduce a property @{text "P"} by exhaustively
  1912   analysing how an element in a type, say @{text "ty\<AL>"}$_i$, can be
  1913   analysing how an element of a type, say @{text "ty\<AL>"}$_i$, can be
  1913   constructed (that means one case for each of the term-constructors in @{text
  1914   constructed (that means one case for each of the term-constructors in @{text
  1914   "ty\<AL>"}$_i\,$). The lifted cases lemma for the type @{text
  1915   "ty\<AL>"}$_i\,$). The lifted cases lemma for the type @{text
  1915   "ty\<AL>"}$_i\,$ looks as follows
  1916   "ty\<AL>"}$_i\,$ looks as follows
  1916 
  1917 
  1917   \begin{equation}\label{cases}
  1918   \begin{equation}\label{cases}
  1954   term-constructors). 
  1955   term-constructors). 
  1955 
  1956 
  1956   Recall the lambda-calculus with @{text "Let"}-patterns shown in
  1957   Recall the lambda-calculus with @{text "Let"}-patterns shown in
  1957   \eqref{letpat}. The cases lemmas and the induction principle shown in
  1958   \eqref{letpat}. The cases lemmas and the induction principle shown in
  1958   \eqref{cases} and \eqref{induct} boil down in that example to the following three inference
  1959   \eqref{cases} and \eqref{induct} boil down in that example to the following three inference
  1959   rules (the cases lemmas are on the left-hand side; the induction principle
  1960   rules:
  1960   on the right):
       
  1961 
  1961 
  1962   \begin{equation}\label{inductex}\mbox{
  1962   \begin{equation}\label{inductex}\mbox{
  1963   \begin{tabular}{c}
  1963   \begin{tabular}{c}
  1964   \multicolumn{1}{@ {\hspace{-5mm}}l}{cases lemmas:}\smallskip\\
  1964   \multicolumn{1}{@ {\hspace{-5mm}}l}{cases lemmas:}\smallskip\\
  1965   \infer{@{text "P\<^bsub>trm\<^esub>"}}
  1965   \infer{@{text "P\<^bsub>trm\<^esub>"}}
  2109   call these induction principles \emph{weak}, because for a term-constructor,
  2109   call these induction principles \emph{weak}, because for a term-constructor,
  2110   say \mbox{@{text "C\<^sup>\<alpha> x\<^isub>1\<dots>x\<^isub>r"}}, the induction
  2110   say \mbox{@{text "C\<^sup>\<alpha> x\<^isub>1\<dots>x\<^isub>r"}}, the induction
  2111   hypothesis requires us to establish (under some assumptions) a property
  2111   hypothesis requires us to establish (under some assumptions) a property
  2112   @{text "P (C\<^sup>\<alpha> x\<^isub>1\<dots>x\<^isub>r)"} for \emph{all} @{text
  2112   @{text "P (C\<^sup>\<alpha> x\<^isub>1\<dots>x\<^isub>r)"} for \emph{all} @{text
  2113   "x"}$_{1..r}$. The problem with this is that in the presence of binders we cannot make
  2113   "x"}$_{1..r}$. The problem with this is that in the presence of binders we cannot make
  2114   any assumptions about the atoms that are bound. One obvious way around this
  2114   any assumptions about the atoms that are bound---for example assuming the variable convention. 
       
  2115   One obvious way around this
  2115   problem is to rename them. Unfortunately, this leads to very clunky proofs
  2116   problem is to rename them. Unfortunately, this leads to very clunky proofs
  2116   and makes formalisations grievous experiences (especially in the context of 
  2117   and makes formalisations grievous experiences (especially in the context of 
  2117   multiple bound atoms).
  2118   multiple bound atoms).
  2118 
  2119 
  2119   For the older versions of Nominal Isabelle we described in \cite{Urban08} a
  2120   For the older versions of Nominal Isabelle we described in \cite{Urban08} a
  2154   `control' which freshness assumptions the binders should satisfy in the
  2155   `control' which freshness assumptions the binders should satisfy in the
  2155   @{text "Lam\<^sup>\<alpha>"} and @{text "Let_pat\<^sup>\<alpha>"} cases: for @{text
  2156   @{text "Lam\<^sup>\<alpha>"} and @{text "Let_pat\<^sup>\<alpha>"} cases: for @{text
  2156   "Lam\<^sup>\<alpha>"} we can assume the bound atom @{text "x\<^isub>1"} is fresh
  2157   "Lam\<^sup>\<alpha>"} we can assume the bound atom @{text "x\<^isub>1"} is fresh
  2157   for @{text "c"} (third line); for @{text "Let_pat\<^sup>\<alpha>"} we can assume
  2158   for @{text "c"} (third line); for @{text "Let_pat\<^sup>\<alpha>"} we can assume
  2158   all bound atoms from an assignment are fresh for @{text "c"} (fourth
  2159   all bound atoms from an assignment are fresh for @{text "c"} (fourth
  2159   line). If @{text "c"} is instantiated appropriately in the strong induction
  2160   line). In order to see how an instantiation for @{text "c"} in the
  2160   principle, then the user can mimic the usual `pencil-and-paper' reasoning
  2161   conclusion `controls' the premises, you have to take into account that
  2161   employing the variable convention about bound and free variables being
  2162   Isabelle/HOL is a typed logic. That means if @{text "c"} is instantiated
  2162   distinct \cite{Urban08}.
  2163   with a pair, for example, then this type-constraint will be propagated to
       
  2164   the premises. The main point is that if @{text "c"} is instantiated
       
  2165   appropriately, then the user can mimic the usual `pencil-and-paper'
       
  2166   reasoning employing the variable convention about bound and free variables
       
  2167   being distinct \cite{Urban08}.
  2163 
  2168 
  2164   In what follows we will show that the weak induction principle in
  2169   In what follows we will show that the weak induction principle in
  2165   \eqref{inductex} implies the strong one \eqref{stronginduct}. This fact was established for
  2170   \eqref{inductex} implies the strong one \eqref{stronginduct}. This fact was established for
  2166   single binders in \cite{Urban08} by some quite involved, nevertheless
  2171   single binders in \cite{Urban08} by some quite involved, nevertheless
  2167   automated, induction proof. In this paper we simplify the proof by
  2172   automated, induction proof. In this paper we simplify the proof by
  2170   is well-founded induction. To use them in our setting, we have to discharge
  2175   is well-founded induction. To use them in our setting, we have to discharge
  2171   two proof obligations: one is that we have well-founded measures (one for
  2176   two proof obligations: one is that we have well-founded measures (one for
  2172   each type @{text "ty"}$^\alpha_{1..n}$) that decrease in every induction
  2177   each type @{text "ty"}$^\alpha_{1..n}$) that decrease in every induction
  2173   step and the other is that we have covered all cases in the induction
  2178   step and the other is that we have covered all cases in the induction
  2174   principle. Once these two proof obligations are discharged, the reasoning
  2179   principle. Once these two proof obligations are discharged, the reasoning
  2175   infrastructure in the function package will automatically derive the
  2180   infrastructure of the function package will automatically derive the
  2176   stronger induction principle. This way of establishing the stronger induction
  2181   stronger induction principle. This way of establishing the stronger induction
  2177   principle is considerably simpler than the earlier work presented \cite{Urban08}.
  2182   principle is considerably simpler than the earlier work presented \cite{Urban08}.
  2178 
  2183 
  2179   As measures we can use the size functions @{text "size_ty"}$^\alpha_{1..n}$,
  2184   As measures we can use the size functions @{text "size_ty"}$^\alpha_{1..n}$,
  2180   which we lifted in the previous section and which are all well-founded. It
  2185   which we lifted in the previous section and which are all well-founded. It
  2227   \begin{equation}\label{imp}
  2232   \begin{equation}\label{imp}
  2228   @{text "\<forall>x\<^isub>1 x\<^isub>2. atom x\<^isub>1 # c \<and> y = Lam\<^sup>\<alpha> x\<^isub>1 x\<^isub>2 \<Rightarrow> P\<^bsub>trm\<^esub>"}
  2233   @{text "\<forall>x\<^isub>1 x\<^isub>2. atom x\<^isub>1 # c \<and> y = Lam\<^sup>\<alpha> x\<^isub>1 x\<^isub>2 \<Rightarrow> P\<^bsub>trm\<^esub>"}
  2229   \end{equation}\smallskip
  2234   \end{equation}\smallskip
  2230 
  2235 
  2231   \noindent
  2236   \noindent
  2232   which we must use to infer @{text "P\<^bsub>trm\<^esub>"}. Clearly, we cannot
  2237   which we must use in order to infer @{text "P\<^bsub>trm\<^esub>"}. Clearly, we cannot
  2233   use this implication directly, because we have no information whether or not @{text
  2238   use this implication directly, because we have no information whether or not @{text
  2234   "x\<^isub>1"} is fresh for @{text "c"}.  However, we can use Properties
  2239   "x\<^isub>1"} is fresh for @{text "c"}.  However, we can use Properties
  2235   \ref{supppermeq} and \ref{avoiding} to rename @{text "x\<^isub>1"}: we know
  2240   \ref{supppermeq} and \ref{avoiding} to rename @{text "x\<^isub>1"}: we know
  2236   by Theorem~\ref{suppfa} that @{text "{atom x\<^isub>1} #\<^sup>* Lam\<^sup>\<alpha>
  2241   by Theorem~\ref{suppfa} that @{text "{atom x\<^isub>1} #\<^sup>* Lam\<^sup>\<alpha>
  2237   x\<^isub>1 x\<^isub>2"} (since its support is @{text "supp x\<^isub>2 -
  2242   x\<^isub>1 x\<^isub>2"} (since its support is @{text "supp x\<^isub>2 -
  2272   \[
  2277   \[
  2273   @{text "Let (x, y) := (x, y) in (x, y)"}
  2278   @{text "Let (x, y) := (x, y) in (x, y)"}
  2274   \]\smallskip
  2279   \]\smallskip
  2275 
  2280 
  2276   \noindent
  2281   \noindent
  2277   where @{text x} and @{text y} are bound in the term, but they are also free
  2282   where @{text x} and @{text y} are bound in the term, but are also free
  2278   in the right-hand side of the assignment. We can, however, obtain such a renaming permutation, say
  2283   in the right-hand side of the assignment. We can, however, obtain such a renaming permutation, say
  2279   @{text "\<pi>"}, for the abstraction @{term "Abs_lst (bn_al x\<^isub>1)
  2284   @{text "\<pi>"}, for the abstraction @{term "Abs_lst (bn_al x\<^isub>1)
  2280   x\<^isub>3"}. As a result we have \mbox{@{term "set (bn_al (\<pi> \<bullet> x\<^isub>1))
  2285   x\<^isub>3"}. As a result we have \mbox{@{term "set (bn_al (\<pi> \<bullet> x\<^isub>1))
  2281   \<sharp>* c"}} and @{term "Abs_lst (bn_al (\<pi> \<bullet> x\<^isub>1)) (\<pi> \<bullet> x\<^isub>3) =
  2286   \<sharp>* c"}} and @{term "Abs_lst (bn_al (\<pi> \<bullet> x\<^isub>1)) (\<pi> \<bullet> x\<^isub>3) =
  2282   Abs_lst (bn_al x\<^isub>1) x\<^isub>3"} (remember @{text "set"} and @{text
  2287   Abs_lst (bn_al x\<^isub>1) x\<^isub>3"} (remember @{text "set"} and @{text
  2301   Taking the left-hand side in the assumption shown in \eqref{assmtwo}, we can use
  2306   Taking the left-hand side in the assumption shown in \eqref{assmtwo}, we can use
  2302   the implication \eqref{impletpat} from the stronger cases lemma to infer @{text "P\<^bsub>trm\<^esub>"}, as needed.
  2307   the implication \eqref{impletpat} from the stronger cases lemma to infer @{text "P\<^bsub>trm\<^esub>"}, as needed.
  2303 
  2308 
  2304   The remaining difficulty is when a deep binder contains some atoms that are
  2309   The remaining difficulty is when a deep binder contains some atoms that are
  2305   bound and some that are free. An example is @{text "Let\<^sup>\<alpha>"} in
  2310   bound and some that are free. An example is @{text "Let\<^sup>\<alpha>"} in
  2306   the example \eqref{letrecs}.  In such cases @{text "(\<pi> \<bullet> x\<^isub>1)
  2311   \eqref{letrecs}.  In such cases @{text "(\<pi> \<bullet> x\<^isub>1)
  2307   \<approx>\<AL>\<^bsub>bn\<^esub> x\<^isub>1"} does not hold in general. The idea however is
  2312   \<approx>\<AL>\<^bsub>bn\<^esub> x\<^isub>1"} does not hold in general. The idea however is
  2308   that @{text "\<pi>"} only renames atoms that become bound. In this way @{text "\<pi>"}
  2313   that @{text "\<pi>"} only renames atoms that become bound. In this way @{text "\<pi>"}
  2309   does not affect @{text "\<approx>\<AL>\<^bsub>bn\<^esub>"}. However, the problem is that the
  2314   does not affect @{text "\<approx>\<AL>\<^bsub>bn\<^esub>"} (which only tracks alpha-equivalence of terms that are not
       
  2315   under the binder). However, the problem is that the
  2310   permutation operation @{text "\<pi> \<bullet> x\<^isub>1"} applies to all attoms in @{text "x\<^isub>1"}. To avoid this
  2316   permutation operation @{text "\<pi> \<bullet> x\<^isub>1"} applies to all attoms in @{text "x\<^isub>1"}. To avoid this
  2311   we introduce an auxiliary permutation operations, written @{text "_
  2317   we introduce an auxiliary permutation operations, written @{text "_
  2312   \<bullet>\<^bsub>bn\<^esub> _"}, for deep binders that only permutes bound atoms (or
  2318   \<bullet>\<^bsub>bn\<^esub> _"}, for deep binders that only permutes bound atoms (or
  2313   more precisely the atoms specified by the @{text "bn"}-functions) and leaves
  2319   more precisely the atoms specified by the @{text "bn"}-functions) and leaves
  2314   the other atoms unchanged. Like the functions @{text "fa_bn"}$_{1..m}$, we
  2320   the other atoms unchanged. Like the functions @{text "fa_bn"}$_{1..m}$, we
  2315   can define these operations over raw terms analysing how the functions @{text
  2321   can define these permutation operations over raw terms analysing how the functions @{text
  2316   "bn"}$_{1..m}$ are defined. Assuming the user specified a clause
  2322   "bn"}$_{1..m}$ are defined. Assuming the user specified a clause
  2317 
  2323 
  2318   \[  
  2324   \[  
  2319   @{text "bn (C x\<^isub>1 \<dots> x\<^isub>r) = rhs"}
  2325   @{text "bn (C x\<^isub>1 \<dots> x\<^isub>r) = rhs"}
  2320   \]\smallskip
  2326   \]\smallskip
  2329   $\bullet$ & @{text "y\<^isub>i \<equiv> \<pi> \<bullet> x\<^isub>i"} otherwise
  2335   $\bullet$ & @{text "y\<^isub>i \<equiv> \<pi> \<bullet> x\<^isub>i"} otherwise
  2330   \end{tabular}}
  2336   \end{tabular}}
  2331   \]\smallskip
  2337   \]\smallskip
  2332 
  2338 
  2333   \noindent
  2339   \noindent
  2334   Using again the quotient package  we can lift the @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} functions to 
  2340   Using again the quotient package  we can lift the auxiliary permutation operations
       
  2341   @{text "_ \<bullet>\<^bsub>bn\<^esub> _"}
  2335   alpha-equated terms. Moreover we can prove the following two properties
  2342   alpha-equated terms. Moreover we can prove the following two properties
  2336 
  2343 
  2337   \begin{lem}\label{permutebn} 
  2344   \begin{lem}\label{permutebn} 
  2338   Given a binding function @{text "bn\<^sup>\<alpha>"} and auxiliary equivalence @{text "\<approx>\<AL>\<^bsub>bn\<^esub>"} 
  2345   Given a binding function @{text "bn\<^sup>\<alpha>"} and auxiliary equivalence @{text "\<approx>\<AL>\<^bsub>bn\<^esub>"} 
  2339   then for all @{text "\<pi>"}\smallskip\\
  2346   then for all @{text "\<pi>"}\smallskip\\
  2347   \end{proof}
  2354   \end{proof}
  2348 
  2355 
  2349   \noindent
  2356   \noindent
  2350   The first property states that a permutation applied to a binding function
  2357   The first property states that a permutation applied to a binding function
  2351   is equivalent to first permuting the binders and then calculating the bound
  2358   is equivalent to first permuting the binders and then calculating the bound
  2352   atoms. The second states that @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} preserves
  2359   atoms. The second states that @{text "_ \<bullet>\<AL>\<^bsub>bn\<^esub> _"} preserves
  2353   @{text "\<approx>\<AL>\<^bsub>bn\<^esub>"}.  The main point of the auxiliary
  2360   @{text "\<approx>\<AL>\<^bsub>bn\<^esub>"}.  The main point of the auxiliary
  2354   permutation functions is that they allow us to rename just the binders in a
  2361   permutation functions is that they allow us to rename just the binders in a
  2355   term, without changing anything else.
  2362   term, without changing anything else.
  2356   
  2363   
  2357   Having the auxiliary permutation function in place, we can now solve all remaining cases. 
  2364   Having the auxiliary permutation function in place, we can now solve all remaining cases. 
  2364   \]\smallskip
  2371   \]\smallskip
  2365 
  2372 
  2366   \noindent
  2373   \noindent
  2367   hold. Using the first part of Lemma \ref{permutebn}, we can simplify this
  2374   hold. Using the first part of Lemma \ref{permutebn}, we can simplify this
  2368   to @{text "set (bn\<^sup>\<alpha> (\<pi> \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1)) #\<^sup>* c"} and 
  2375   to @{text "set (bn\<^sup>\<alpha> (\<pi> \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1)) #\<^sup>* c"} and 
  2369   @{text "[bn\<^sup>\<alpha> (\<pi> \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1)]\<^bsub>list\<^esub>. (\<pi> \<bullet> x\<^isub>2) = [bn\<^sup>\<alpha> x\<^isub>1]\<^bsub>list\<^esub>. x\<^isub>2"}. Since
  2376   \mbox{@{text "[bn\<^sup>\<alpha> (\<pi> \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1)]\<^bsub>list\<^esub>. (\<pi> \<bullet> x\<^isub>2) = [bn\<^sup>\<alpha> x\<^isub>1]\<^bsub>list\<^esub>. x\<^isub>2"}}. Since
  2370   @{text "(\<pi>  \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1) \<approx>\<AL>\<^bsub>bn\<^esub> x\<^isub>1"} holds by teh second part,
  2377   @{text "(\<pi>  \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1) \<approx>\<AL>\<^bsub>bn\<^esub> x\<^isub>1"} holds by the second part,
  2371   we can infer that
  2378   we can infer that
  2372 
  2379 
  2373   \[
  2380   \[
  2374   @{text "Let\<^sup>\<alpha> (\<pi> \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1) (\<pi> \<bullet> x\<^isub>2) = Let\<^sup>\<alpha> x\<^isub>1 x\<^isub>2"}  
  2381   @{text "Let\<^sup>\<alpha> (\<pi> \<bullet>\<AL>\<^bsub>bn\<^esub> x\<^isub>1) (\<pi> \<bullet> x\<^isub>2) = Let\<^sup>\<alpha> x\<^isub>1 x\<^isub>2"}  
  2375   \]\smallskip
  2382   \]\smallskip
  2376 
  2383 
  2377   \noindent
  2384   \noindent
  2378   holds. This allows us to use the implication from the strong cases
  2385   holds. This allows us to use the implication from the strong cases
  2379   lemma.
  2386   lemma, and we are done.
  2380 
  2387 
  2381   Conseqently,  we can discharge all proof-obligations about having covered all
  2388   Conseqently,  we can discharge all proof-obligations about having covered all
  2382   cases. This completes the proof establishing that the weak induction principles imply 
  2389   cases. This completes the proof establishing that the weak induction principles imply 
  2383   the strong induction principles. These strong induction principles have proved 
  2390   the strong induction principles. These strong induction principles have proved 
  2384   already to be very useful in practice, particularly for proving properties about 
  2391   already to be very useful in practice, particularly for proving properties about 
  2447   a definition for alpha-equivalence and free variables for terms that can be
  2454   a definition for alpha-equivalence and free variables for terms that can be
  2448   specified in Ott.  This definition is rather different from ours, not using
  2455   specified in Ott.  This definition is rather different from ours, not using
  2449   any nominal techniques.  To our knowledge there is no concrete mathematical
  2456   any nominal techniques.  To our knowledge there is no concrete mathematical
  2450   result concerning this notion of alpha-equivalence and free variables. We
  2457   result concerning this notion of alpha-equivalence and free variables. We
  2451   have proved that our definitions lead to alpha-equated terms, whose support
  2458   have proved that our definitions lead to alpha-equated terms, whose support
  2452   is as expected (that means bound names are removed from the support). We
  2459   is as expected (that means bound atoms are removed from the support). We
  2453   also showed that our specifications lift from `raw' types to types of
  2460   also showed that our specifications lift from `raw' types to types of
  2454   alpha-equivalence classes. For this we had to establish (automatically) that every
  2461   alpha-equivalence classes. For this we had to establish (automatically) that every
  2455   term-constructor and function defined for `raw' types 
  2462   term-constructor and function defined for `raw' types 
  2456   is respectful w.r.t.~alpha-equivalence.
  2463   is respectful w.r.t.~alpha-equivalence.
  2457 
  2464 
  2510   both specifications.  Because of how we set up our definitions, we also had
  2517   both specifications.  Because of how we set up our definitions, we also had
  2511   to impose some restrictions (like a single binding function for a deep
  2518   to impose some restrictions (like a single binding function for a deep
  2512   binder) that are not present in Ott. Our expectation is that we can still
  2519   binder) that are not present in Ott. Our expectation is that we can still
  2513   cover many interesting term-calculi from programming language research, for
  2520   cover many interesting term-calculi from programming language research, for
  2514   example the Core-Haskell language from the Introduction. With the work
  2521   example the Core-Haskell language from the Introduction. With the work
  2515   presented in this paper we can define formally this language as shown in 
  2522   presented in this paper we can define it formally as shown in 
  2516   Figure~\ref{nominalcorehas} and then Nominal Isabelle derives automatically
  2523   Figure~\ref{nominalcorehas} and then Nominal Isabelle derives automatically
  2517   a corresponding reasoning infrastructure.
  2524   a corresponding reasoning infrastructure.
  2518 
  2525 
  2519   \begin{figure}[p]
  2526   \begin{figure}[p]
  2520   \begin{boxedminipage}{\linewidth}
  2527   \begin{boxedminipage}{\linewidth}
  2563   $|$~@{text "bv\<^isub>3 (TVCKCons c cty tl) = (atom c)::(bv\<^isub>3 tl)"}\\
  2570   $|$~@{text "bv\<^isub>3 (TVCKCons c cty tl) = (atom c)::(bv\<^isub>3 tl)"}\\
  2564   \end{tabular}
  2571   \end{tabular}
  2565   \end{boxedminipage}
  2572   \end{boxedminipage}
  2566   \caption{A definition for Core-Haskell in Nominal Isabelle. For the moment we
  2573   \caption{A definition for Core-Haskell in Nominal Isabelle. For the moment we
  2567   do not support nested types; therefore we explicitly have to unfold the 
  2574   do not support nested types; therefore we explicitly have to unfold the 
  2568   lists @{text "co_lst"}, @{text "assoc_lst"} and so on. Apart from that, the 
  2575   lists @{text "co_lst"}, @{text "assoc_lst"} and so on. Apart from that limitation, the 
  2569   definition follows closely the original shown in Figure~\ref{corehas}. The
  2576   definition follows closely the original shown in Figure~\ref{corehas}. The
  2570   point of our work is that having made such a definition in Nominal Isabelle,
  2577   point of our work is that having made such a definition in Nominal Isabelle,
  2571   one obtains automatically a reasoning infrastructure for Core-Haskell.
  2578   one obtains automatically a reasoning infrastructure for Core-Haskell.
  2572   \label{nominalcorehas}}
  2579   \label{nominalcorehas}}
  2573   \end{figure}
  2580   \end{figure}