Paper/Paper.thy
author Christian Urban <urbanc@in.tum.de>
Tue, 30 Mar 2010 13:23:12 +0200
changeset 1712 40f13b52b107
parent 1711 55cb244b020c
parent 1710 88b33de74e61
child 1713 a3f923d88215
permissions -rw-r--r--
merged
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
(*<*)
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
theory Paper
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
     3
imports "../Nominal/Test" "LaTeXsugar"
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
begin
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
     5
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
     6
consts
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
     7
  fv :: "'a \<Rightarrow> 'b"
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
     8
  abs_set :: "'a \<Rightarrow> 'b \<Rightarrow> 'c" 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
     9
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    10
definition
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    11
 "equal \<equiv> (op =)" 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    12
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    13
notation (latex output)
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    14
  swap ("'(_ _')" [1000, 1000] 1000) and
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    15
  fresh ("_ # _" [51, 51] 50) and
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
    16
  fresh_star ("_ #\<^sup>* _" [51, 51] 50) and
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    17
  supp ("supp _" [78] 73) and
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    18
  uminus ("-_" [78] 73) and
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    19
  If  ("if _ then _ else _" 10) and
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
    20
  alpha_gen ("_ \<approx>\<^raw:\raisebox{-1pt}{\makebox[0mm][l]{$\,_{\textit{set}}$}}>\<^bsup>_,_,_\<^esup> _") and
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
    21
  alpha_lst ("_ \<approx>\<^raw:\raisebox{-1pt}{\makebox[0mm][l]{$\,_{\textit{list}}$}}>\<^bsup>_,_,_\<^esup> _") and
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
    22
  alpha_res ("_ \<approx>\<^raw:\raisebox{-1pt}{\makebox[0mm][l]{$\,_{\textit{res}}$}}>\<^bsup>_,_,_\<^esup> _") and
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    23
  abs_set ("_ \<approx>\<^raw:{$\,_{\textit{abs\_set}}$}> _") and
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    24
  fv ("fv'(_')" [100] 100) and
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    25
  equal ("=") and
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    26
  alpha_abs ("_ \<approx>\<^raw:{$\,_{\textit{abs\_set}}$}> _") and 
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
    27
  Abs ("[_]\<^raw:$\!$>\<^bsub>set\<^esub>._" [20, 101] 999) and
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    28
  Abs_lst ("[_]\<^raw:$\!$>\<^bsub>list\<^esub>._") and
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
    29
  Abs_res ("[_]\<^raw:$\!$>\<^bsub>res\<^esub>._") and
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
    30
  Cons ("_::_" [78,77] 73) and
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
    31
  supp_gen ("aux _" [1000] 100)
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
(*>*)
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    34
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
section {* Introduction *}
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
text {*
1524
Christian Urban <urbanc@in.tum.de>
parents: 1523
diff changeset
    38
  So far, Nominal Isabelle provides a mechanism for constructing
1607
ac69ed8303cc tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1587
diff changeset
    39
  alpha-equated terms, for example
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
    40
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    41
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    42
  @{text "t ::= x | t t | \<lambda>x. t"}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    43
  \end{center}
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    44
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    45
  \noindent
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
    46
  where free and bound variables have names.  For such alpha-equated terms,  Nominal Isabelle
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    47
  derives automatically a reasoning infrastructure that has been used
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    48
  successfully in formalisations of an equivalence checking algorithm for LF
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    49
  \cite{UrbanCheneyBerghofer08}, Typed
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    50
  Scheme~\cite{TobinHochstadtFelleisen08}, several calculi for concurrency
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
    51
  \cite{BengtsonParow09} and a strong normalisation result
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    52
  for cut-elimination in classical logic \cite{UrbanZhu08}. It has also been
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    53
  used by Pollack for formalisations in the locally-nameless approach to
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    54
  binding \cite{SatoPollack10}.
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    55
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
    56
  However, Nominal Isabelle has fared less well in a formalisation of
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
    57
  the algorithm W \cite{UrbanNipkow09}, where types and type-schemes are,
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
    58
  respectively, of the form
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    59
  %
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    60
  \begin{equation}\label{tysch}
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    61
  \begin{array}{l}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    62
  @{text "T ::= x | T \<rightarrow> T"}\hspace{5mm}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    63
  @{text "S ::= \<forall>{x\<^isub>1,\<dots>, x\<^isub>n}. T"}
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    64
  \end{array}
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    65
  \end{equation}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    66
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    67
  \noindent
1566
2facd6645599 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1556
diff changeset
    68
  and the quantification $\forall$ binds a finite (possibly empty) set of
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    69
  type-variables.  While it is possible to implement this kind of more general
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    70
  binders by iterating single binders, this leads to a rather clumsy
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    71
  formalisation of W. The need of iterating single binders is also one reason
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    72
  why Nominal Isabelle and similar theorem provers that only provide
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    73
  mechanisms for binding single variables have not fared extremely well with the
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    74
  more advanced tasks in the POPLmark challenge \cite{challenge05}, because
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    75
  also there one would like to bind multiple variables at once.
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    76
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
    77
  Binding multiple variables has interesting properties that cannot be captured
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
    78
  easily by iterating single binders. For example in case of type-schemes we do not
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
    79
  want to make a distinction about the order of the bound variables. Therefore
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    80
  we would like to regard the following two type-schemes as alpha-equivalent
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    81
  %
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    82
  \begin{equation}\label{ex1}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
    83
  @{text "\<forall>{x, y}. x \<rightarrow> y  \<approx>\<^isub>\<alpha>  \<forall>{y, x}. y \<rightarrow> x"} 
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    84
  \end{equation}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    85
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    86
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    87
  but assuming that @{text x}, @{text y} and @{text z} are distinct variables,
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
    88
  the following two should \emph{not} be alpha-equivalent
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    89
  %
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    90
  \begin{equation}\label{ex2}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
    91
  @{text "\<forall>{x, y}. x \<rightarrow> y  \<notapprox>\<^isub>\<alpha>  \<forall>{z}. z \<rightarrow> z"} 
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    92
  \end{equation}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    93
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    94
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    95
  Moreover, we like to regard type-schemes as alpha-equivalent, if they differ
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    96
  only on \emph{vacuous} binders, such as
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    97
  %
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
    98
  \begin{equation}\label{ex3}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
    99
  @{text "\<forall>{x}. x \<rightarrow> y  \<approx>\<^isub>\<alpha>  \<forall>{x, z}. x \<rightarrow> y"}
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   100
  \end{equation}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   101
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   102
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   103
  where @{text z} does not occur freely in the type.  In this paper we will
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   104
  give a general binding mechanism and associated notion of alpha-equivalence
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   105
  that can be used to faithfully represent this kind of binding in Nominal
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   106
  Isabelle.  The difficulty of finding the right notion for alpha-equivalence
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   107
  can be appreciated in this case by considering that the definition given by
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   108
  Leroy in \cite{Leroy92} is incorrect (it omits a side-condition).
1524
Christian Urban <urbanc@in.tum.de>
parents: 1523
diff changeset
   109
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   110
  However, the notion of alpha-equivalence that is preserved by vacuous
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   111
  binders is not always wanted. For example in terms like
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   112
  %
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   113
  \begin{equation}\label{one}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   114
  @{text "\<LET> x = 3 \<AND> y = 2 \<IN> x - y \<END>"}
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   115
  \end{equation}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   116
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   117
  \noindent
1524
Christian Urban <urbanc@in.tum.de>
parents: 1523
diff changeset
   118
  we might not care in which order the assignments $x = 3$ and $y = 2$ are
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   119
  given, but it would be unusual to regard \eqref{one} as alpha-equivalent 
1524
Christian Urban <urbanc@in.tum.de>
parents: 1523
diff changeset
   120
  with
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   121
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   122
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   123
  @{text "\<LET> x = 3 \<AND> y = 2 \<AND> z = loop \<IN> x - y \<END>"}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   124
  \end{center}
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   125
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   126
  \noindent
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   127
  Therefore we will also provide a separate binding mechanism for cases in
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   128
  which the order of binders does not matter, but the ``cardinality'' of the
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   129
  binders has to agree.
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   130
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   131
  However, we found that this is still not sufficient for dealing with
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   132
  language constructs frequently occurring in programming language
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   133
  research. For example in @{text "\<LET>"}s containing patterns like
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   134
  %
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   135
  \begin{equation}\label{two}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   136
  @{text "\<LET> (x, y) = (3, 2) \<IN> x - y \<END>"}
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   137
  \end{equation}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   138
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   139
  \noindent
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   140
  we want to bind all variables from the pattern inside the body of the
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   141
  $\mathtt{let}$, but we also care about the order of these variables, since
1566
2facd6645599 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1556
diff changeset
   142
  we do not want to regard \eqref{two} as alpha-equivalent with
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   143
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   144
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   145
  @{text "\<LET> (y, x) = (3, 2) \<IN> x - y \<END>"}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   146
  \end{center}
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   147
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   148
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   149
  As a result, we provide three general binding mechanisms each of which binds
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   150
  multiple variables at once, and let the user chose which one is intended
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   151
  when formalising a term-calculus.
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   152
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   153
  By providing these general binding mechanisms, however, we have to work
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   154
  around a problem that has been pointed out by Pottier \cite{Pottier06} and
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   155
  Cheney \cite{Cheney05}: in @{text "\<LET>"}-constructs of the form
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   156
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   157
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   158
  @{text "\<LET> x\<^isub>1 = t\<^isub>1 \<AND> \<dots> \<AND> x\<^isub>n = t\<^isub>n \<IN> s \<END>"}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   159
  \end{center}
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   160
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   161
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   162
  which bind all the @{text "x\<^isub>i"} in @{text s}, we might not care
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   163
  about the order in which the @{text "x\<^isub>i = t\<^isub>i"} are given,
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   164
  but we do care about the information that there are as many @{text
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   165
  "x\<^isub>i"} as there are @{text "t\<^isub>i"}. We lose this information if
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   166
  we represent the @{text "\<LET>"}-constructor by something like
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   167
  %
1523
eb95360d6ac6 another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1520
diff changeset
   168
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   169
  @{text "\<LET> [x\<^isub>1,\<dots>,x\<^isub>n].s [t\<^isub>1,\<dots>,t\<^isub>n]"}
1523
eb95360d6ac6 another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1520
diff changeset
   170
  \end{center}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   171
1523
eb95360d6ac6 another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1520
diff changeset
   172
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   173
  where the notation @{text "[_]._"} indicates that the list of @{text "x\<^isub>i"}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   174
  becomes bound in @{text s}. In this representation the term 
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   175
  \mbox{@{text "\<LET> [x].s [t\<^isub>1, t\<^isub>2]"}} is a perfectly legal
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   176
  instance, but the lengths of two lists do not agree. To exclude such terms, 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   177
  additional predicates about well-formed
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   178
  terms are needed in order to ensure that the two lists are of equal
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   179
  length. This can result into very messy reasoning (see for
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   180
  example~\cite{BengtsonParow09}). To avoid this, we will allow type
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   181
  specifications for $\mathtt{let}$s as follows
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   182
  %
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   183
  \begin{center}
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   184
  \begin{tabular}{r@ {\hspace{2mm}}r@ {\hspace{2mm}}l}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   185
  @{text trm} & @{text "::="}  & @{text "\<dots>"}\\ 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   186
              & @{text "|"}    & @{text "\<LET> a::assn s::trm"}\hspace{4mm} 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   187
                                 \isacommand{bind} @{text "bn(a)"} \isacommand{in} @{text "s"}\\[1mm]
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   188
  @{text assn} & @{text "::="} & @{text "\<ANIL>"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   189
               & @{text "|"}   & @{text "\<ACONS> name trm assn"}
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   190
  \end{tabular}
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   191
  \end{center}
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   192
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   193
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   194
  where @{text assn} is an auxiliary type representing a list of assignments
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   195
  and @{text bn} an auxiliary function identifying the variables to be bound
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   196
  by the @{text "\<LET>"}. This function can be defined by recursion over @{text
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   197
  assn} as follows
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   198
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   199
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   200
  @{text "bn(\<ANIL>) ="} @{term "{}"} \hspace{5mm} 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   201
  @{text "bn(\<ACONS> x t as) = {x} \<union> bn(as)"} 
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   202
  \end{center}
1523
eb95360d6ac6 another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1520
diff changeset
   203
  
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   204
  \noindent
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   205
  The scope of the binding is indicated by labels given to the types, for
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   206
  example @{text "s::trm"}, and a binding clause, in this case
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   207
  \isacommand{bind} @{text "bn(a)"} \isacommand{in} @{text "s"}, that states
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   208
  to bind in @{text s} all the names the function call @{text "bn(a)"} returns.
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   209
  This style of specifying terms and bindings is heavily inspired by the
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   210
  syntax of the Ott-tool \cite{ott-jfp}.
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   211
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   212
1545
f32981105089 more one the paper
Christian Urban <urbanc@in.tum.de>
parents: 1535
diff changeset
   213
  However, we will not be able to deal with all specifications that are
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   214
  allowed by Ott. One reason is that Ott lets the user to specify ``empty'' 
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   215
  types like
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   216
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   217
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   218
  @{text "t ::= t t | \<lambda>x. t"}
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   219
  \end{center}
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   220
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   221
  \noindent
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   222
  where no clause for variables is given. Arguably, such specifications make
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   223
  some sense in the context of Coq's type theory (which Ott supports), but not
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   224
  at all in a HOL-based environment where every datatype must have a non-empty
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   225
  set-theoretic model.
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   226
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   227
  Another reason is that we establish the reasoning infrastructure
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   228
  for alpha-\emph{equated} terms. In contrast, Ott produces  a reasoning 
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   229
  infrastructure in Isabelle/HOL for
1545
f32981105089 more one the paper
Christian Urban <urbanc@in.tum.de>
parents: 1535
diff changeset
   230
  \emph{non}-alpha-equated, or ``raw'', terms. While our alpha-equated terms
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   231
  and the raw terms produced by Ott use names for bound variables,
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   232
  there is a key difference: working with alpha-equated terms means, for example,  
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   233
  that the two type-schemes
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   234
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   235
  \begin{center}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   236
  @{text "\<forall>{x}. x \<rightarrow> y  = \<forall>{x, z}. x \<rightarrow> y"} 
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   237
  \end{center}
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   238
  
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   239
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   240
  are not just alpha-equal, but actually \emph{equal}! As a result, we can
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   241
  only support specifications that make sense on the level of alpha-equated
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   242
  terms (offending specifications, which for example bind a variable according
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   243
  to a variable bound somewhere else, are not excluded by Ott, but we have
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   244
  to).  
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   245
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   246
  Our insistence on reasoning with alpha-equated terms comes from the
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   247
  wealth of experience we gained with the older version of Nominal Isabelle:
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   248
  for non-trivial properties, reasoning about alpha-equated terms is much
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   249
  easier than reasoning with raw terms. The fundamental reason for this is
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   250
  that the HOL-logic underlying Nominal Isabelle allows us to replace
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   251
  ``equals-by-equals''. In contrast, replacing
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   252
  ``alpha-equals-by-alpha-equals'' in a representation based on raw terms
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   253
  requires a lot of extra reasoning work.
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   254
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   255
  Although in informal settings a reasoning infrastructure for alpha-equated
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   256
  terms is nearly always taken for granted, establishing it automatically in
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   257
  the Isabelle/HOL theorem prover is a rather non-trivial task. For every
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   258
  specification we will need to construct a type containing as elements the
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   259
  alpha-equated terms. To do so, we use the standard HOL-technique of defining
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   260
  a new type by identifying a non-empty subset of an existing type.  The
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   261
  construction we perform in Isabelle/HOL can be illustrated by the following picture:
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   262
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   263
  \begin{center}
1552
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   264
  \begin{tikzpicture}
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   265
  %\draw[step=2mm] (-4,-1) grid (4,1);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   266
  
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   267
  \draw[very thick] (0.7,0.4) circle (4.25mm);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   268
  \draw[rounded corners=1mm, very thick] ( 0.0,-0.8) rectangle ( 1.8, 0.9);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   269
  \draw[rounded corners=1mm, very thick] (-1.95,0.85) rectangle (-2.85,-0.05);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   270
  
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   271
  \draw (-2.0, 0.845) --  (0.7,0.845);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   272
  \draw (-2.0,-0.045)  -- (0.7,-0.045);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   273
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   274
  \draw ( 0.7, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-\\[-1mm]clas.\end{tabular}};
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   275
  \draw (-2.4, 0.4) node {\begin{tabular}{@ {}c@ {}}$\alpha$-eq.\\[-1mm]terms\end{tabular}};
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   276
  \draw (1.8, 0.48) node[right=-0.1mm]
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   277
    {\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ (sets of raw terms)\end{tabular}};
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   278
  \draw (0.9, -0.35) node {\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}};
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   279
  \draw (-3.25, 0.55) node {\begin{tabular}{@ {}l@ {}}new\\[-1mm]type\end{tabular}};
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   280
  
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   281
  \draw[<->, very thick] (-1.8, 0.3) -- (-0.1,0.3);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   282
  \draw (-0.95, 0.3) node[above=0mm] {isomorphism};
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   283
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   284
  \end{tikzpicture}
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   285
  \end{center}
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   286
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   287
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   288
  We take as the starting point a definition of raw terms (defined as a
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   289
  datatype in Isabelle/HOL); identify then the alpha-equivalence classes in
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   290
  the type of sets of raw terms according to our alpha-equivalence relation
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   291
  and finally define the new type as these alpha-equivalence classes
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   292
  (non-emptiness is satisfied whenever the raw terms are definable as datatype
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   293
  in Isabelle/HOL and the property that our relation for alpha-equivalence is
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   294
  indeed an equivalence relation).
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   295
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   296
  The fact that we obtain an isomorphism between the new type and the
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   297
  non-empty subset shows that the new type is a faithful representation of
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   298
  alpha-equated terms. That is not the case for example for terms using the
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   299
  locally nameless representation of binders \cite{McKinnaPollack99}: in this
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   300
  representation there are ``junk'' terms that need to be excluded by
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   301
  reasoning about a well-formedness predicate.
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   302
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   303
  The problem with introducing a new type in Isabelle/HOL is that in order to
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   304
  be useful, a reasoning infrastructure needs to be ``lifted'' from the
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   305
  underlying subset to the new type. This is usually a tricky and arduous
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   306
  task. To ease it, we re-implemented in Isabelle/HOL the quotient package
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   307
  described by Homeier \cite{Homeier05} for the HOL4 system. This package
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   308
  allows us to lift definitions and theorems involving raw terms to
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   309
  definitions and theorems involving alpha-equated terms. For example if we
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   310
  define the free-variable function over raw lambda-terms
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   311
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   312
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   313
  @{text "fv(x) = {x}"}\hspace{10mm}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   314
  @{text "fv(t\<^isub>1 t\<^isub>2) = fv(t\<^isub>1) \<union> fv(t\<^isub>2)"}\\[1mm]
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   315
  @{text "fv(\<lambda>x.t) = fv(t) - {x}"}
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   316
  \end{center}
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   317
  
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   318
  \noindent
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   319
  then with the help of the quotient package we obtain a function @{text "fv\<^sup>\<alpha>"}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   320
  operating on quotients, or alpha-equivalence classes of lambda-terms. This
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   321
  lifted function is characterised by the equations
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   322
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   323
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   324
  @{text "fv\<^sup>\<alpha>(x) = {x}"}\hspace{10mm}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   325
  @{text "fv\<^sup>\<alpha>(t\<^isub>1 t\<^isub>2) = fv\<^sup>\<alpha>(t\<^isub>1) \<union> fv\<^sup>\<alpha>(t\<^isub>2)"}\\[1mm]
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   326
  @{text "fv\<^sup>\<alpha>(\<lambda>x.t) = fv\<^sup>\<alpha>(t) - {x}"}
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   327
  \end{center}
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   328
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   329
  \noindent
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   330
  (Note that this means also the term-constructors for variables, applications
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   331
  and lambda are lifted to the quotient level.)  This construction, of course,
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   332
  only works if alpha-equivalence is indeed an equivalence relation, and the
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   333
  lifted definitions and theorems are respectful w.r.t.~alpha-equivalence.
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   334
  For example, we will not be able to lift a bound-variable function. Although
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   335
  this function can be defined for raw terms, it does not respect
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   336
  alpha-equivalence and therefore cannot be lifted. To sum up, every lifting
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   337
  of theorems to the quotient level needs proofs of some respectfulness
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   338
  properties (see \cite{Homeier05}). In the paper we show that we are able to
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   339
  automate these proofs and therefore can establish a reasoning infrastructure
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   340
  for alpha-equated terms.
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   341
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   342
  The examples we have in mind where our reasoning infrastructure will be
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   343
  helpful includes the term language of System @{text "F\<^isub>C"}, also
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   344
  known as Core-Haskell (see Figure~\ref{corehas}). This term language
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   345
  involves patterns that have lists of type-, coercion- and term-variables,
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   346
  all of which are bound in @{text "\<CASE>"}-expressions. One
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   347
  difficulty is that each of these variables come with a kind or type
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   348
  annotation. Representing such binders with single binders and reasoning
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   349
  about them in a theorem prover would be a major pain.  \medskip
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   350
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   351
  \noindent
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   352
  {\bf Contributions:}  We provide new definitions for when terms
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   353
  involving multiple binders are alpha-equivalent. These definitions are
1607
ac69ed8303cc tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1587
diff changeset
   354
  inspired by earlier work of Pitts \cite{Pitts04}. By means of automatic
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   355
  proofs, we establish a reasoning infrastructure for alpha-equated
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   356
  terms, including properties about support, freshness and equality
1607
ac69ed8303cc tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1587
diff changeset
   357
  conditions for alpha-equated terms. We are also able to derive, at the moment 
ac69ed8303cc tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1587
diff changeset
   358
  only manually, strong induction principles that 
ac69ed8303cc tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1587
diff changeset
   359
  have the variable convention already built in.
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   360
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   361
  \begin{figure}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   362
  \begin{boxedminipage}{\linewidth}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   363
  \begin{center}
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   364
  \begin{tabular}{r@ {\hspace{1mm}}r@ {\hspace{2mm}}l}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   365
  \multicolumn{3}{@ {}l}{Type Kinds}\\
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   366
  @{text "\<kappa>"} & @{text "::="} & @{text "\<star> | \<kappa>\<^isub>1 \<rightarrow> \<kappa>\<^isub>2"}\smallskip\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   367
  \multicolumn{3}{@ {}l}{Coercion Kinds}\\
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   368
  @{text "\<iota>"} & @{text "::="} & @{text "\<sigma>\<^isub>1 \<sim> \<sigma>\<^isub>2"}\smallskip\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   369
  \multicolumn{3}{@ {}l}{Types}\\
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   370
  @{text "\<sigma>"} & @{text "::="} & @{text "a | T | \<sigma>\<^isub>1 \<sigma>\<^isub>2 | S\<^isub>n"}$\;\overline{@{text "\<sigma>"}}$@{text "\<^sup>n"} 
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   371
  @{text "| \<forall>a:\<kappa>. \<sigma> | \<iota> \<Rightarrow> \<sigma>"}\smallskip\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   372
  \multicolumn{3}{@ {}l}{Coercion Types}\\
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   373
  @{text "\<gamma>"} & @{text "::="} & @{text "c | C | \<gamma>\<^isub>1 \<gamma>\<^isub>2 | S\<^isub>n"}$\;\overline{@{text "\<gamma>"}}$@{text "\<^sup>n"}
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   374
  @{text "| \<forall>c:\<iota>. \<gamma> | \<iota> \<Rightarrow> \<gamma> "}\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   375
  & @{text "|"} & @{text "refl \<sigma> | sym \<gamma> | \<gamma>\<^isub>1 \<circ> \<gamma>\<^isub>2 | \<gamma> @ \<sigma> | left \<gamma> | right \<gamma>"}\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   376
  & @{text "|"} & @{text "\<gamma>\<^isub>1 \<sim> \<gamma>\<^isub>2 | rightc \<gamma> | leftc \<gamma> | \<gamma>\<^isub>1 \<triangleright> \<gamma>\<^isub>2"}\smallskip\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   377
  \multicolumn{3}{@ {}l}{Terms}\\
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   378
  @{text "e"} & @{text "::="} & @{text "x | K | \<Lambda>a:\<kappa>. e | \<Lambda>c:\<iota>. e | e \<sigma> | e \<gamma>"}\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   379
  & @{text "|"} & @{text "\<lambda>x:\<sigma>. e | e\<^isub>1 e\<^isub>2 | \<LET> x:\<sigma> = e\<^isub>1 \<IN> e\<^isub>2"}\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   380
  & @{text "|"} & @{text "\<CASE> e\<^isub>1 \<OF>"}$\;\overline{@{text "p \<rightarrow> e\<^isub>2"}}$ @{text "| e \<triangleright> \<gamma>"}\smallskip\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   381
  \multicolumn{3}{@ {}l}{Patterns}\\
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   382
  @{text "p"} & @{text "::="} & @{text "K"}$\;\overline{@{text "a:\<kappa>"}}\;\overline{@{text "c:\<iota>"}}\;\overline{@{text "x:\<sigma>"}}$\smallskip\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   383
  \multicolumn{3}{@ {}l}{Constants}\\
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   384
  & @{text C} & coercion constants\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   385
  & @{text T} & value type constructors\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   386
  & @{text "S\<^isub>n"} & n-ary type functions (which need to be fully applied)\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   387
  & @{text K} & data constructors\smallskip\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   388
  \multicolumn{3}{@ {}l}{Variables}\\
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   389
  & @{text a} & type variables\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   390
  & @{text c} & coercion variables\\
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   391
  & @{text x} & term variables\\
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   392
  \end{tabular}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   393
  \end{center}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   394
  \end{boxedminipage}
1699
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   395
  \caption{The term-language of System @{text "F\<^isub>C"}
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   396
  \cite{CoreHaskell}, also often referred to as \emph{Core-Haskell}. In this
2dca07aca287 small changes in the core-haskell spec
Christian Urban <urbanc@in.tum.de>
parents: 1694
diff changeset
   397
  version of the term-language we made a modification by separating the
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   398
  grammars for type kinds and coercion kinds, as well as for types and coercion
1702
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
   399
  types. For this paper the interesting term-constructor is @{text "\<CASE>"},
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
   400
  which binds multiple type-, coercion- and term-variables.\label{corehas}}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   401
  \end{figure}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   402
*}
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   403
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   404
section {* A Short Review of the Nominal Logic Work *}
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   405
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   406
text {*
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   407
  At its core, Nominal Isabelle is an adaption of the nominal logic work by
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   408
  Pitts \cite{Pitts03}. This adaptation for Isabelle/HOL is described in
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   409
  \cite{HuffmanUrban10} (including proofs). We shall briefly review this work
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   410
  to aid the description of what follows. 
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   411
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   412
  Two central notions in the nominal logic work are sorted atoms and
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   413
  sort-respecting permutations of atoms. We will use the variables @{text "a,
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   414
  b, c, \<dots>"} to stand for atoms and @{text "p, q, \<dots>"} to stand for
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   415
  permutations.  The sorts of atoms can be used to represent different kinds of
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   416
  variables, such as the term-, coercion- and type-variables in Core-Haskell,
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   417
  and it is assumed that there is an infinite supply of atoms for each
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   418
  sort. However, in order to simplify the description, we shall assume in what
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   419
  follows that there is only one sort of atoms.
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   420
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   421
  Permutations are bijective functions from atoms to atoms that are 
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   422
  the identity everywhere except on a finite number of atoms. There is a 
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   423
  two-place permutation operation written
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   424
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   425
  \begin{center}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   426
  @{text "_ \<bullet> _  ::  perm \<Rightarrow> \<beta> \<Rightarrow> \<beta>"}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   427
  \end{center}
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   428
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   429
  \noindent 
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   430
  in which the generic type @{text "\<beta>"} stands for the type of the object 
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   431
  over which the permutation 
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   432
  acts. In Nominal Isabelle, the identity permutation is written as @{term "0::perm"},
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   433
  the composition of two permutations @{term p} and @{term q} as \mbox{@{term "p + q"}}, 
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   434
  and the inverse permutation of @{term p} as @{text "- p"}. The permutation
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   435
  operation is defined by induction over the type-hierarchy (see \cite{HuffmanUrban10});
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   436
  for example as follows for products, lists, sets, functions and booleans:
1702
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
   437
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   438
  \begin{equation}\label{permute}
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   439
  \mbox{\begin{tabular}{@ {}cc@ {}}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   440
  \begin{tabular}{@ {}l@ {}}
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   441
  @{thm permute_prod.simps[no_vars, THEN eq_reflection]}\\[2mm]
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   442
  @{thm permute_list.simps(1)[no_vars, THEN eq_reflection]}\\
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   443
  @{thm permute_list.simps(2)[no_vars, THEN eq_reflection]}\\
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   444
  \end{tabular} &
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   445
  \begin{tabular}{@ {}l@ {}}
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   446
  @{thm permute_set_eq[no_vars, THEN eq_reflection]}\\
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   447
  @{text "p \<bullet> f \<equiv> \<lambda>x. p \<bullet> (f (- p \<bullet> x))"}\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   448
  @{thm permute_bool_def[no_vars, THEN eq_reflection]}\\
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   449
  \end{tabular}
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   450
  \end{tabular}}
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   451
  \end{equation}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   452
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   453
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   454
  Concrete permutations are built up from swappings, written as \mbox{@{text "(a
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   455
  b)"}}, which are permutations that behave as follows:
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   456
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   457
  \begin{center}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   458
  @{text "(a b) = \<lambda>c. if a = c then b else if b = c then a else c"}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   459
  \end{center}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   460
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   461
  The most original aspect of the nominal logic work of Pitts is a general
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   462
  definition for the notion of the ``set of free variables of an object @{text
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   463
  "x"}''.  This notion, written @{term "supp x"}, is general in the sense that
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   464
  it applies not only to lambda-terms (alpha-equated or not), but also to lists,
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   465
  products, sets and even functions. The definition depends only on the
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   466
  permutation operation and on the notion of equality defined for the type of
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   467
  @{text x}, namely:
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   468
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   469
  \begin{equation}\label{suppdef}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   470
  @{thm supp_def[no_vars, THEN eq_reflection]}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   471
  \end{equation}
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   472
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   473
  \noindent
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   474
  There is also the derived notion for when an atom @{text a} is \emph{fresh}
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   475
  for an @{text x}, defined as
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   476
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   477
  \begin{center}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   478
  @{thm fresh_def[no_vars]}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   479
  \end{center}
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   480
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   481
  \noindent
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   482
  We also use for sets of atoms the abbreviation 
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   483
  @{thm (lhs) fresh_star_def[no_vars]}, defined as 
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   484
  @{thm (rhs) fresh_star_def[no_vars]}.
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   485
  A striking consequence of these definitions is that we can prove
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   486
  without knowing anything about the structure of @{term x} that
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   487
  swapping two fresh atoms, say @{text a} and @{text b}, leave 
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   488
  @{text x} unchanged. 
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   489
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   490
  \begin{property}\label{swapfreshfresh}
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   491
  @{thm[mode=IfThen] swap_fresh_fresh[no_vars]}
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   492
  \end{property}
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   493
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   494
  While often the support of an object can be relatively easily 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   495
  described, for example\\[-6mm]
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   496
  %
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   497
  \begin{eqnarray}
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   498
  @{term "supp a"} & = & @{term "{a}"}\\
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   499
  @{term "supp (x, y)"} & = & @{term "supp x \<union> supp y"}\\
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   500
  @{term "supp []"} & = & @{term "{}"}\\
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   501
  @{term "supp (x#xs)"} & = & @{term "supp x \<union> supp xs"}\\
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   502
  @{text "supp (f x)"} & @{text "\<subseteq>"} & @{term "supp (f, x)"}\label{suppfun}\\
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   503
  @{term "supp b"} & = & @{term "{}"}\\
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   504
  @{term "supp p"} & = & @{term "{a. p \<bullet> a \<noteq> a}"}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   505
  \end{eqnarray}
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   506
  
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   507
  \noindent 
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   508
  in some cases it can be difficult to establish the support precisely, and
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   509
  only give an approximation (see the case for function applications
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   510
  above). Such approximations can be calculated with the notion
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   511
  \emph{supports}, defined as follows
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   512
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   513
  \begin{defn}
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   514
  A set @{text S} \emph{supports} @{text x} if for all atoms @{text a} and @{text b}
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   515
  not in @{text S} we have @{term "(a \<rightleftharpoons> b) \<bullet> x = x"}.
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   516
  \end{defn}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   517
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   518
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   519
  The main point of this definition is that we can show the following two properties.
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   520
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   521
  \begin{property}\label{supportsprop}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   522
  {\it i)} @{thm[mode=IfThen] supp_is_subset[no_vars]}\\ 
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   523
  {\it ii)} @{thm supp_supports[no_vars]}.
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   524
  \end{property}
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   525
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   526
  Another important notion in the nominal logic work is \emph{equivariance}.
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   527
  For a function @{text f}, say of type @{text "\<alpha> \<Rightarrow> \<beta>"}, to be equivariant 
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   528
  requires that every permutation leaves @{text f} unchanged, that is
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   529
  %
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   530
  \begin{equation}\label{equivariancedef}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   531
  @{term "\<forall>p. p \<bullet> f = f"}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   532
  \end{equation}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   533
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   534
  \noindent or equivalently that a permutation applied to the application
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   535
  @{text "f x"} can be moved to the argument @{text x}. That means we have for
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   536
  all permutations @{text p}
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   537
  %
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   538
  \begin{equation}\label{equivariance}
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   539
  @{text "p \<bullet> f = f"} \;\;\;\textit{if and only if}\;\;\;
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   540
  @{text "p \<bullet> (f x) = f (p \<bullet> x)"}
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   541
  \end{equation}
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   542
 
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   543
  \noindent
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   544
  From equation \eqref{equivariancedef} and the definition of support shown in
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   545
  \eqref{suppdef}, we can be easily deduce that an equivariant function has
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   546
  empty support.
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   547
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   548
  Finally, the nominal logic work provides us with elegant means to rename 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   549
  binders. While in the older version of Nominal Isabelle, we used extensively 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   550
  Property~\ref{swapfreshfresh} for renaming single binders, this property 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   551
  proved unwieldy for dealing with multiple binders. For this the following
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   552
  generalisations turned out to be easier to use.
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   553
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   554
  \begin{property}\label{supppermeq}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   555
  @{thm[mode=IfThen] supp_perm_eq[no_vars]}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   556
  \end{property}
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   557
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   558
  \begin{property}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   559
  For a finite set @{text xs} and a finitely supported @{text x} with
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   560
  @{term "xs \<sharp>* x"} and also a finitely supported @{text c}, there
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   561
  exists a permutation @{text p} such that @{term "(p \<bullet> xs) \<sharp>* c"} and
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   562
  @{term "supp x \<sharp>* p"}.
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   563
  \end{property}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   564
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   565
  \noindent
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   566
  The idea behind the second property is that given a finite set @{text xs}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   567
  of binders (being bound in @{text x} which is ensured by the
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   568
  assumption @{term "xs \<sharp>* x"}), then there exists a permutation @{text p} such that
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   569
  the renamed binders @{term "p \<bullet> xs"} avoid the @{text c} (which can be arbitrarily chosen
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   570
  as long as it is finitely supported) and also does not affect anything
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   571
  in the support of @{text x} (that is @{term "supp x \<sharp>* p"}). The last 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   572
  fact and Property~\ref{supppermeq} allow us to ``rename'' just the binders 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   573
  in @{text x}, because @{term "p \<bullet> x = x"}.
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   574
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   575
  All properties given in this section are formalised in Isabelle/HOL and also
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   576
  most of them are described with proofs in \cite{HuffmanUrban10}. In the next section 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   577
  we make extensively use of the properties of @{text "supp"} and permutations 
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   578
  for characterising alpha-equivalence in the presence of multiple binders.
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   579
 
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   580
*}
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   581
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   582
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   583
section {* General Binders\label{sec:binders} *}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   584
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   585
text {*
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   586
  In Nominal Isabelle, the user is expected to write down a specification of a
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   587
  term-calculus and then a reasoning infrastructure is automatically derived
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   588
  from this specification (remember that Nominal Isabelle is a definitional
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   589
  extension of Isabelle/HOL, which does not introduce any new axioms).
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   590
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   591
  In order to keep our work with deriving the reasoning infrastructure
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   592
  manageable, we will wherever possible state definitions and perform proofs
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   593
  on the user-level of Isabelle/HOL, as opposed to write custom ML-code that
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   594
  generates them anew for each specification. To that end, we will consider
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   595
  first pairs @{text "(as, x)"} of type @{text "(atom set) \<times> \<beta>"}.  These pairs
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   596
  are intended to represent the abstraction, or binding, of the set @{text
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   597
  "as"} in the body @{text "x"}.
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   598
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   599
  The first question we have to answer is when the pairs @{text "(as, x)"} and
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   600
  @{text "(bs, y)"} are alpha-equivalent? (At the moment we are interested in
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   601
  the notion of alpha-equivalence that is \emph{not} preserved by adding
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   602
  vacuous binders.) To answer this, we identify four conditions: {\it i)}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   603
  given a free-variable function @{text "fv"} of type \mbox{@{text "\<beta> \<Rightarrow> atom
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   604
  set"}}, then @{text x} and @{text y} need to have the same set of free
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   605
  variables; moreover there must be a permutation @{text p} such that {\it
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   606
  ii)} @{text p} leaves the free variables of @{text x} and @{text y} unchanged, but
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   607
  {\it iii)} ``moves'' their bound names so that we obtain modulo a relation,
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   608
  say \mbox{@{text "_ R _"}}, two equivalent terms. We also require {\it iv)} that
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   609
  @{text p} makes the sets of abstracted atoms @{text as} and @{text bs} equal. The
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   610
  requirements {\it i)} to {\it iv)} can be stated formally as follows:
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   611
  %
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   612
  \begin{equation}\label{alphaset}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   613
  \begin{array}{@ {\hspace{10mm}}r@ {\hspace{2mm}}l}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   614
  \multicolumn{2}{l}{@{term "(as, x) \<approx>gen R fv p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}\hspace{30mm}}\\[1mm]
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   615
               & @{term "fv(x) - as = fv(y) - bs"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   616
  @{text "\<and>"} & @{term "(fv(x) - as) \<sharp>* p"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   617
  @{text "\<and>"} & @{text "(p \<bullet> x) R y"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   618
  @{text "\<and>"} & @{term "(p \<bullet> as) = bs"}\\ 
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   619
  \end{array}
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   620
  \end{equation}
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   621
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   622
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   623
  Note that this relation is dependent on the permutation @{text
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   624
  "p"}. Alpha-equivalence between two pairs is then the relation where we
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   625
  existentially quantify over this @{text "p"}. Also note that the relation is
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   626
  dependent on a free-variable function @{text "fv"} and a relation @{text
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   627
  "R"}. The reason for this extra generality is that we will use
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   628
  $\approx_{\textit{set}}$ for both ``raw'' terms and alpha-equated terms. In
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   629
  the latter case, $R$ will be replaced by equality @{text "="} and for raw terms we
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   630
  will prove that @{text "fv"} is equal to the support of @{text
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   631
  x} and @{text y}.
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   632
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   633
  The definition in \eqref{alphaset} does not make any distinction between the
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   634
  order of abstracted variables. If we want this, then we can define alpha-equivalence 
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   635
  for pairs of the form \mbox{@{text "(as, x)"}} with type @{text "(atom list) \<times> \<beta>"} 
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   636
  as follows
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   637
  %
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   638
  \begin{equation}\label{alphalist}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   639
  \begin{array}{@ {\hspace{10mm}}r@ {\hspace{2mm}}l}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   640
  \multicolumn{2}{l}{@{term "(as, x) \<approx>lst R fv p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}\hspace{30mm}}\\[1mm]
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   641
             & @{term "fv(x) - (set as) = fv(y) - (set bs)"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   642
  \wedge     & @{term "(fv(x) - set as) \<sharp>* p"}\\
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   643
  \wedge     & @{text "(p \<bullet> x) R y"}\\
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   644
  \wedge     & @{term "(p \<bullet> as) = bs"}\\ 
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   645
  \end{array}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   646
  \end{equation}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   647
  
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   648
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   649
  where @{term set} is a function that coerces a list of atoms into a set of atoms.
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   650
  Now the last clause ensures that the order of the binders matters.
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   651
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   652
  If we do not want to make any difference between the order of binders \emph{and}
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   653
  also allow vacuous binders, then we keep sets of binders, but drop the fourth 
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   654
  condition in \eqref{alphaset}:
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   655
  %
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   656
  \begin{equation}\label{alphares}
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   657
  \begin{array}{@ {\hspace{10mm}}r@ {\hspace{2mm}}l}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   658
  \multicolumn{2}{l}{@{term "(as, x) \<approx>res R fv p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}\hspace{30mm}}\\[1mm]
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   659
             & @{term "fv(x) - as = fv(y) - bs"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   660
  \wedge     & @{term "(fv(x) - as) \<sharp>* p"}\\
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   661
  \wedge     & @{text "(p \<bullet> x) R y"}\\
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   662
  \end{array}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   663
  \end{equation}
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   664
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   665
  It might be useful to consider some examples for how these definitions of alpha-equivalence
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   666
  pan out in practise.
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   667
  For this consider the case of abstracting a set of variables over types (as in type-schemes). 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   668
  We set @{text R} to be the equality and for @{text "fv(T)"} we define
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   669
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   670
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   671
  @{text "fv(x) = {x}"}  \hspace{5mm} @{text "fv(T\<^isub>1 \<rightarrow> T\<^isub>2) = fv(T\<^isub>1) \<union> fv(T\<^isub>2)"}
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   672
  \end{center}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   673
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   674
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   675
  Now recall the examples shown in \eqref{ex1}, \eqref{ex2} and
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   676
  \eqref{ex3}. It can be easily checked that @{text "({x, y}, x \<rightarrow> y)"} and
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   677
  @{text "({y, x}, y \<rightarrow> x)"} are equal according to $\approx_{\textit{set}}$ and
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   678
  $\approx_{\textit{res}}$ by taking @{text p} to be the swapping @{term "(x \<rightleftharpoons>
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   679
  y)"}. In case of @{text "x \<noteq> y"}, then @{text "([x, y], x \<rightarrow> y)"}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   680
  $\not\approx_{\textit{list}}$ @{text "([y, x], x \<rightarrow> y)"} since there is no permutation
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   681
  that makes the lists @{text "[x, y]"} and @{text "[y, x]"} equal, and also
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   682
  leaves the type \mbox{@{text "x \<rightarrow> y"}} unchanged. Another example is
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   683
  @{text "({x}, x)"} $\approx_{\textit{res}}$ @{text "({x, y}, x)"} which holds by 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   684
  taking @{text p} to be the
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   685
  identity permutation.  However, if @{text "x \<noteq> y"}, then @{text "({x}, x)"}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   686
  $\not\approx_{\textit{set}}$ @{text "({x, y}, x)"} since there is no permutation 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   687
  that makes the
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   688
  sets @{text "{x}"} and @{text "{x, y}"} equal (similarly for $\approx_{\textit{list}}$).
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   689
  It can also relatively easily be shown that all tree notions of alpha-equivalence
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   690
  coincide, if we only abstract a single atom. 
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   691
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   692
  % looks too ugly
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   693
  %\noindent
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   694
  %Let $\star$ range over $\{set, res, list\}$. We prove next under which 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   695
  %conditions the $\approx\hspace{0.05mm}_\star^{\fv, R, p}$ are equivalence 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   696
  %relations and equivariant:
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   697
  %
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   698
  %\begin{lemma}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   699
  %{\it i)} Given the fact that $x\;R\;x$ holds, then 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   700
  %$(as, x) \approx\hspace{0.05mm}^{\fv, R, 0}_\star (as, x)$. {\it ii)} Given
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   701
  %that @{text "(p \<bullet> x) R y"} implies @{text "(-p \<bullet> y) R x"}, then
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   702
  %$(as, x) \approx\hspace{0.05mm}^{\fv, R, p}_\star (bs, y)$ implies
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   703
  %$(bs, y) \approx\hspace{0.05mm}^{\fv, R, - p}_\star (as, x)$. {\it iii)} Given
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   704
  %that @{text "(p \<bullet> x) R y"} and @{text "(q \<bullet> y) R z"} implies 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   705
  %@{text "((q + p) \<bullet> x) R z"}, then $(as, x) \approx\hspace{0.05mm}^{\fv, R, p}_\star (bs, y)$
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   706
  %and $(bs, y) \approx\hspace{0.05mm}^{\fv, R, q}_\star (cs, z)$ implies
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   707
  %$(as, x) \approx\hspace{0.05mm}^{\fv, R, q + p}_\star (cs, z)$. Given
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   708
  %@{text "(q \<bullet> x) R y"} implies @{text "(p \<bullet> (q \<bullet> x)) R (p \<bullet> y)"} and
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   709
  %@{text "p \<bullet> (fv x) = fv (p \<bullet> x)"} then @{text "p \<bullet> (fv y) = fv (p \<bullet> y)"}, then
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   710
  %$(as, x) \approx\hspace{0.05mm}^{\fv, R, q}_\star (bs, y)$ implies
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   711
  %$(p \;\isasymbullet\; as, p \;\isasymbullet\; x) \approx\hspace{0.05mm}^{\fv, R, q}_\star 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   712
  %(p \;\isasymbullet\; bs, p \;\isasymbullet\; y)$.
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   713
  %\end{lemma}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   714
  
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   715
  %\begin{proof}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   716
  %All properties are by unfolding the definitions and simple calculations. 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   717
  %\end{proof}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   718
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   719
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   720
  In the rest of this section we are going to introduce a type- and term-constructors 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   721
  for abstraction. For this we define 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   722
  %
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   723
  \begin{equation}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   724
  @{term "abs_set (as, x) (bs, x) \<equiv> \<exists>p. alpha_gen (as, x) equal supp p (bs, x)"}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   725
  \end{equation}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   726
  
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   727
  \noindent
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   728
  (similarly for $\approx_{\textit{abs\_list}}$ 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   729
  and $\approx_{\textit{abs\_res}}$). We can show that these relations are equivalence 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   730
  relations and equivariant.
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   731
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   732
  \begin{lemma}\label{alphaeq} The relations
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   733
  $\approx_{\textit{abs\_set}}$,
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   734
  $\approx_{\textit{abs\_list}}$ 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   735
  and $\approx_{\textit{abs\_res}}$
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   736
  are equivalence
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   737
  relations, and if @{term "abs_set (as, x) (bs, y)"} then also
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   738
  @{term "abs_set (p \<bullet> as, p \<bullet> x) (p \<bullet> bs, p \<bullet> y)"} (similarly for 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   739
  the other two relations).
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   740
  \end{lemma}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   741
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   742
  \begin{proof}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   743
  Reflexivity is by taking @{text "p"} to be @{text "0"}. For symmetry we have
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   744
  a permutation @{text p} and for the proof obligation take @{term "-p"}. In case 
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   745
  of transitivity, we have two permutations @{text p} and @{text q}, and for the
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   746
  proof obligation use @{text "q + p"}. All conditions are then by simple
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   747
  calculations. 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   748
  \end{proof}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   749
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   750
  \noindent
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   751
  This lemma allows us to use our quotient package and introduce 
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   752
  new types @{text "\<beta> abs_set"}, @{text "\<beta> abs_res"} and @{text "\<beta> abs_list"}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   753
  representing alpha-equivalence classes of pairs. The elements in these types 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   754
  we will, respectively, write as:
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   755
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   756
  \begin{center}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   757
  @{term "Abs as x"} \hspace{5mm} 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   758
  @{term "Abs_lst as x"} \hspace{5mm}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   759
  @{term "Abs_res as x"}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   760
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   761
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   762
  \noindent
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   763
  indicating that a set or list is abstracted in @{text x}. We will call the types
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   764
  \emph{abstraction types} and their elements \emph{abstractions}. The important 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   765
  property we need is a characterisation for the support of abstractions, namely
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   766
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   767
  \begin{thm}[Support of Abstractions]\label{suppabs} 
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   768
  Assuming @{text x} has finite support, then\\[-6mm] 
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   769
  \begin{center}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   770
  \begin{tabular}{l@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   771
  @{thm (lhs) supp_abs(1)[no_vars]} & $=$ & @{thm (rhs) supp_abs(1)[no_vars]}\\
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   772
  @{thm (lhs) supp_abs(2)[no_vars]} & $=$ & @{thm (rhs) supp_abs(2)[no_vars]}\\
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   773
  @{thm (lhs) supp_abs(3)[no_vars]} & $=$ & @{thm (rhs) supp_abs(3)[no_vars]}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   774
  \end{tabular}
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   775
  \end{center}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   776
  \end{thm}
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   777
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   778
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   779
  We will only show the first equation as the others 
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   780
  follow similar arguments. By definition of the abstraction type @{text "abs_set"} 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   781
  we have 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   782
  %
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   783
  \begin{equation}\label{abseqiff}
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   784
  @{thm (lhs) abs_eq_iff(1)[where bs="as" and cs="bs", no_vars]} \;\;\text{if and only if}\;\; 
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   785
  @{thm (rhs) abs_eq_iff(1)[where bs="as" and cs="bs", no_vars]}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   786
  \end{equation}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   787
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   788
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   789
  and also
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   790
  %
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   791
  \begin{equation}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   792
  @{thm permute_Abs[no_vars]}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   793
  \end{equation}
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   794
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   795
  \noindent
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   796
  The last fact derives from the definition of permutations acting on pairs 
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   797
  (see \eqref{permute}) and alpha-equivalence being equivariant (see Lemma~\ref{alphaeq}).
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   798
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   799
  With these two facts at our disposal, we can show the following lemma 
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   800
  about swapping two atoms.
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   801
  
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   802
  \begin{lemma}
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   803
  @{thm[mode=IfThen] abs_swap1(1)[no_vars]}
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   804
  \end{lemma}
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   805
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   806
  \begin{proof}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   807
  By using \eqref{abseqiff}, this lemma is straightforward when observing that 
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   808
  the assumptions give us
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   809
  @{term "(a \<rightleftharpoons> b) \<bullet> (supp x - bs) = (supp x - bs)"} and that @{text supp}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   810
  and set difference are equivariant.
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   811
  \end{proof}
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   812
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   813
  \noindent
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   814
  This lemma gives us
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   815
  %
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   816
  \begin{equation}\label{halfone}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   817
  @{thm abs_supports(1)[no_vars]}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   818
  \end{equation}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   819
  
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   820
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   821
  which with Property~\ref{supportsprop} gives us one half of
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   822
  Thm~\ref{suppabs}. The other half is a bit more involved. For this we use a
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   823
  trick from \cite{Pitts04} and first define an auxiliary function
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   824
  %
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   825
  \begin{center}
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   826
  @{thm supp_gen.simps[THEN eq_reflection, no_vars]}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   827
  \end{center}
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   828
  
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   829
  \noindent
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   830
  Using the second equation in \eqref{equivariance}, we can show that 
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   831
  @{term "supp_gen"} is equivariant and therefore has empty support. This 
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   832
  in turn means
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   833
  %
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   834
  \begin{center}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   835
  @{thm (prem 1) aux_fresh(1)[where bs="as", no_vars]}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   836
  \;\;implies\;\;
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   837
  @{thm (concl) aux_fresh(1)[where bs="as", no_vars]}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   838
  \end{center}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   839
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   840
  \noindent
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   841
  using \eqref{suppfun}. Since @{term "supp x"} is by definition equal 
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   842
  to @{term "{a. \<not> a \<sharp> x}"} we can establish that
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   843
  %
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   844
  \begin{equation}\label{halftwo}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   845
  @{thm (concl) supp_abs_subset1(1)[no_vars]}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   846
  \end{equation}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   847
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   848
  \noindent
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   849
  provided @{text x} has finite support (the precondition we need in order to show 
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   850
  that for a finite set of atoms, we have @{thm (concl) supp_finite_atom_set[where S="bs", no_vars]}).
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   851
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   852
  Finally taking \eqref{halfone} and \eqref{halftwo} provides us with a proof
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   853
  of Theorem~\ref{suppabs}. The point of these general lemmas about abstractions is that we 
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   854
  can define and prove properties about them conveniently on the Isabelle/HOL level,
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   855
  and in addition can use them in what
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   856
  follows next when we have to deal with binding in specifications of term-calculi. 
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   857
*}
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
   858
1491
f970ca9b5bec paper uses now a heap file - does not compile so long anymore
Christian Urban <urbanc@in.tum.de>
parents: 1485
diff changeset
   859
section {* Alpha-Equivalence and Free Variables *}
f970ca9b5bec paper uses now a heap file - does not compile so long anymore
Christian Urban <urbanc@in.tum.de>
parents: 1485
diff changeset
   860
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   861
text {*
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   862
  Our choice of syntax for specifications of term-calculi is influenced by the existing
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   863
  datatype package of Isabelle/HOL and by the syntax of the Ott-tool
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   864
  \cite{ott-jfp}. A specification is a collection of (possibly mutual
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   865
  recursive) type declarations, say @{text "ty"}$^\alpha_1$, \ldots, 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   866
  @{text ty}$^\alpha_n$, and an associated collection
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   867
  of binding functions, say @{text bn}$^\alpha_1$, \ldots, @{text
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   868
  bn}$^\alpha_m$. The syntax in Nominal Isabelle for such specifications is
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
   869
  roughly as follows:
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   870
  %
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   871
  \begin{equation}\label{scheme}
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   872
  \mbox{\begin{tabular}{@ {\hspace{-5mm}}p{1.8cm}l}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   873
  type \mbox{declaration part} &
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   874
  $\begin{cases}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   875
  \mbox{\begin{tabular}{l}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   876
  \isacommand{nominal\_datatype} @{text ty}$^\alpha_1 = \ldots$\\
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   877
  \isacommand{and} @{text ty}$^\alpha_2 = \ldots$\\
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   878
  $\ldots$\\ 
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   879
  \isacommand{and} @{text ty}$^\alpha_n = \ldots$\\ 
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   880
  \end{tabular}}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   881
  \end{cases}$\\
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   882
  binding \mbox{function part} &
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   883
  $\begin{cases}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   884
  \mbox{\begin{tabular}{l}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   885
  \isacommand{with} @{text bn}$^\alpha_1$ \isacommand{and} \ldots \isacommand{and} @{text bn}$^\alpha_m$\\
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   886
  \isacommand{where}\\
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   887
  $\ldots$\\
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   888
  \end{tabular}}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   889
  \end{cases}$\\
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   890
  \end{tabular}}
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   891
  \end{equation}
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   892
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   893
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   894
  Every type declaration @{text ty}$^\alpha_{1..n}$ consists of a collection of 
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   895
  term-constructors, each of which comes with a list of labelled 
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   896
  types that stand for the types of the arguments of the term-constructor.
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   897
  For example a term-constructor @{text "C\<^sup>\<alpha>"} might have
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   898
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   899
  \begin{center}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   900
  @{text "C\<^sup>\<alpha> label\<^isub>1::ty"}$'_1$ @{text "\<dots> label\<^isub>l::ty"}$'_l\;\;$  @{text "binding_clauses"} 
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   901
  \end{center}
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   902
  
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   903
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   904
  whereby some of the @{text ty}$'_{1..l}$ (or their components) are contained in the collection
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   905
  of @{text ty}$^\alpha_{1..n}$ declared in \eqref{scheme}. In this case we will call the
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   906
  corresponding argument a \emph{recursive argument}.  The labels annotated on
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   907
  the types are optional and can be used in the (possibly empty) list of
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   908
  \emph{binding clauses}.  These clauses indicate the binders and their scope of
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   909
  in a term-constructor.  They come in three \emph{modes}:
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   910
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   911
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   912
  \begin{center}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   913
  \begin{tabular}{l}
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   914
  \isacommand{bind}\; {\it binders}\; \isacommand{in}\; {\it label}\\
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   915
  \isacommand{bind\_set}\; {\it binders}\; \isacommand{in}\; {\it label}\\
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   916
  \isacommand{bind\_res}\; {\it binders}\; \isacommand{in}\; {\it label}\\
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   917
  \end{tabular}
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   918
  \end{center}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   919
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   920
  \noindent
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   921
  The first mode is for binding lists of atoms (the order of binders matters); the second is for sets
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   922
  of binders (the order does not matter, but the cardinality does) and the last is for  
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   923
  sets of binders (with vacuous binders preserving alpha-equivalence).
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   924
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   925
  In addition we distinguish between \emph{shallow} binders and \emph{deep}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   926
  binders.  Shallow binders are of the form \isacommand{bind}\; {\it label}\;
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   927
  \isacommand{in}\; {\it label'} (similar for the other two modes). The
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   928
  restriction we impose on shallow binders is that the {\it label} must either
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   929
  refer to a type that is an atom type or to a type that is a finite set or
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   930
  list of an atom type. Two examples for the use of shallow binders are the
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   931
  specification of lambda-terms, where a single name is bound, and of
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   932
  type-schemes, where a finite set of names is bound:
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   933
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   934
  \begin{center}
1612
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   935
  \begin{tabular}{@ {}cc@ {}}
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   936
  \begin{tabular}{@ {}l@ {\hspace{-1mm}}}
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   937
  \isacommand{nominal\_datatype} {\it lam} =\\
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   938
  \hspace{5mm}\phantom{$\mid$} Var\;{\it name}\\
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   939
  \hspace{5mm}$\mid$ App\;{\it lam}\;{\it lam}\\
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   940
  \hspace{5mm}$\mid$ Lam\;{\it x::name}\;{\it t::lam}\\
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   941
  \hspace{21mm}\isacommand{bind} {\it x} \isacommand{in} {\it t}\\
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   942
  \end{tabular} &
1612
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   943
  \begin{tabular}{@ {}l@ {}}
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   944
  \isacommand{nominal\_datatype} {\it ty} =\\
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   945
  \hspace{5mm}\phantom{$\mid$} TVar\;{\it name}\\
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   946
  \hspace{5mm}$\mid$ TFun\;{\it ty}\;{\it ty}\\
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   947
  \isacommand{and} {\it tsc} = All\;{\it xs::(name fset)}\;{\it T::ty}\\
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   948
  \hspace{24mm}\isacommand{bind\_res} {\it xs} \isacommand{in} {\it T}\\
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   949
  \end{tabular}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   950
  \end{tabular}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   951
  \end{center}
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   952
1612
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   953
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   954
  Note that in this specification \emph{name} refers to an atom type.
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   955
  If we have shallow binders that ``share'' a body, for instance $t$ in
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   956
  the following term-constructor
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   957
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   958
  \begin{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   959
  \begin{tabular}{ll}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   960
  \it {\rm Foo} x::name y::name t::lam & \it 
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   961
                              \isacommand{bind}\;x\;\isacommand{in}\;t,\;
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   962
                              \isacommand{bind}\;y\;\isacommand{in}\;t  
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   963
  \end{tabular}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   964
  \end{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   965
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   966
  \noindent
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   967
  then we have to make sure the modes of the binders agree. We cannot
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   968
  have, for instance, in the first binding clause the mode \isacommand{bind} 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   969
  and in the second \isacommand{bind\_set}.
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   970
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   971
  A \emph{deep} binder uses an auxiliary binding function that ``picks'' out
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   972
  the atoms in one argument of the term-constructor, which can be bound in  
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   973
  other arguments and also in the same argument (we will
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   974
  call such binders \emph{recursive}, see below). 
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   975
  The binding functions are expected to return either a set of atoms
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   976
  (for \isacommand{bind\_set} and \isacommand{bind\_res}) or a list of atoms
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   977
  (for \isacommand{bind}). They can be defined by primitive recursion over the
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
   978
  corresponding type; the equations must be given in the binding function part of
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   979
  the scheme shown in \eqref{scheme}. For example for a calculus containing lets 
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   980
  with tuple patterns, you might specify
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   981
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   982
  \begin{center}
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   983
  \begin{tabular}{l}
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   984
  \isacommand{nominal\_datatype} {\it trm} =\\
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   985
  \hspace{5mm}\phantom{$\mid$} Var\;{\it name}\\
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   986
  \hspace{5mm}$\mid$ App\;{\it trm}\;{\it trm}\\
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   987
  \hspace{5mm}$\mid$ Lam\;{\it x::name}\;{\it t::trm} 
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   988
     \;\;\isacommand{bind} {\it x} \isacommand{in} {\it t}\\
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   989
  \hspace{5mm}$\mid$ Let\;{\it p::pat}\;{\it trm}\; {\it t::trm} 
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   990
     \;\;\isacommand{bind} {\it bn(p)} \isacommand{in} {\it t}\\
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   991
  \isacommand{and} {\it pat} =\\
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   992
  \hspace{5mm}\phantom{$\mid$} PNil\\
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   993
  \hspace{5mm}$\mid$ PVar\;{\it name}\\
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   994
  \hspace{5mm}$\mid$ PTup\;{\it pat}\;{\it pat}\\ 
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
   995
  \isacommand{with} {\it bn::pat $\Rightarrow$ atom list}\\
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   996
  \isacommand{where} $\textit{bn}(\textrm{PNil}) = []$\\
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   997
  \hspace{5mm}$\mid$ $\textit{bn}(\textrm{PVar}\;x) = [\textit{atom}\; x]$\\
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   998
  \hspace{5mm}$\mid$ $\textit{bn}(\textrm{PTup}\;p_1\;p_2) = \textit{bn}(p_1)\; @\;\textit{bn}(p_2)$\\ 
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   999
  \end{tabular}
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
  1000
  \end{center}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
  1001
  
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
  1002
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1003
  In this specification the function @{text "bn"} determines which atoms of @{text  p} are
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1004
  bound in the argument @{text "t"}. Note that the second last clause the function @{text "atom"}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1005
  coerces a name into the generic atom type of Nominal Isabelle. This allows
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1006
  us to treat binders of different atom type uniformly. 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1007
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1008
  As will shortly become clear, we cannot return an atom in a binding function
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1009
  that is also bound in the corresponding term-constructor. That means in the
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1010
  example above that the term-constructors PVar and PTup must not have a
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1011
  binding clause.  In the present version of Nominal Isabelle, we also adopted
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1012
  the restriction from the Ott-tool that binding functions can only return:
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1013
  the empty set or empty list (as in case PNil), a singleton set or singleton
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1014
  list containing an atom (case PVar), or unions of atom sets or appended atom
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1015
  lists (case PTup). This restriction will simplify proofs later on.
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1016
  The the most drastic restriction we have to impose on deep binders is that 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1017
  we cannot have ``overlapping'' deep binders. Consider for example the 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1018
  term-constructors:
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
  1019
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1020
  \begin{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1021
  \begin{tabular}{ll}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1022
  \it {\rm Foo} p::pat q::pat t::trm & \it \isacommand{bind}\;bn(p)\;\isacommand{in}\;t,\;
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1023
                              \isacommand{bind}\;bn(q)\;\isacommand{in}\;t\\
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1024
  \it {\rm Foo}$'$x::name p::pat t::trm & \it \it \isacommand{bind}\;x\;\isacommand{in}\;t,\;
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1025
                              \isacommand{bind}\;bn(p)\;\isacommand{in}\;t 
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1026
  
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1027
  \end{tabular}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1028
  \end{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1029
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1030
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1031
  In the first case we bind all atoms from the pattern @{text p} in @{text t}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1032
  and also all atoms from @{text q} in @{text t}. As a result we have no way
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1033
  to determine whether the binder came from the binding function @{text
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1034
  "bn(p)"} or @{text "bn(q)"}. Similarly in the second case. There the binder
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1035
  @{text "bn(p)"} overlaps with the shallow binder @{text x}. The reason why
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
  1036
  we must exclude such specifications is that they cannot be represent by
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1037
  the general binders described in Section \ref{sec:binders}. However
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1038
  the following two term-constructors are allowed
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1039
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1040
  \begin{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1041
  \begin{tabular}{ll}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1042
  \it {\rm Bar} p::pat t::trm s::trm & \it \isacommand{bind}\;bn(p)\;\isacommand{in}\;t,\;
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1043
                                            \isacommand{bind}\;bn(p)\;\isacommand{in}\;s\\
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1044
  \it {\rm Bar}$'$p::pat t::trm &  \it \isacommand{bind}\;bn(p)\;\isacommand{in}\;p,\;
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1045
                                      \isacommand{bind}\;bn(p)\;\isacommand{in}\;t\\
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1046
  \end{tabular}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1047
  \end{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1048
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1049
  \noindent
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1050
  since there is no overlap of binders.
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
  1051
  
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1052
  Note that in the last example we wrote {\it\isacommand{bind}\;bn(p)\;\isacommand{in}\;p}.
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
  1053
  Whenever such a binding clause is present, we will call the binder \emph{recursive}.
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1054
  To see the purpose for this, consider ``plain'' Lets and Let\_recs:
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1055
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1056
  \begin{center}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1057
  \begin{tabular}{@ {}l@ {}}
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1058
  \isacommand{nominal\_datatype} {\it trm} =\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1059
  \hspace{5mm}\phantom{$\mid$}\ldots\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1060
  \hspace{5mm}$\mid$ Let\;{\it a::assn}\; {\it t::trm} 
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1061
     \;\;\isacommand{bind} {\it bn(a)} \isacommand{in} {\it t}\\
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1062
  \hspace{5mm}$\mid$ Let\_rec\;{\it a::assn}\; {\it t::trm} 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1063
     \;\;\isacommand{bind} {\it bn(a)} \isacommand{in} {\it t},
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1064
         \isacommand{bind} {\it bn(a)} \isacommand{in} {\it a}\\
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1065
  \isacommand{and} {\it assn} =\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1066
  \hspace{5mm}\phantom{$\mid$} ANil\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1067
  \hspace{5mm}$\mid$ ACons\;{\it name}\;{\it trm}\;{\it assn}\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1068
  \isacommand{with} {\it bn::assn $\Rightarrow$ atom list}\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1069
  \isacommand{where} $bn(\textrm{ANil}) = []$\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1070
  \hspace{5mm}$\mid$ $bn(\textrm{ACons}\;x\;t\;a) = [atom\; x]\; @\; bn(a)$\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1071
  \end{tabular}
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1072
  \end{center}
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1073
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1074
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1075
  The difference is that with Let we only want to bind the atoms @{text
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1076
  "bn(a)"} in the term @{text t}, but with Let\_rec we also want to bind the atoms
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1077
  inside the assignment. This requires recursive binders and also has
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1078
  consequences for the free variable function and alpha-equivalence relation,
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1079
  which we are going to explain in the rest of this section.
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1080
 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1081
  Having dealt with all syntax matters, the problem now is how we can turn
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1082
  specifications into actual type definitions in Isabelle/HOL and then
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1083
  establish a reasoning infrastructure for them. Because of the problem
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1084
  Pottier and Cheney pointed out, we cannot in general re-arrange arguments of
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1085
  term-constructors so that binders and their bodies are next to each other, and
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1086
  then use the type constructors @{text "abs_set"}, @{text "abs_res"} and
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1087
  @{text "abs_list"} from Section \ref{sec:binders}. Therefore we will first
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1088
  extract datatype definitions from the specification and then define an
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
  1089
  alpha-equivalence relation over them.
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1090
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1091
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1092
  The datatype definition can be obtained by just stripping off the 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1093
  binding clauses and the labels on the types. We also have to invent
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1094
  new names for the types @{text "ty\<^sup>\<alpha>"} and term-constructors @{text "C\<^sup>\<alpha>"}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1095
  given by user. In our implementation we just use an affix like
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1096
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1097
  \begin{center}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1098
  @{text "ty\<^sup>\<alpha> \<mapsto> ty_raw"} \hspace{7mm} @{text "C\<^sup>\<alpha> \<mapsto> C_raw"}
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1099
  \end{center}
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1100
  
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1101
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1102
  The resulting datatype definition is legal in Isabelle/HOL provided the datatypes are 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1103
  non-empty and the types in the constructors only occur in positive 
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
  1104
  position (see \cite{} for an indepth explanation of the datatype package
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1105
  in Isabelle/HOL). We then define the user-specified binding 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1106
  functions by primitive recursion over the raw datatypes. We can also
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1107
  easily define a permutation operation by primitive recursion so that for each
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1108
  term constructor @{text "C_raw ty\<^isub>1 \<dots> ty\<^isub>n"} we have that
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1109
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1110
  \begin{center}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1111
  @{text "p \<bullet> (C_raw x\<^isub>1 \<dots> x\<^isub>n) \<equiv> C_raw (p \<bullet> x\<^isub>1) \<dots> (p \<bullet> x\<^isub>n)"}
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1112
  \end{center}
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1113
  
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1114
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1115
  From this definition we can easily show that the raw datatypes are 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1116
  all permutation types (Def ??) by a simple structural induction over
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1117
  the @{text "ty_raw"}s.
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1118
1693
3668b389edf3 spell check
Christian Urban <urbanc@in.tum.de>
parents: 1690
diff changeset
  1119
  The first non-trivial step we have to perform is the generation free-variable 
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1120
  functions from the specifications. Given types @{text "ty\<^isub>1, \<dots>, ty\<^isub>n"}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1121
  we need to define the free-variable functions
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1122
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1123
  \begin{center}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1124
  @{text "fv_ty\<^isub>1 :: ty\<^isub>1 \<Rightarrow> atom set \<dots> fv_ty\<^isub>n :: ty\<^isub>n \<Rightarrow> atom set"}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1125
  \end{center}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1126
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1127
  \noindent
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1128
  We define them together with the auxiliary free variable functions for
1705
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1129
  binding functions. Given binding functions of types
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1130
  @{text "bn\<^isub>1 :: ty\<^isub>i\<^isub>1 \<Rightarrow> \<dots> \<dots> bn\<^isub>m :: ty\<^isub>i\<^isub>m \<Rightarrow> \<dots>"} we need to define
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1131
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1132
  \begin{center}
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1133
  @{text "fv_bn\<^isub>1 :: ty\<^isub>i\<^isub>1 \<Rightarrow> atom set \<dots> fv_bn\<^isub>m :: ty\<^isub>i\<^isub>m \<Rightarrow> atom set"}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1134
  \end{center}
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1135
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1136
  \noindent
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1137
  The basic idea behind these free-variable functions is to collect all atoms
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1138
  that are not bound in a term constructor, but because of the rather
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1139
  complicated binding mechanisms the details are somewhat involved. 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1140
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1141
  Given a term-constructor @{text "C_raw ty\<^isub>1 \<dots> ty\<^isub>n"}, of type @{text ty} together with 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1142
  some  binding clauses, the function @{text "fv_ty (C_raw x\<^isub>1 \<dots> x\<^isub>n)"} will be 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1143
  the union of the values defined below for each argument, say @{text "x\<^isub>i"} with type @{text "ty\<^isub>i"}. 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1144
  From the binding clause of this term constructor, we can determine whether the 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1145
  argument @{text "x\<^isub>i"} is a shallow or deep binder, and in the latter case also 
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1146
  whether it is a recursive or non-recursive of a binder. In these cases the value is: 
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1147
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1148
  \begin{center}
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1149
  \begin{tabular}{cp{7cm}}
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1150
  $\bullet$ & @{term "{}"} provided @{text "x\<^isub>i"} is a shallow binder\\
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1151
  $\bullet$ & @{text "fv_bn\<^isub>j x\<^isub>i"} provided @{text "x\<^isub>i"} is a deep
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1152
      non-recursive binder with the auxiliary function @{text "bn\<^isub>j"}\\
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1153
  $\bullet$ & @{text "fv_ty\<^isub>i x\<^isub>i - bn\<^isub>j x\<^isub>i"} provided @{text "x\<^isub>i"} is
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1154
      a deep recursive binder with the auxiliary function @{text "bn\<^isub>j"}
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1155
  \end{tabular}
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1156
  \end{center}
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1157
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1158
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1159
  In case the argument @{text "x\<^isub>i"} is not a binder, it might be a body of
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1160
  one or more abstractions. Let @{text "bnds"} be the bound atoms computed
1709
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1161
  as follows: If @{text "x\<^isub>i"} is not a body of an abstraction @{term "{}"}.
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1162
  Otherwise there are two cases: either the
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1163
  corresponding binders are all shallow or there is a single deep binder.
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1164
  In the former case we build the union of all shallow binders; in the
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1165
  later case we just take set or list of atoms the specified binding
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1166
  function returns. With @{text "bnds"} computed as above the value of
1709
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1167
  for @{text "x\<^isub>i"} is given by:
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1168
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1169
  \begin{center}
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1170
  \begin{tabular}{cp{7cm}}
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1171
  $\bullet$ & @{text "{atom x\<^isub>i} - bnds"} provided @{term "x\<^isub>i"} is an atom\\
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1172
  $\bullet$ & @{text "(atoms x\<^isub>i) - bnds"} provided @{term "x\<^isub>i"} is a set of atoms\\
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
  1173
  $\bullet$ & @{text "(atoms (set x\<^isub>i)) - bnds"} provided @{term "x\<^isub>i"} is a list of atoms\\
1709
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1174
  $\bullet$ & @{text "(fv_ty\<^isub>m x\<^isub>i) - bnds"} provided @{term "x\<^isub>i"} is one of the datatypes
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1175
     we are defining, with the free variable function @{text "fv_ty\<^isub>m"}\\
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1176
  $\bullet$ & @{text "(fv\<^isup>\<alpha> x\<^isub>i) - bnds"} provided @{term "x\<^isub>i"} is a defined nominal datatype
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1177
     with a free variable function @{text "fv\<^isup>\<alpha>"}\\\\
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1178
  $\bullet$ & @{term "{}"} otherwise
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1179
  \end{tabular}
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1180
  \end{center}
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1181
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1182
  \noindent Next, for each binding function @{text "bn"} we define a
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1183
  free variable function @{text "fv_bn"}. The basic idea behind this
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1184
  function is to compute all the free atoms under this binding
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1185
  function. So given that @{text "bn"} is a binding function for type
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1186
  @{text "ty\<^isub>i"} it will be the same as @{text "fv_ty\<^isub>i"} with the
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1187
  omission of the arguments present in @{text "bn"}.
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1188
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1189
  For a binding function clause @{text "bn (C_raw x\<^isub>1 \<dots> x\<^isub>n) = rhs"},
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1190
  we define @{text "fv_bn"} to be the union of the values calculated
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1191
  for @{text "x\<^isub>j"} as follows:
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1192
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1193
  \begin{center}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1194
  \begin{tabular}{cp{7cm}}
1709
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1195
  $\bullet$ & @{term "{}"} provided @{term "x\<^isub>j"} occurs in @{text "rhs"} and is an atom,
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1196
     atom list or atom set\\
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1197
  $\bullet$ & @{text "fv_bn\<^isub>m x\<^isub>j"} provided @{term "x\<^isub>j"} occurs in @{text "rhs"} 
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1198
    with the recursive call @{text "bn\<^isub>m x\<^isub>j"}\\
1709
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1199
  $\bullet$ & @{text "atoms x\<^isub>j"} provided @{term "x\<^isub>j"} is a set of atoms not in @{text "rhs"}\\
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1200
  $\bullet$ & @{term "atoml x\<^isub>j"} provided @{term "x\<^isub>j"} is a list of atoms not in @{text "rhs"}\\
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1201
  $\bullet$ & @{text "fv_ty\<^isub>i x\<^isub>j"} provided @{term "x\<^isub>j"} is not in @{text "rhs"} and is 
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1202
     one of the datatypes
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1203
     we are defining, with the free variable function @{text "fv_ty\<^isub>m"}\\
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1204
  $\bullet$ & @{text "fv_ty\<^isup>\<alpha> x\<^isub>j - bnds"} provided @{term "x\<^isub>j"}  is not in @{text "rhs"}
ccd2ab0cebf3 clean fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1708
diff changeset
  1205
     and is an existing nominal datatype with the free variable function @{text "fv\<^isup>\<alpha>"}\\
1706
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1206
  $\bullet$ & @{term "{}"} otherwise
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1207
  \end{tabular}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1208
  \end{center}
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1209
1705
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1210
  We then define the alpha equivalence relations. For the types @{text "ty\<^isub>1, \<dots>, ty\<^isub>n"}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1211
  we need to define
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1212
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1213
  \begin{center}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1214
  @{text "\<approx>\<^isub>1 :: ty\<^isub>1 \<Rightarrow> ty\<^isub>1 \<Rightarrow> bool \<dots> \<approx>\<^isub>n :: ty\<^isub>n \<Rightarrow> ty\<^isub>n \<Rightarrow> bool"}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1215
  \end{center}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1216
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1217
  \noindent
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1218
  together with the auxiliary equivalences for binding functions. Given binding
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1219
  functions for types @{text "bn\<^isub>1 :: ty\<^isub>i\<^isub>1 \<Rightarrow> \<dots> \<dots> bn\<^isub>m :: ty\<^isub>i\<^isub>m \<Rightarrow> \<dots>"} we need to define
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1220
  \begin{center}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1221
  @{text "\<approx>bn\<^isub>1 :: ty\<^isub>i\<^isub>1 \<Rightarrow> ty\<^isub>i\<^isub>1 \<Rightarrow> bool \<dots> \<approx>bn\<^isub>n :: ty\<^isub>i\<^isub>m \<Rightarrow> ty\<^isub>i\<^isub>m \<Rightarrow> bool"}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1222
  \end{center}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1223
1710
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1224
  Given a term-constructor @{text "C_raw ty\<^isub>1 \<dots> ty\<^isub>n"}, of a type @{text ty}, two instances
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1225
  of this constructor are alpha-equivalent @{text "C_raw x\<^isub>1 \<dots> x\<^isub>n \<approx> C_raw y\<^isub>1 \<dots> y\<^isub>n"} if there
1707
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1226
  exist permutations @{text "\<pi>\<^isub>1 \<dots> \<pi>\<^isub>p"} (one for each bound argument) such that
1710
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1227
  the conjunction of equivalences defined below for each argument pair @{text "x\<^isub>j"}, @{text "y\<^isub>j"} holds.
1706
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1228
  For an argument pair @{text "x\<^isub>j"}, @{text "y\<^isub>j"} this holds if:
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1229
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1230
  \begin{center}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1231
  \begin{tabular}{cp{7cm}}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1232
  $\bullet$ & @{text "x\<^isub>j"} is a shallow binder\\
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1233
  $\bullet$ & @{text "x\<^isub>j \<approx>bn\<^isub>m y\<^isub>j"} provided @{text "x\<^isub>j"} is a deep non-recursive binder
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1234
     with the auxiliary binding function @{text "bn\<^isub>m"}\\
1707
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1235
  $\bullet$ & @{term "(bn\<^isub>m x\<^isub>j, (x\<^isub>j, x\<^isub>n)) \<approx>gen R fvs \<pi> (bn\<^isub>m y\<^isub>j, (y\<^isub>j, y\<^isub>n))"}
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1236
     provided @{term "x\<^isub>j"} is a deep recursive binder with the auxiliary binding
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1237
     function @{text "bn\<^isub>m"} and permutation @{text "\<pi>"}, @{term "fvs"} is a compound
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1238
     free variable function returning the union of appropriate @{term "fv_ty\<^isub>x"} and
1710
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1239
     @{term "R"} is the composition of equivalence relations @{text "\<approx>"} and @{text "\<approx>\<^isub>n"}\\
1706
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1240
  $\bullet$ & @{text "x\<^isub>j"} has a deep recursive binding\\
1710
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1241
  $\bullet$ & @{term "({x\<^isub>n, x\<^isub>j) \<approx>gen R fv_ty \<pi> (y\<^isub>n, y\<^isub>j)"} provided @{text "x\<^isub>j"} has
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1242
     a shallow binder @{text "x\<^isub>n"} with permutation @{text "\<pi>"}, @{term "R"} is the
1707
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1243
     alpha-equivalence for @{term "x\<^isub>j"}
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1244
     and @{term "fv_ty"} is the free variable function for @{term "x\<^isub>j"}\\
1710
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1245
  $\bullet$ & @{term "(bn\<^isub>m x\<^isub>n, x\<^isub>j) \<approx>gen R fv_ty \<pi> (bn\<^isub>m y\<^isub>n, y\<^isub>j)"} provided @{text "x\<^isub>j"}
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1246
     has a deep non-recursive binder @{text "bn\<^isub>m x\<^isub>n"} with permutation @{text "\<pi>"}, @{term "R"} is the
1707
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1247
     alpha-equivalence for @{term "x\<^isub>j"}
70c5e688f677 Change @{text} to @{term}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1706
diff changeset
  1248
     and @{term "fv_ty"} is the free variable function for @{term "x\<^isub>j"}\\
1706
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1249
  $\bullet$ & @{text "x\<^isub>j \<approx>\<^isub>j y\<^isub>j"} for a nominal datatype with no bindings (this includes
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1250
    the types being defined, raw)\\
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1251
  $\bullet$ & @{text "x\<^isub>j = y\<^isub>j"} otherwise\\
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1252
  \end{tabular}
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1705
diff changeset
  1253
  \end{center}
1705
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1704
diff changeset
  1254
1708
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1255
  The alpha-equivalence relations for binding functions are similar to the alpha-equivalences
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1256
  for their respective types, the difference is that they ommit checking the arguments that
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1257
  are bound. We assumed that there are no bindings in the type on which the binding function
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1258
  is defined so, there are no permutations involved. For a binding function clause 
1710
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1259
  @{text "bn (C_raw x\<^isub>1 \<dots> x\<^isub>n) = rhs"}, two instances of the constructor are equivalent
88b33de74e61 Clean alpha
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1709
diff changeset
  1260
  @{text "C_raw x\<^isub>1 \<dots> x\<^isub>n \<approx> C_raw y\<^isub>1 \<dots> y\<^isub>n"} if:
1708
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1261
  \begin{center}
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1262
  \begin{tabular}{cp{7cm}}
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1263
  $\bullet$ & @{text "x\<^isub>j"} is not a nominal datatype and occurs in @{text "rhs"}\\
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1264
  $\bullet$ & @{text "x\<^isub>j = y\<^isub>j"} provided @{text "x\<^isub>j"} is not a nominal datatype and does not occur in @{text "rhs"}\\
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1265
  $\bullet$ & @{text "x\<^isub>j \<approx>bn\<^isub>m y\<^isub>j"} provided @{text "x\<^isub>j"} is a nominal datatype occuring in @{text "rhs"}
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1266
    under the binding function @{text "bn\<^isub>m"}\\
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1267
  $\bullet$ & @{text "x\<^isub>j \<approx> y\<^isub>j"} otherwise\\
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1268
  \end{tabular}
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1269
  \end{center}
62b87efcef29 alpha_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1707
diff changeset
  1270
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1271
*}
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1272
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1273
section {* The Lifting of Definitions and Properties *} 
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1274
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1275
text {*
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1276
  Restrictions
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1277
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1278
  \begin{itemize}
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
  1279
  \item non-emptiness
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1280
  \item positive datatype definitions
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1281
  \item finitely supported abstractions
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1282
  \item respectfulness of the bn-functions\bigskip
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1283
  \item binders can only have a ``single scope''
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
  1284
  \item all bindings must have the same mode
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1285
  \end{itemize}
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1286
*}
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1287
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
  1288
section {* Examples *}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
  1289
1702
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1290
text {*
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1291
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1292
  \begin{figure}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1293
  \begin{boxedminipage}{\linewidth}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1294
  \small
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1295
  \begin{tabular}{l}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1296
  \isacommand{atom\_decl}~@{text "var"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1297
  \isacommand{atom\_decl}~@{text "cvar"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1298
  \isacommand{atom\_decl}~@{text "tvar"}\\[1mm]
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1299
  \isacommand{nominal\_datatype}~@{text "tkind ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1300
  \phantom{$|$}~@{text "KStar"}~$|$~@{text "KFun tkind tkind"}\\ 
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1301
  \isacommand{and}~@{text "ckind ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1302
  \phantom{$|$}~@{text "CKSim ty ty"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1303
  \isacommand{and}~@{text "ty ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1304
  \phantom{$|$}~@{text "TVar tvar"}~$|$~@{text "T string"}~$|$~@{text "TApp ty ty"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1305
  $|$~@{text "TFun string ty_list"}~%
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1306
  $|$~@{text "TAll tv::tvar tkind ty::ty"}  \isacommand{bind}~@{text "tv"}~\isacommand{in}~@{text ty}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1307
  $|$~@{text "TArr ckind ty"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1308
  \isacommand{and}~@{text "ty_lst ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1309
  \phantom{$|$}~@{text "TNil"}~$|$~@{text "TCons ty ty_lst"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1310
  \isacommand{and}~@{text "cty ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1311
  \phantom{$|$}~@{text "CVar cvar"}~%
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1312
  $|$~@{text "C string"}~$|$~@{text "CApp cty cty"}~$|$~@{text "CFun string co_lst"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1313
  $|$~@{text "CAll cv::cvar ckind cty::cty"}  \isacommand{bind}~@{text "cv"}~\isacommand{in}~@{text cty}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1314
  $|$~@{text "CArr ckind cty"}~$|$~@{text "CRefl ty"}~$|$~@{text "CSym cty"}~$|$~@{text "CCirc cty cty"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1315
  $|$~@{text "CAt cty ty"}~$|$~@{text "CLeft cty"}~$|$~@{text "CRight cty"}~$|$~@{text "CSim cty cty"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1316
  $|$~@{text "CRightc cty"}~$|$~@{text "CLeftc cty"}~$|$~@{text "Coerce cty cty"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1317
  \isacommand{and}~@{text "co_lst ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1318
  \phantom{$|$}@{text "CNil"}~$|$~@{text "CCons cty co_lst"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1319
  \isacommand{and}~@{text "trm ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1320
  \phantom{$|$}~@{text "Var var"}~$|$~@{text "K string"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1321
  $|$~@{text "LAM_ty tv::tvar tkind t::trm"}  \isacommand{bind}~@{text "tv"}~\isacommand{in}~@{text t}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1322
  $|$~@{text "LAM_cty cv::cvar ckind t::trm"}   \isacommand{bind}~@{text "cv"}~\isacommand{in}~@{text t}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1323
  $|$~@{text "App_ty trm ty"}~$|$~@{text "App_cty trm cty"}~$|$~@{text "App trm trm"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1324
  $|$~@{text "Lam v::var ty t::trm"}  \isacommand{bind}~@{text "v"}~\isacommand{in}~@{text t}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1325
  $|$~@{text "Let x::var ty trm t::trm"}  \isacommand{bind}~{text x}~\isacommand{in}~{text t}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1326
  $|$~@{text "Case trm assoc_lst"}~$|$~@{text "Cast trm co"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1327
  \isacommand{and}~@{text "assoc_lst ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1328
  \phantom{$|$}~@{text ANil}~%
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1329
  $|$~@{text "ACons p::pat t::trm assoc_lst"}  \isacommand{bind}~@{text "bv p"}~\isacommand{in}~@{text t}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1330
  \isacommand{and}~@{text "pat ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1331
  \phantom{$|$}~@{text "Kpat string tvtk_lst tvck_lst vt_lst"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1332
  \isacommand{and}~@{text "vt_lst ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1333
  \phantom{$|$}~@{text VTNil}~$|$~@{text "VTCons var ty vt_lst"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1334
  \isacommand{and}~@{text "tvtk_lst ="}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1335
  \phantom{$|$}~@{text TVTKNil}~$|$~@{text "TVTKCons tvar tkind tvtk_lst"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1336
  \isacommand{and}~@{text "tvck_lst ="}\\ 
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1337
  \phantom{$|$}~@{text TVCKNil}~$|$ @{text "TVCKCons cvar ckind tvck_lst"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1338
  \isacommand{binder}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1339
  @{text "bv :: pat \<Rightarrow> atom list"}~\isacommand{and}~%
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1340
  @{text "bv1 :: vt_lst \<Rightarrow> atom list"}~\isacommand{and}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1341
  @{text "bv2 :: tvtk_lst \<Rightarrow> atom list"}~\isacommand{and}~%
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1342
  @{text "bv3 :: tvck_lst \<Rightarrow> atom list"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1343
  \isacommand{where}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1344
  \phantom{$|$}~@{text "bv (K s tvts tvcs vs) = (bv3 tvts) @ (bv2 tvcs) @ (bv1 vs)"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1345
  $|$~@{text "bv1 VTNil = []"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1346
  $|$~@{text "bv1 (VTCons x ty tl) = (atom x)::(bv1 tl)"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1347
  $|$~@{text "bv2 TVTKNil = []"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1348
  $|$~@{text "bv2 (TVTKCons a ty tl) = (atom a)::(bv2 tl)"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1349
  $|$~@{text "bv3 TVCKNil = []"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1350
  $|$~@{text "bv3 (TVCKCons c cty tl) = (atom c)::(bv3 tl)"}\\
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1351
  \end{tabular}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1352
  \end{boxedminipage}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1353
  \caption{\label{nominalcorehas}}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1354
  \end{figure}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1355
*}
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1356
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1357
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1358
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1359
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
  1360
section {* Adequacy *}
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
  1361
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
  1362
section {* Related Work *}
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
  1363
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1364
text {*
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1365
  Ott is better with list dot specifications; subgrammars
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1366
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1367
  untyped; 
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1368
  
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1369
*}
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1370
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  1371
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
  1372
section {* Conclusion *}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
  1373
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
  1374
text {*
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1375
  Complication when the single scopedness restriction is lifted (two 
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1376
  overlapping permutations)
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
  1377
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
  1378
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
  1379
  The formalisation presented here will eventually become part of the 
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
  1380
  Isabelle distribution, but for the moment it can be downloaded from 
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
  1381
  the Mercurial repository linked at 
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
  1382
  \href{http://isabelle.in.tum.de/nominal/download}
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
  1383
  {http://isabelle.in.tum.de/nominal/download}.\medskip
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1384
*}
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1385
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
  1386
text {*
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
  1387
1517
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
  1388
  TODO: function definitions:
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
  1389
  \medskip
62d6f7acc110 corrected the strong induction principle in the lambda-calculus case; gave a second (oartial) version that is more elegant
Christian Urban <urbanc@in.tum.de>
parents: 1506
diff changeset
  1390
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
  1391
  \noindent
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
  1392
  {\bf Acknowledgements:} We are very grateful to Andrew Pitts for  
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
  1393
  many discussions about Nominal Isabelle. We thank Peter Sewell for 
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
  1394
  making the informal notes \cite{SewellBestiary} available to us and 
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
  1395
  also for patiently explaining some of the finer points about the abstract 
1702
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1396
  definitions and about the implementation of the Ott-tool. We
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1397
  also thank Stephanie Weirich for suggesting to separate the subgrammars
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  1398
  of kinds and types in our Core-Haskell example.
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
  1399
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
  1400
  Lookup: Merlin paper by James Cheney; Mark Shinwell PhD
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1401
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
  1402
  Future work: distinct list abstraction
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
  1403
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
  1404
  
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1405
*}
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1406
1484
dc7b049d9072 made paper to compile
Christian Urban <urbanc@in.tum.de>
parents: 1473
diff changeset
  1407
dc7b049d9072 made paper to compile
Christian Urban <urbanc@in.tum.de>
parents: 1473
diff changeset
  1408
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1409
(*<*)
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  1410
end
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  1411
(*>*)