Paper/Paper.thy
author Christian Urban <urbanc@in.tum.de>
Wed, 06 Oct 2010 08:09:40 +0100
changeset 2512 b5cb3183409e
parent 2511 2ccf3086142b
child 2513 ae860c95bf9f
permissions -rw-r--r--
down to 22 pages
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
2465
07ffa4e41659 adapted paper to changes
Christian Urban <urbanc@in.tum.de>
parents: 2381
diff changeset
     3
imports "../Nominal/Nominal2" "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"
1728
9bbf2a1f9b3f More on paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1727
diff changeset
     8
  abs_set :: "'a \<Rightarrow> 'b \<Rightarrow> 'c"
9bbf2a1f9b3f More on paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1727
diff changeset
     9
  alpha_bn :: "'a \<Rightarrow> 'a \<Rightarrow> bool"
1763
3b89de6150ed completed conclusion
Christian Urban <urbanc@in.tum.de>
parents: 1761
diff changeset
    10
  abs_set2 :: "'a \<Rightarrow> perm \<Rightarrow> 'b \<Rightarrow> 'c"
1796
5165c350ee1a clarified comment about distinct lists in th efuture work section
Christian Urban <urbanc@in.tum.de>
parents: 1775
diff changeset
    11
  Abs_dist :: "'a \<Rightarrow> 'b \<Rightarrow> 'c" 
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    12
  Abs_print :: "'a \<Rightarrow> 'b \<Rightarrow> 'c" 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    13
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    14
definition
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    15
 "equal \<equiv> (op =)" 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    16
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    17
notation (latex output)
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    18
  swap ("'(_ _')" [1000, 1000] 1000) and
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    19
  fresh ("_ # _" [51, 51] 50) and
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
    20
  fresh_star ("_ #\<^sup>* _" [51, 51] 50) and
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    21
  supp ("supp _" [78] 73) and
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
    22
  uminus ("-_" [78] 73) and
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    23
  If  ("if _ then _ else _" 10) and
2471
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
    24
  alpha_set ("_ \<approx>\<^raw:\,\raisebox{-1pt}{\makebox[0mm][l]{$_{\textit{set}}$}}>\<^bsup>_, _, _\<^esup> _") and
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
    25
  alpha_lst ("_ \<approx>\<^raw:\,\raisebox{-1pt}{\makebox[0mm][l]{$_{\textit{list}}$}}>\<^bsup>_, _, _\<^esup> _") and
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
    26
  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
    27
  abs_set ("_ \<approx>\<^raw:{$\,_{\textit{abs\_set}}$}> _") and
1763
3b89de6150ed completed conclusion
Christian Urban <urbanc@in.tum.de>
parents: 1761
diff changeset
    28
  abs_set2 ("_ \<approx>\<^raw:\raisebox{-1pt}{\makebox[0mm][l]{$\,_{\textit{list}}$}}>\<^bsup>_\<^esup>  _") and
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
    29
  fv ("fa'(_')" [100] 100) and
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    30
  equal ("=") and
2471
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
    31
  alpha_abs_set ("_ \<approx>\<^raw:{$\,_{\textit{abs\_set}}$}> _") and 
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
    32
  Abs_set ("[_]\<^bsub>set\<^esub>._" [20, 101] 999) and
2331
f170ee51eed2 some slight polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
    33
  Abs_lst ("[_]\<^bsub>list\<^esub>._") and
f170ee51eed2 some slight polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
    34
  Abs_dist ("[_]\<^bsub>#list\<^esub>._") and
f170ee51eed2 some slight polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
    35
  Abs_res ("[_]\<^bsub>res\<^esub>._") and
f170ee51eed2 some slight polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
    36
  Abs_print ("_\<^bsub>set\<^esub>._") and
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
    37
  Cons ("_::_" [78,77] 73) and
2471
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
    38
  supp_set ("aux _" [1000] 10) and
1728
9bbf2a1f9b3f More on paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1727
diff changeset
    39
  alpha_bn ("_ \<approx>bn _")
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    40
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    41
consts alpha_trm ::'a
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    42
consts fa_trm :: 'a
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    43
consts alpha_trm2 ::'a
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    44
consts fa_trm2 :: 'a
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    45
consts ast :: 'a
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    46
consts ast' :: 'a
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    47
notation (latex output) 
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    48
  alpha_trm ("\<approx>\<^bsub>trm\<^esub>") and
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    49
  fa_trm ("fa\<^bsub>trm\<^esub>") and
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    50
  alpha_trm2 ("'(\<approx>\<^bsub>assn\<^esub>, \<approx>\<^bsub>trm\<^esub>')") and
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    51
  fa_trm2 ("'(fa\<^bsub>assn\<^esub>, fa\<^bsub>trm\<^esub>')") and
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    52
  ast ("'(as, t')") and
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    53
  ast' ("'(as', t\<PRIME> ')")
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
    54
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
(*>*)
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    57
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
section {* Introduction *}
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
text {*
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
    61
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
    62
  So far, Nominal Isabelle provided a mechanism for constructing
2509
679cef364022 llncs and more sqeezing
Christian Urban <urbanc@in.tum.de>
parents: 2508
diff changeset
    63
  $\alpha$-equated terms, for example lambda-terms,
679cef364022 llncs and more sqeezing
Christian Urban <urbanc@in.tum.de>
parents: 2508
diff changeset
    64
  @{text "t ::= x | t t | \<lambda>x. t"},
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
    65
  where free and bound variables have names.  For such $\alpha$-equated terms,
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    66
  Nominal Isabelle derives automatically a reasoning infrastructure that has
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    67
  been used successfully in formalisations of an equivalence checking
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    68
  algorithm for LF \cite{UrbanCheneyBerghofer08}, Typed
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    69
  Scheme~\cite{TobinHochstadtFelleisen08}, several calculi for concurrency
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    70
  \cite{BengtsonParow09} and a strong normalisation result for cut-elimination
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    71
  in classical logic \cite{UrbanZhu08}. It has also been used by Pollack for
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    72
  formalisations in the locally-nameless approach to binding
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
    73
  \cite{SatoPollack10}.
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    74
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
    75
  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
    76
  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
    77
  respectively, of the form
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    78
  %
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    79
  \begin{equation}\label{tysch}
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    80
  \begin{array}{l}
2509
679cef364022 llncs and more sqeezing
Christian Urban <urbanc@in.tum.de>
parents: 2508
diff changeset
    81
  @{text "T ::= x | T \<rightarrow> T"}\hspace{9mm}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
    82
  @{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
    83
  \end{array}
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
    84
  \end{equation}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
    85
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
    86
  \noindent
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
    87
  and the @{text "\<forall>"}-quantification binds a finite (possibly empty) set of
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    88
  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
    89
  binders by iterating single binders, this leads to a rather clumsy
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    90
  formalisation of W. The need of iterating single binders is also one reason
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
    91
  why Nominal Isabelle 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
    92
  % and similar theorem provers that only provide
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
    93
  %mechanisms for binding single variables 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
    94
  has not fared extremely well with the
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
    95
  more advanced tasks in the POPLmark challenge \cite{challenge05}, because
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
    96
  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
    97
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
    98
  Binding multiple variables has interesting properties that cannot be captured
2176
5054f170024e edits from the reviewers
Christian Urban <urbanc@in.tum.de>
parents: 2175
diff changeset
    99
  easily by iterating single binders. For example in the case of type-schemes we do not
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   100
  want to make a distinction about the order of the bound variables. Therefore
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   101
  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
   102
  %
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   103
  \begin{equation}\label{ex1}
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
   104
  @{text "\<forall>{x, y}. x \<rightarrow> y  \<approx>\<^isub>\<alpha>  \<forall>{y, x}. x \<rightarrow> y"} 
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   105
  \end{equation}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   106
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   107
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   108
  but assuming that @{text x}, @{text y} and @{text z} are distinct variables,
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   109
  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
   110
  %
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   111
  \begin{equation}\label{ex2}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   112
  @{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
   113
  \end{equation}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   114
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   115
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   116
  Moreover, we like to regard type-schemes as $\alpha$-equivalent, if they differ
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   117
  only on \emph{vacuous} binders, such as
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   118
  %
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   119
  \begin{equation}\label{ex3}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   120
  @{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
   121
  \end{equation}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   122
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   123
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   124
  where @{text z} does not occur freely in the type.  In this paper we will
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   125
  give a general binding mechanism and associated notion of $\alpha$-equivalence
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   126
  that can be used to faithfully represent this kind of binding in Nominal
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   127
  Isabelle.  The difficulty of finding the right notion for $\alpha$-equivalence
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   128
  can be appreciated in this case by considering that the definition given by
2331
f170ee51eed2 some slight polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2330
diff changeset
   129
  Leroy in \cite{Leroy92} is incorrect (it omits a side-condition). 
1524
Christian Urban <urbanc@in.tum.de>
parents: 1523
diff changeset
   130
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   131
  However, the notion of $\alpha$-equivalence that is preserved by vacuous
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   132
  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
   133
  %
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   134
  \begin{equation}\label{one}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   135
  @{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
   136
  \end{equation}
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   137
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   138
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   139
  we might not care in which order the assignments @{text "x = 3"} and
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   140
  \mbox{@{text "y = 2"}} are given, but it would be unusual to regard
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   141
  \eqref{one} as $\alpha$-equivalent with
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   142
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   143
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   144
  @{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
   145
  \end{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   146
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   147
  \noindent
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   148
  Therefore we will also provide a separate binding mechanism for cases in
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   149
  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
   150
  binders has to agree.
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   151
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   152
  However, we found that this is still not sufficient for dealing with
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   153
  language constructs frequently occurring in programming language
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   154
  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
   155
  %
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   156
  \begin{equation}\label{two}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   157
  @{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
   158
  \end{equation}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   159
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   160
  \noindent
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   161
  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
   162
  $\mathtt{let}$, but we also care about the order of these variables, since
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   163
  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
   164
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   165
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   166
  @{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
   167
  \end{center}
2218
502eaa199726 added to the popl-paper a pointer to work by Altenkirch
Christian Urban <urbanc@in.tum.de>
parents: 2203
diff changeset
   168
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   169
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   170
  As a result, we provide three general binding mechanisms each of which binds
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   171
  multiple variables at once, and let the user chose which one is intended
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   172
  in a formalisation.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   173
  %%when formalising a term-calculus.
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   174
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   175
  By providing these general binding mechanisms, however, we have to work
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   176
  around a problem that has been pointed out by Pottier \cite{Pottier06} and
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   177
  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
   178
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   179
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   180
  @{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
   181
  \end{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   182
  %
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   183
  \noindent
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   184
  we care about the 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   185
  information that there are as many bound variables @{text
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   186
  "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
   187
  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
   188
  %
1523
eb95360d6ac6 another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1520
diff changeset
   189
  \begin{center}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   190
  @{text "\<LET> (\<lambda>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
   191
  \end{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   192
  %
1523
eb95360d6ac6 another little bit for the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1520
diff changeset
   193
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   194
  where the notation @{text "\<lambda>_ . _"} indicates that the list of @{text
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   195
  "x\<^isub>i"} becomes bound in @{text s}. In this representation the term
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   196
  \mbox{@{text "\<LET> (\<lambda>x . s)  [t\<^isub>1, t\<^isub>2]"}} is a perfectly legal
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   197
  instance, but the lengths of the two lists do not agree. To exclude such
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   198
  terms, additional predicates about well-formed terms are needed in order to
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   199
  ensure that the two lists are of equal length. This can result in very messy
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   200
  reasoning (see for example~\cite{BengtsonParow09}). To avoid this, we will
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   201
  allow type specifications for @{text "\<LET>"}s as follows
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   202
  %
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   203
  \begin{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   204
  \begin{tabular}{r@ {\hspace{2mm}}r@ {\hspace{2mm}}cl}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   205
  @{text trm} & @{text "::="}  & @{text "\<dots>"} 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   206
              & @{text "|"}  @{text "\<LET>  as::assn  s::trm"}\hspace{2mm} 
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   207
                                 \isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text "s"}\\%%%[1mm]
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   208
  @{text assn} & @{text "::="} & @{text "\<ANIL>"}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   209
               &  @{text "|"}  @{text "\<ACONS>  name  trm  assn"}
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   210
  \end{tabular}
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   211
  \end{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   212
  %
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   213
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   214
  where @{text assn} is an auxiliary type representing a list of assignments
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   215
  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
   216
  by the @{text "\<LET>"}. This function can be defined by recursion over @{text
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   217
  assn} as follows
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   218
  %
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   219
  \begin{center}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   220
  @{text "bn(\<ANIL>) ="} @{term "{}"} \hspace{5mm} 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   221
  @{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
   222
  \end{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   223
  %
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   224
  \noindent
1550
66d388a84e3c polished
Christian Urban <urbanc@in.tum.de>
parents: 1545
diff changeset
   225
  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
   226
  example @{text "s::trm"}, and a binding clause, in this case
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   227
  \isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text "s"}. This binding
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
   228
  clause states that all the names the function @{text
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
   229
  "bn(as)"} returns should be bound in @{text s}.  This style of specifying terms and bindings is heavily
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   230
  inspired by the syntax of the Ott-tool \cite{ott-jfp}. 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   231
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   232
  %Though, Ott
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   233
  %has only one binding mode, namely the one where the order of
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   234
  %binders matters. Consequently, type-schemes with binding sets
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   235
  %of names cannot be modelled in Ott.
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   236
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   237
  However, we will not be able to cope with all specifications that are
2176
5054f170024e edits from the reviewers
Christian Urban <urbanc@in.tum.de>
parents: 2175
diff changeset
   238
  allowed by Ott. One reason is that Ott lets the user specify ``empty'' 
2509
679cef364022 llncs and more sqeezing
Christian Urban <urbanc@in.tum.de>
parents: 2508
diff changeset
   239
  types like @{text "t ::= t t | \<lambda>x. t"}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   240
  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
   241
  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
   242
  at all in a HOL-based environment where every datatype must have a non-empty
1719
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
   243
  set-theoretic model \cite{Berghofer99}.
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   244
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   245
  Another reason is that we establish the reasoning infrastructure
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   246
  for $\alpha$-\emph{equated} terms. In contrast, Ott produces  a reasoning 
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   247
  infrastructure in Isabelle/HOL for
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   248
  \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
   249
  and the raw terms produced by Ott use names for bound variables,
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   250
  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
   251
  that the two type-schemes
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   252
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   253
  \begin{center}
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   254
  @{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
   255
  \end{center}
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   256
  
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   257
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   258
  are not just $\alpha$-equal, but actually \emph{equal}! As a result, we can
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   259
  only support specifications that make sense on the level of $\alpha$-equated
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   260
  terms (offending specifications, which for example bind a variable according
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   261
  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
   262
  to).  
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   263
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   264
  Our insistence on reasoning with $\alpha$-equated terms comes from the
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   265
  wealth of experience we gained with the older version of Nominal Isabelle:
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   266
  for non-trivial properties, reasoning with $\alpha$-equated terms is much
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   267
  easier than reasoning with raw terms. The fundamental reason for this is
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   268
  that the HOL-logic underlying Nominal Isabelle allows us to replace
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   269
  ``equals-by-equals''. In contrast, replacing
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   270
  ``$\alpha$-equals-by-$\alpha$-equals'' in a representation based on raw terms
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   271
  requires a lot of extra reasoning work.
1535
a37c65fe10de more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1528
diff changeset
   272
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   273
  Although in informal settings a reasoning infrastructure for $\alpha$-equated
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   274
  terms is nearly always taken for granted, establishing it automatically in
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   275
  the Isabelle/HOL is a rather non-trivial task. For every
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   276
  specification we will need to construct a type containing as elements the
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   277
  $\alpha$-equated terms. To do so, we use the standard HOL-technique of defining
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   278
  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
   279
  construction we perform in Isabelle/HOL can be illustrated by the following picture:
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   280
  %
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   281
  \begin{center}
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   282
  \begin{tikzpicture}[scale=0.89]
1552
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   283
  %\draw[step=2mm] (-4,-1) grid (4,1);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   284
  
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   285
  \draw[very thick] (0.7,0.4) circle (4.25mm);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   286
  \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
   287
  \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
   288
  
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   289
  \draw (-2.0, 0.845) --  (0.7,0.845);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   290
  \draw (-2.0,-0.045)  -- (0.7,-0.045);
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   291
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   292
  \draw ( 0.7, 0.4) node {\footnotesize\begin{tabular}{@ {}c@ {}}$\alpha$-\\[-1mm]clas.\end{tabular}};
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   293
  \draw (-2.4, 0.4) node {\footnotesize\begin{tabular}{@ {}c@ {}}$\alpha$-eq.\\[-1mm]terms\end{tabular}};
1552
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   294
  \draw (1.8, 0.48) node[right=-0.1mm]
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   295
    {\footnotesize\begin{tabular}{@ {}l@ {}}existing\\[-1mm] type\\ (sets of raw terms)\end{tabular}};
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   296
  \draw (0.9, -0.35) node {\footnotesize\begin{tabular}{@ {}l@ {}}non-empty\\[-1mm]subset\end{tabular}};
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   297
  \draw (-3.25, 0.55) node {\footnotesize\begin{tabular}{@ {}l@ {}}new\\[-1mm]type\end{tabular}};
1552
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   298
  
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   299
  \draw[<->, very thick] (-1.8, 0.3) -- (-0.1,0.3);
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   300
  \draw (-0.95, 0.3) node[above=0mm] {\footnotesize{}isomorphism};
1552
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   301
d14b8b21bef2 picture
Christian Urban <urbanc@in.tum.de>
parents: 1550
diff changeset
   302
  \end{tikzpicture}
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   303
  \end{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   304
  %
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   305
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   306
  We take as the starting point a definition of raw terms (defined as a
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
   307
  datatype in Isabelle/HOL); then identify the $\alpha$-equivalence classes in
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   308
  the type of sets of raw terms according to our $\alpha$-equivalence relation,
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   309
  and finally define the new type as these $\alpha$-equivalence classes
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   310
  (non-emptiness is satisfied whenever the raw terms are definable as datatype
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   311
  in Isabelle/HOL and the property that our relation for $\alpha$-equivalence is
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   312
  indeed an equivalence relation).
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   313
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   314
  %The fact that we obtain an isomorphism between the new type and the
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   315
  %non-empty subset shows that the new type is a faithful representation of
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   316
  %$\alpha$-equated terms. That is not the case for example for terms using the
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   317
  %locally nameless representation of binders \cite{McKinnaPollack99}: in this
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   318
  %representation there are ``junk'' terms that need to be excluded by
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   319
  %reasoning about a well-formedness predicate.
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   320
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   321
  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
   322
  be useful, a reasoning infrastructure needs to be ``lifted'' from the
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   323
  underlying subset to the new type. This is usually a tricky and arduous
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   324
  task. To ease it, we re-implemented in Isabelle/HOL the quotient package
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   325
  described by Homeier \cite{Homeier05} for the HOL4 system. This package
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   326
  allows us to lift definitions and theorems involving raw terms to
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   327
  definitions and theorems involving $\alpha$-equated terms. For example if we
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   328
  define the free-variable function over raw lambda-terms
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   329
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   330
  \begin{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   331
  @{text "fv(x) = {x}"}\hspace{8mm}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   332
  @{text "fv(t\<^isub>1 t\<^isub>2) = fv(t\<^isub>1) \<union> fv(t\<^isub>2)"}\hspace{8mm}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   333
  @{text "fv(\<lambda>x.t) = fv(t) - {x}"}
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   334
  \end{center}
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   335
  
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   336
  \noindent
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   337
  then with the help of the quotient package we can obtain a function @{text "fv\<^sup>\<alpha>"}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   338
  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
   339
  lifted function is characterised by the equations
1577
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   340
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   341
  \begin{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   342
  @{text "fv\<^sup>\<alpha>(x) = {x}"}\hspace{8mm}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   343
  @{text "fv\<^sup>\<alpha>(t\<^isub>1 t\<^isub>2) = fv\<^sup>\<alpha>(t\<^isub>1) \<union> fv\<^sup>\<alpha>(t\<^isub>2)"}\hspace{8mm}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   344
  @{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
   345
  \end{center}
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   346
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   347
  \noindent
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   348
  (Note that this means also the term-constructors for variables, applications
8466fe2216da tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1572
diff changeset
   349
  and lambda are lifted to the quotient level.)  This construction, of course,
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   350
  only works if $\alpha$-equivalence is indeed an equivalence relation, and the
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   351
  ``raw'' definitions and theorems are respectful w.r.t.~$\alpha$-equivalence.
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   352
  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
   353
  this function can be defined for raw terms, it does not respect
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   354
  $\alpha$-equivalence and therefore cannot be lifted. To sum up, every lifting
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   355
  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
   356
  properties (see \cite{Homeier05}). In the paper we show that we are able to
2128
abd46dfc0212 tuned the paper
Christian Urban <urbanc@in.tum.de>
parents: 1961
diff changeset
   357
  automate these proofs and as a result can automatically establish a reasoning 
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   358
  infrastructure for $\alpha$-equated terms.\smallskip
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   359
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   360
  %The examples we have in mind where our reasoning infrastructure will be
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   361
  %helpful includes the term language of Core-Haskell. This term language
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   362
  %involves patterns that have lists of type-, coercion- and term-variables,
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   363
  %all of which are bound in @{text "\<CASE>"}-expressions. In these
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   364
  %patterns we do not know in advance how many variables need to
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   365
  %be bound. Another example is the specification of SML, which includes
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   366
  %includes bindings as in type-schemes.\medskip
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   367
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   368
  \noindent
2381
fd85f4921654 samll changes
Christian Urban <urbanc@in.tum.de>
parents: 2364
diff changeset
   369
  {\bf Contributions:}  We provide three new definitions for when terms
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   370
  involving general binders are $\alpha$-equivalent. These definitions are
1607
ac69ed8303cc tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1587
diff changeset
   371
  inspired by earlier work of Pitts \cite{Pitts04}. By means of automatic
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   372
  proofs, we establish a reasoning infrastructure for $\alpha$-equated
1528
d6ee4a1b34ce more tuning on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1524
diff changeset
   373
  terms, including properties about support, freshness and equality
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   374
  conditions for $\alpha$-equated terms. We are also able to derive strong 
2218
502eaa199726 added to the popl-paper a pointer to work by Altenkirch
Christian Urban <urbanc@in.tum.de>
parents: 2203
diff changeset
   375
  induction principles that have the variable convention already built in.
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   376
  The method behind our specification of general binders is taken 
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
   377
  from the Ott-tool, but we introduce crucial restrictions, and also extensions, so 
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   378
  that our specifications make sense for reasoning about $\alpha$-equated terms.  
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   379
  The main improvement over Ott is that we introduce three binding modes
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   380
  (only one is present in Ott), provide definitions for $\alpha$-equivalence and 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   381
  for free variables of our terms, and also derive a reasoning infrastructure
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   382
  about our specifications inside Isabelle/HOL.
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   383
1667
2922b04d9545 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1662
diff changeset
   384
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   385
  %\begin{figure}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   386
  %\begin{boxedminipage}{\linewidth}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   387
  %%\begin{center}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   388
  %\begin{tabular}{r@ {\hspace{1mm}}r@ {\hspace{2mm}}l}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   389
  %\multicolumn{3}{@ {}l}{Type Kinds}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   390
  %@{text "\<kappa>"} & @{text "::="} & @{text "\<star> | \<kappa>\<^isub>1 \<rightarrow> \<kappa>\<^isub>2"}\smallskip\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   391
  %\multicolumn{3}{@ {}l}{Coercion Kinds}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   392
  %@{text "\<iota>"} & @{text "::="} & @{text "\<sigma>\<^isub>1 \<sim> \<sigma>\<^isub>2"}\smallskip\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   393
  %\multicolumn{3}{@ {}l}{Types}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   394
  %@{text "\<sigma>"} & @{text "::="} & @{text "a | T | \<sigma>\<^isub>1 \<sigma>\<^isub>2 | S\<^isub>n"}$\;\overline{@{text "\<sigma>"}}$@{text "\<^sup>n"} 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   395
  %@{text "| \<forall>a:\<kappa>. \<sigma> | \<iota> \<Rightarrow> \<sigma>"}\smallskip\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   396
  %\multicolumn{3}{@ {}l}{Coercion Types}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   397
  %@{text "\<gamma>"} & @{text "::="} & @{text "c | C | \<gamma>\<^isub>1 \<gamma>\<^isub>2 | S\<^isub>n"}$\;\overline{@{text "\<gamma>"}}$@{text "\<^sup>n"}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   398
  %@{text "| \<forall>c:\<iota>. \<gamma> | \<iota> \<Rightarrow> \<gamma> "}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   399
  %& @{text "|"} & @{text "refl \<sigma> | sym \<gamma> | \<gamma>\<^isub>1 \<circ> \<gamma>\<^isub>2 | \<gamma> @ \<sigma> | left \<gamma> | right \<gamma>"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   400
  %& @{text "|"} & @{text "\<gamma>\<^isub>1 \<sim> \<gamma>\<^isub>2 | rightc \<gamma> | leftc \<gamma> | \<gamma>\<^isub>1 \<triangleright> \<gamma>\<^isub>2"}\smallskip\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   401
  %\multicolumn{3}{@ {}l}{Terms}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   402
  %@{text "e"} & @{text "::="} & @{text "x | K | \<Lambda>a:\<kappa>. e | \<Lambda>c:\<iota>. e | e \<sigma> | e \<gamma>"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   403
  %& @{text "|"} & @{text "\<lambda>x:\<sigma>. e | e\<^isub>1 e\<^isub>2 | \<LET> x:\<sigma> = e\<^isub>1 \<IN> e\<^isub>2"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   404
  %& @{text "|"} & @{text "\<CASE> e\<^isub>1 \<OF>"}$\;\overline{@{text "p \<rightarrow> e\<^isub>2"}}$ @{text "| e \<triangleright> \<gamma>"}\smallskip\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   405
  %\multicolumn{3}{@ {}l}{Patterns}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   406
  %@{text "p"} & @{text "::="} & @{text "K"}$\;\overline{@{text "a:\<kappa>"}}\;\overline{@{text "c:\<iota>"}}\;\overline{@{text "x:\<sigma>"}}$\smallskip\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   407
  %\multicolumn{3}{@ {}l}{Constants}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   408
  %& @{text C} & coercion constants\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   409
  %& @{text T} & value type constructors\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   410
  %& @{text "S\<^isub>n"} & n-ary type functions (which need to be fully applied)\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   411
  %& @{text K} & data constructors\smallskip\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   412
  %\multicolumn{3}{@ {}l}{Variables}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   413
  %& @{text a} & type variables\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   414
  %& @{text c} & coercion variables\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   415
  %& @{text x} & term variables\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   416
  %\end{tabular}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   417
  %\end{center}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   418
  %\end{boxedminipage}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   419
  %\caption{The System @{text "F\<^isub>C"}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   420
  %\cite{CoreHaskell}, also often referred to as \emph{Core-Haskell}. In this
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   421
  %version of @{text "F\<^isub>C"} we made a modification by separating the
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   422
  %grammars for type kinds and coercion kinds, as well as for types and coercion
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   423
  %types. For this paper the interesting term-constructor is @{text "\<CASE>"},
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   424
  %which binds multiple type-, coercion- and term-variables.\label{corehas}}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   425
  %\end{figure}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   426
*}
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   427
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   428
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
   429
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   430
text {*
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   431
  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
   432
  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
   433
  \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
   434
  to aid the description of what follows. 
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   435
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   436
  Two central notions in the nominal logic work are sorted atoms and
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   437
  sort-respecting permutations of atoms. We will use the letters @{text "a,
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   438
  b, c, \<dots>"} to stand for atoms and @{text "p, q, \<dots>"} to stand for
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   439
  permutations. The purpose of atoms is to represent variables, be they bound or free. 
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   440
  The sorts of atoms can be used to represent different kinds of
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   441
  variables.
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   442
  %%, such as the term-, coercion- and type-variables in Core-Haskell.
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   443
  It is assumed that there is an infinite supply of atoms for each
1847
0e70f3c82876 Minor paper fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1797
diff changeset
   444
  sort. However, in the interest of brevity, we shall restrict ourselves 
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   445
  in what follows to only one sort of atoms.
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   446
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   447
  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
   448
  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
   449
  two-place permutation operation written
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   450
  @{text "_ \<bullet> _  ::  perm \<Rightarrow> \<beta> \<Rightarrow> \<beta>"}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   451
  where 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
   452
  over which the permutation 
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   453
  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
   454
  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
   455
  and the inverse permutation of @{term p} as @{text "- p"}. The permutation
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   456
  operation is defined over the type-hierarchy \cite{HuffmanUrban10};
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   457
  for example permutations acting on products, lists, sets, functions and booleans is
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   458
  given by:
1702
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
   459
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   460
  \begin{equation}\label{permute}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   461
  \mbox{\begin{tabular}{@ {}c@ {\hspace{10mm}}c@ {}}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   462
  \begin{tabular}{@ {}l@ {}}
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   463
  @{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
   464
  @{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
   465
  @{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
   466
  \end{tabular} &
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   467
  \begin{tabular}{@ {}l@ {}}
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   468
  @{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
   469
  @{text "p \<bullet> f \<equiv> \<lambda>x. p \<bullet> (f (- p \<bullet> x))"}\\
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   470
  @{thm permute_bool_def[no_vars, THEN eq_reflection]}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   471
  \end{tabular}
1694
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   472
  \end{tabular}}
3bf0fddb7d44 clarified core-haskell example
Christian Urban <urbanc@in.tum.de>
parents: 1693
diff changeset
   473
  \end{equation}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   474
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   475
  \noindent
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   476
  Concrete permutations in Nominal Isabelle are built up from swappings, 
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   477
  written as \mbox{@{text "(a b)"}}, which are permutations that behave 
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   478
  as follows:
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   479
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   480
  \begin{center}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   481
  @{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
   482
  \end{center}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   483
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   484
  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
   485
  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
   486
  "x"}''.  This notion, written @{term "supp x"}, is general in the sense that
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   487
  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
   488
  products, sets and even functions. The definition depends only on the
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   489
  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
   490
  @{text x}, namely:
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   491
  %
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   492
  \begin{equation}\label{suppdef}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   493
  @{thm supp_def[no_vars, THEN eq_reflection]}
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   494
  \end{equation}
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   495
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   496
  \noindent
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   497
  There is also the derived notion for when an atom @{text a} is \emph{fresh}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   498
  for an @{text x}, defined as @{thm fresh_def[no_vars]}.
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
   499
  We use for sets of atoms the abbreviation 
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   500
  @{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
   501
  @{thm (rhs) fresh_star_def[no_vars]}.
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   502
  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
   503
  without knowing anything about the structure of @{term x} that
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
   504
  swapping two fresh atoms, say @{text a} and @{text b}, leaves 
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
   505
  @{text x} unchanged:
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   506
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   507
  \begin{property}\label{swapfreshfresh}
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   508
  @{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
   509
  \end{property}
1506
7c607df46a0a slightly more in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1493
diff changeset
   510
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   511
  %While often the support of an object can be relatively easily 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   512
  %described, for example for atoms, products, lists, function applications, 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   513
  %booleans and permutations as follows
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   514
  %%
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   515
  %\begin{center}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   516
  %\begin{tabular}{c@ {\hspace{10mm}}c}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   517
  %\begin{tabular}{rcl}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   518
  %@{term "supp a"} & $=$ & @{term "{a}"}\\
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   519
  %@{term "supp (x, y)"} & $=$ & @{term "supp x \<union> supp y"}\\
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   520
  %@{term "supp []"} & $=$ & @{term "{}"}\\
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   521
  %@{term "supp (x#xs)"} & $=$ & @{term "supp x \<union> supp xs"}\\
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   522
  %\end{tabular}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   523
  %&
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   524
  %\begin{tabular}{rcl}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   525
  %@{text "supp (f x)"} & @{text "\<subseteq>"} & @{term "supp f \<union> supp x"}\\
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   526
  %@{term "supp b"} & $=$ & @{term "{}"}\\
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   527
  %@{term "supp p"} & $=$ & @{term "{a. p \<bullet> a \<noteq> a}"}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   528
  %\end{tabular}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   529
  %\end{tabular}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   530
  %\end{center}
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   531
  %
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   532
  %\noindent 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   533
  %in some cases it can be difficult to characterise the support precisely, and
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   534
  %only an approximation can be established (as for functions above). 
1690
44a5edac90ad more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1687
diff changeset
   535
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   536
  %Reasoning about
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   537
  %such approximations can be simplified with the notion \emph{supports}, defined 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   538
  %as follows:
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   539
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   540
  %\begin{definition}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   541
  %A set @{text S} \emph{supports} @{text x} if for all atoms @{text a} and @{text b}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   542
  %not in @{text S} we have @{term "(a \<rightleftharpoons> b) \<bullet> x = x"}.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   543
  %\end{definition}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   544
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   545
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   546
  %The main point of @{text supports} is that we can establish the following 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   547
  %two properties.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   548
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   549
  %\begin{property}\label{supportsprop}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   550
  %Given a set @{text "as"} of atoms.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   551
  %{\it (i)} @{thm[mode=IfThen] supp_is_subset[where S="as", no_vars]}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   552
  %{\it (ii)} @{thm supp_supports[no_vars]}.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   553
  %\end{property}
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   554
  %
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   555
  %Another important notion in the nominal logic work is \emph{equivariance}.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   556
  %For a function @{text f}, say of type @{text "\<alpha> \<Rightarrow> \<beta>"}, to be equivariant 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   557
  %it is required that every permutation leaves @{text f} unchanged, that is
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   558
  %%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   559
  %\begin{equation}\label{equivariancedef}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   560
  %@{term "\<forall>p. p \<bullet> f = f"}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   561
  %\end{equation}
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   562
  %
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   563
  %\noindent or equivalently that a permutation applied to the application
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   564
  %@{text "f x"} can be moved to the argument @{text x}. That means for equivariant
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   565
  %functions @{text f}, we have for all permutations @{text p}:
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   566
  %%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   567
  %\begin{equation}\label{equivariance}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   568
  %@{text "p \<bullet> f = f"} \;\;\;\textit{if and only if}\;\;\;
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   569
  %@{text "p \<bullet> (f x) = f (p \<bullet> x)"}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   570
  %\end{equation}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   571
  % 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   572
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   573
  %From property \eqref{equivariancedef} and the definition of @{text supp}, we 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   574
  %can easily deduce that equivariant functions have empty support. There is
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   575
  %also a similar notion for equivariant relations, say @{text R}, namely the property
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   576
  %that
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   577
  %%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   578
  %\begin{center}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   579
  %@{text "x R y"} \;\;\textit{implies}\;\; @{text "(p \<bullet> x) R (p \<bullet> y)"}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   580
  %\end{center}
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   581
  %
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   582
  %Using freshness, the nominal logic work provides us with general means for renaming 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   583
  %binders. 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   584
  %
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   585
  \noindent
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   586
  While in the older version of Nominal Isabelle, we used extensively 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   587
  %Property~\ref{swapfreshfresh}
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   588
  this property to rename single binders, it %%this property 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   589
  proved too unwieldy for dealing with multiple binders. For such binders the 
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   590
  following generalisations turned out to be easier to use.
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   591
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   592
  \begin{property}\label{supppermeq}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   593
  @{thm[mode=IfThen] supp_perm_eq[no_vars]}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   594
  \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
   595
1747
4abb95a7264b starting strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1746
diff changeset
   596
  \begin{property}\label{avoiding}
1716
Christian Urban <urbanc@in.tum.de>
parents: 1715
diff changeset
   597
  For a finite set @{text as} and a finitely supported @{text x} with
Christian Urban <urbanc@in.tum.de>
parents: 1715
diff changeset
   598
  @{term "as \<sharp>* x"} and also a finitely supported @{text c}, there
Christian Urban <urbanc@in.tum.de>
parents: 1715
diff changeset
   599
  exists a permutation @{text p} such that @{term "(p \<bullet> as) \<sharp>* c"} and
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   600
  @{term "supp x \<sharp>* p"}.
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   601
  \end{property}
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   602
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   603
  \noindent
1716
Christian Urban <urbanc@in.tum.de>
parents: 1715
diff changeset
   604
  The idea behind the second property is that given a finite set @{text as}
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   605
  of binders (being bound, or fresh, in @{text x} is ensured by the
1716
Christian Urban <urbanc@in.tum.de>
parents: 1715
diff changeset
   606
  assumption @{term "as \<sharp>* x"}), then there exists a permutation @{text p} such that
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   607
  the renamed binders @{term "p \<bullet> as"} avoid @{text c} (which can be arbitrarily chosen
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   608
  as long as it is finitely supported) and also @{text "p"} does not affect anything
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   609
  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
   610
  fact and Property~\ref{supppermeq} allow us to ``rename'' just the binders 
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   611
  @{text as} in @{text x}, because @{term "p \<bullet> x = x"}.
1711
55cb244b020c changes to section 2
Christian Urban <urbanc@in.tum.de>
parents: 1708
diff changeset
   612
2128
abd46dfc0212 tuned the paper
Christian Urban <urbanc@in.tum.de>
parents: 1961
diff changeset
   613
  Most properties given in this section are described in detail in \cite{HuffmanUrban10}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   614
  and all are formalised in Isabelle/HOL. In the next sections we will make 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   615
  extensive use of these properties in order to define $\alpha$-equivalence in 
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   616
  the presence of multiple binders.
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   617
*}
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
   618
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   619
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
   620
section {* General Bindings\label{sec:binders} *}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
   621
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
   622
text {*
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   623
  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
   624
  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
   625
  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
   626
  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
   627
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   628
  In order to keep our work with deriving the reasoning infrastructure
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   629
  manageable, we will wherever possible state definitions and perform proofs
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   630
  on the ``user-level'' of Isabelle/HOL, as opposed to write custom ML-code that
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   631
  generates them anew for each specification. To that end, we will consider
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   632
  first pairs @{text "(as, x)"} of type @{text "(atom set) \<times> \<beta>"}.  These pairs
2128
abd46dfc0212 tuned the paper
Christian Urban <urbanc@in.tum.de>
parents: 1961
diff changeset
   633
  are intended to represent the abstraction, or binding, of the set of atoms @{text
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   634
  "as"} in the body @{text "x"}.
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
   635
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   636
  The first question we have to answer is when two pairs @{text "(as, x)"} and
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   637
  @{text "(bs, y)"} are $\alpha$-equivalent? (For the moment we are interested in
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   638
  the notion of $\alpha$-equivalence that is \emph{not} preserved by adding
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   639
  vacuous binders.) To answer this question, we identify four conditions: {\it (i)}
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   640
  given a free-atom function @{text "fa"} of type \mbox{@{text "\<beta> \<Rightarrow> atom
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   641
  set"}}, then @{text x} and @{text y} need to have the same set of free
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
   642
  atoms; moreover there must be a permutation @{text p} such that {\it
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   643
  (ii)} @{text p} leaves the free atoms of @{text x} and @{text y} unchanged, but
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   644
  {\it (iii)} ``moves'' their bound names so that we obtain modulo a relation,
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   645
  say \mbox{@{text "_ R _"}}, two equivalent terms. We also require that {\it (iv)}
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   646
  @{text p} makes the sets of abstracted atoms @{text as} and @{text bs} equal. The
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   647
  requirements {\it (i)} to {\it (iv)} can be stated formally as the conjunction of:
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   648
  %
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   649
  \begin{equation}\label{alphaset}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   650
  \begin{array}{@ {\hspace{10mm}}l@ {\hspace{5mm}}l@ {\hspace{10mm}}l@ {\hspace{5mm}}l}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   651
  \multicolumn{4}{l}{@{term "(as, x) \<approx>set R fa p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}}\\[1mm]
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   652
       \mbox{\it (i)}   & @{term "fa(x) - as = fa(y) - bs"} &
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   653
       \mbox{\it (iii)} &  @{text "(p \<bullet> x) R y"} \\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   654
       \mbox{\it (ii)}  & @{term "(fa(x) - as) \<sharp>* p"} & 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   655
       \mbox{\it (iv)}  & @{term "(p \<bullet> as) = bs"} \\ 
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   656
  \end{array}
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   657
  \end{equation}
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   658
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   659
  \noindent
2175
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   660
  Note that this relation depends on the permutation @{text
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   661
  "p"}; $\alpha$-equivalence between two pairs is then the relation where we
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   662
  existentially quantify over this @{text "p"}. Also note that the relation is
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   663
  dependent on a free-atom function @{text "fa"} and a relation @{text
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   664
  "R"}. The reason for this extra generality is that we will use
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   665
  $\approx_{\,\textit{set}}$ for both ``raw'' terms and $\alpha$-equated terms. In
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   666
  the latter case, @{text R} will be replaced by equality @{text "="} and we
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   667
  will prove that @{text "fa"} is equal to @{text "supp"}.
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   668
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   669
  The definition in \eqref{alphaset} does not make any distinction between the
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   670
  order of abstracted atoms. If we want this, then we can define $\alpha$-equivalence 
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   671
  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
   672
  as follows
1572
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
  \begin{equation}\label{alphalist}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   675
  \begin{array}{@ {\hspace{10mm}}l@ {\hspace{5mm}}l@ {\hspace{10mm}}l@ {\hspace{5mm}}l}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   676
  \multicolumn{4}{l}{@{term "(as, x) \<approx>lst R fa p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}}\\[1mm]
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   677
         \mbox{\it (i)}   & @{term "fa(x) - (set as) = fa(y) - (set bs)"} & 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   678
         \mbox{\it (iii)} & @{text "(p \<bullet> x) R y"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   679
         \mbox{\it (ii)}  & @{term "(fa(x) - set as) \<sharp>* p"} &
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   680
         \mbox{\it (iv)}  & @{term "(p \<bullet> as) = bs"}\\
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   681
  \end{array}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   682
  \end{equation}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   683
  
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   684
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   685
  where @{term set} is the function that coerces a list of atoms into a set of atoms.
1752
9e09253c80cf added alpha_bn definition
Christian Urban <urbanc@in.tum.de>
parents: 1749
diff changeset
   686
  Now the last clause ensures that the order of the binders matters (since @{text as}
9e09253c80cf added alpha_bn definition
Christian Urban <urbanc@in.tum.de>
parents: 1749
diff changeset
   687
  and @{text bs} are lists of atoms).
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   688
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   689
  If we do not want to make any difference between the order of binders \emph{and}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   690
  also allow vacuous binders, that means \emph{restrict} names, then we keep sets of binders, but drop 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   691
  condition {\it (iv)} in \eqref{alphaset}:
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   692
  %
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   693
  \begin{equation}\label{alphares}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   694
  \begin{array}{@ {\hspace{10mm}}l@ {\hspace{5mm}}l@ {\hspace{10mm}}l@ {\hspace{5mm}}l}
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   695
  \multicolumn{2}{l}{@{term "(as, x) \<approx>res R fa p (bs, y)"}\hspace{2mm}@{text "\<equiv>"}}\\[1mm]
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   696
             \mbox{\it (i)}   & @{term "fa(x) - as = fa(y) - bs"} & 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   697
             \mbox{\it (iii)} & @{text "(p \<bullet> x) R y"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   698
             \mbox{\it (ii)}  & @{term "(fa(x) - as) \<sharp>* p"}\\
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   699
  \end{array}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   700
  \end{equation}
1556
a7072d498723 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1552
diff changeset
   701
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
   702
  It might be useful to consider first some examples about how these definitions
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   703
  of $\alpha$-equivalence pan out in practice.  For this consider the case of
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   704
  abstracting a set of atoms over types (as in type-schemes). We set
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   705
  @{text R} to be the usual equality @{text "="} and for @{text "fa(T)"} we
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   706
  define
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   707
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   708
  \begin{center}
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   709
  @{text "fa(x) = {x}"}  \hspace{5mm} @{text "fa(T\<^isub>1 \<rightarrow> T\<^isub>2) = fa(T\<^isub>1) \<union> fa(T\<^isub>2)"}
1572
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   710
  \end{center}
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   711
0368aef38e6a more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1570
diff changeset
   712
  \noindent
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   713
  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
   714
  \eqref{ex3}. It can be easily checked that @{text "({x, y}, x \<rightarrow> y)"} and
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   715
  @{text "({y, x}, y \<rightarrow> x)"} are $\alpha$-equivalent according to
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   716
  $\approx_{\,\textit{set}}$ and $\approx_{\,\textit{res}}$ by taking @{text p} to
2175
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   717
  be the swapping @{term "(x \<rightleftharpoons> y)"}. In case of @{text "x \<noteq> y"}, then @{text
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   718
  "([x, y], x \<rightarrow> y)"} $\not\approx_{\,\textit{list}}$ @{text "([y, x], x \<rightarrow> y)"}
2175
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   719
  since there is no permutation that makes the lists @{text "[x, y]"} and
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   720
  @{text "[y, x]"} equal, and also leaves the type \mbox{@{text "x \<rightarrow> y"}}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   721
  unchanged. Another example is @{text "({x}, x)"} $\approx_{\,\textit{res}}$
2175
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   722
  @{text "({x, y}, x)"} which holds by taking @{text p} to be the identity
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   723
  permutation.  However, if @{text "x \<noteq> y"}, then @{text "({x}, x)"}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   724
  $\not\approx_{\,\textit{set}}$ @{text "({x, y}, x)"} since there is no
2175
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   725
  permutation that makes the sets @{text "{x}"} and @{text "{x, y}"} equal
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   726
  (similarly for $\approx_{\,\textit{list}}$).  It can also relatively easily be
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   727
  shown that all three notions of $\alpha$-equivalence coincide, if we only
2175
f11dd09fa3a7 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2163
diff changeset
   728
  abstract a single atom.
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   729
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   730
  In the rest of this section we are going to introduce three abstraction 
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   731
  types. For this we define 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   732
  %
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   733
  \begin{equation}
2471
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
   734
  @{term "abs_set (as, x) (bs, x) \<equiv> \<exists>p. alpha_set (as, x) equal supp p (bs, x)"}
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   735
  \end{equation}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   736
  
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   737
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   738
  (similarly for $\approx_{\,\textit{abs\_res}}$ 
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   739
  and $\approx_{\,\textit{abs\_list}}$). We can show that these relations are equivalence 
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   740
  relations. %% and equivariant.
1579
5b0bdd64956e more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1577
diff changeset
   741
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
   742
  \begin{lemma}\label{alphaeq} 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   743
  The relations $\approx_{\,\textit{abs\_set}}$, $\approx_{\,\textit{abs\_list}}$
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   744
  and $\approx_{\,\textit{abs\_res}}$ are equivalence relations. %, and if 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   745
  %@{term "abs_set (as, x) (bs, y)"} then also 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   746
  %@{term "abs_set (p \<bullet> as, p \<bullet> x) (p \<bullet> bs, p \<bullet> y)"} (similarly for the other two relations).
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   747
  \end{lemma}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   748
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   749
  \begin{proof}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   750
  Reflexivity is by taking @{text "p"} to be @{text "0"}. For symmetry we have
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   751
  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
   752
  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
   753
  proof obligation use @{text "q + p"}. All conditions are then by simple
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   754
  calculations. 
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   755
  \end{proof}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   756
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   757
  \noindent
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   758
  This lemma allows us to use our quotient package for introducing 
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   759
  new types @{text "\<beta> abs_set"}, @{text "\<beta> abs_res"} and @{text "\<beta> abs_list"}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   760
  representing $\alpha$-equivalence classes of pairs of type 
2128
abd46dfc0212 tuned the paper
Christian Urban <urbanc@in.tum.de>
parents: 1961
diff changeset
   761
  @{text "(atom set) \<times> \<beta>"} (in the first two cases) and of type @{text "(atom list) \<times> \<beta>"}
abd46dfc0212 tuned the paper
Christian Urban <urbanc@in.tum.de>
parents: 1961
diff changeset
   762
  (in the third case). 
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
   763
  The elements in these types will be, respectively, written as:
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   764
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   765
  \begin{center}
2471
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
   766
  @{term "Abs_set as x"} \hspace{5mm} 
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
   767
  @{term "Abs_res as x"} \hspace{5mm}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
   768
  @{term "Abs_lst as x"} 
1657
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   769
  \end{center}
Christian Urban <urbanc@in.tum.de>
parents: 1637
diff changeset
   770
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   771
  \noindent
1859
Christian Urban <urbanc@in.tum.de>
parents: 1847
diff changeset
   772
  indicating that a set (or list) of atoms @{text as} is abstracted in @{text x}. We will
1716
Christian Urban <urbanc@in.tum.de>
parents: 1715
diff changeset
   773
  call the types \emph{abstraction types} and their elements
1752
9e09253c80cf added alpha_bn definition
Christian Urban <urbanc@in.tum.de>
parents: 1749
diff changeset
   774
  \emph{abstractions}. The important property we need to derive is the support of 
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   775
  abstractions, namely:
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   776
2507
f5621efe5a20 changed to llncs
Christian Urban <urbanc@in.tum.de>
parents: 2502
diff changeset
   777
  \begin{theorem}[Support of Abstractions]\label{suppabs} 
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   778
  Assuming @{text x} has finite support, then
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   779
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   780
  \begin{center}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   781
  \begin{tabular}{l}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   782
  @{thm (lhs) supp_Abs(1)[no_vars]} $=$
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   783
  @{thm supp_Abs(2)[no_vars]}, and\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   784
  @{thm supp_Abs(3)[where bs="as", no_vars]}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   785
  \end{tabular}
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   786
  \end{center}
2507
f5621efe5a20 changed to llncs
Christian Urban <urbanc@in.tum.de>
parents: 2502
diff changeset
   787
  \end{theorem}
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   788
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   789
  \noindent
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   790
  This theorem states that the bound names do not appear in the support.
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   791
  For brevity we omit the proof and again refer the reader to
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   792
  our formalisation in Isabelle/HOL.
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   793
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   794
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   795
  %Below we will show the first equation. The others 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   796
  %follow by similar arguments. By definition of the abstraction type @{text "abs_set"} 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   797
  %we have 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   798
  %%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   799
  %\begin{equation}\label{abseqiff}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   800
  %@{thm (lhs) Abs_eq_iff(1)[where bs="as" and cs="bs", no_vars]} \;\;\text{if and only if}\;\; 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   801
  %@{thm (rhs) Abs_eq_iff(1)[where bs="as" and cs="bs", no_vars]}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   802
  %\end{equation}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   803
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   804
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   805
  %and also
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   806
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   807
  %\begin{equation}\label{absperm}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   808
  %%@%{%thm %permute_Abs[no_vars]}%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   809
  %\end{equation}
1662
e78cd33a246f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1657
diff changeset
   810
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   811
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   812
  %The second fact derives from the definition of permutations acting on pairs 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   813
  %\eqref{permute} and $\alpha$-equivalence being equivariant 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   814
  %(see Lemma~\ref{alphaeq}). With these two facts at our disposal, we can show 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   815
  %the following lemma about swapping two atoms in an abstraction.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   816
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   817
  %\begin{lemma}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   818
  %@{thm[mode=IfThen] Abs_swap1(1)[where bs="as", no_vars]}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   819
  %\end{lemma}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   820
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   821
  %\begin{proof}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   822
  %This lemma is straightforward using \eqref{abseqiff} and observing that
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   823
  %the assumptions give us @{term "(a \<rightleftharpoons> b) \<bullet> (supp x - as) = (supp x - as)"}.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   824
  %Moreover @{text supp} and set difference are equivariant (see \cite{HuffmanUrban10}).
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   825
  %\end{proof}
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   826
  %
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   827
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   828
  %Assuming that @{text "x"} has finite support, this lemma together 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   829
  %with \eqref{absperm} allows us to show
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   830
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   831
  %\begin{equation}\label{halfone}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   832
  %@{thm Abs_supports(1)[no_vars]}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   833
  %\end{equation}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   834
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   835
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   836
  %which by Property~\ref{supportsprop} gives us ``one half'' of
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   837
  %Theorem~\ref{suppabs}. The ``other half'' is a bit more involved. To establish 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   838
  %it, we use a trick from \cite{Pitts04} and first define an auxiliary 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   839
  %function @{text aux}, taking an abstraction as argument:
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   840
  %@{thm supp_set.simps[THEN eq_reflection, no_vars]}.
1687
51bc795b81fd more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1667
diff changeset
   841
  %
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   842
  %Using the second equation in \eqref{equivariance}, we can show that 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   843
  %@{text "aux"} is equivariant (since @{term "p \<bullet> (supp x - as) = (supp (p \<bullet> x)) - (p \<bullet> as)"}) 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   844
  %and therefore has empty support. 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   845
  %This in turn means
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   846
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   847
  %\begin{center}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   848
  %@{term "supp (supp_gen (Abs_set as x)) \<subseteq> supp (Abs_set as x)"}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   849
  %\end{center}
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   850
  %
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   851
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   852
  %using \eqref{suppfun}. Assuming @{term "supp x - as"} is a finite set,
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   853
  %we further obtain
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   854
  %
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   855
  %\begin{equation}\label{halftwo}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   856
  %@{thm (concl) Abs_supp_subset1(1)[no_vars]}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   857
  %\end{equation}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   858
  %
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   859
  %\noindent
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   860
  %since for finite sets of atoms, @{text "bs"}, we have 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   861
  %@{thm (concl) supp_finite_atom_set[where S="bs", no_vars]}.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   862
  %Finally, taking \eqref{halfone} and \eqref{halftwo} together establishes 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   863
  %Theorem~\ref{suppabs}. 
1703
ac2d0d4ea497 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1702
diff changeset
   864
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   865
  The method of first considering abstractions of the
2471
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
   866
  form @{term "Abs_set as x"} etc is motivated by the fact that 
1956
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
   867
  we can conveniently establish  at the Isabelle/HOL level
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
   868
  properties about them.  It would be
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
   869
  laborious to write custom ML-code that derives automatically such properties 
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   870
  for every term-constructor that binds some atoms. Also the generality of
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   871
  the definitions for $\alpha$-equivalence will help us in the next sections.
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
   872
*}
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
   873
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
   874
section {* Specifying General Bindings\label{sec:spec} *}
1491
f970ca9b5bec paper uses now a heap file - does not compile so long anymore
Christian Urban <urbanc@in.tum.de>
parents: 1485
diff changeset
   875
1520
6ac75fd979d4 more of the introduction
Christian Urban <urbanc@in.tum.de>
parents: 1517
diff changeset
   876
text {*
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
   877
  Our choice of syntax for specifications is influenced by the existing
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   878
  datatype package of Isabelle/HOL \cite{Berghofer99} and by the syntax of the
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   879
  Ott-tool \cite{ott-jfp}. For us a specification of a term-calculus is a
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   880
  collection of (possibly mutual recursive) type declarations, say @{text
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   881
  "ty\<AL>\<^isub>1, \<dots>, ty\<AL>\<^isub>n"}, and an associated collection of
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   882
  binding functions, say @{text "bn\<AL>\<^isub>1, \<dots>, bn\<AL>\<^isub>m"}. The
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   883
  syntax in Nominal Isabelle for such specifications is roughly as follows:
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
   884
  %
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   885
  \begin{equation}\label{scheme}
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   886
  \mbox{\begin{tabular}{@ {}p{2.5cm}l}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   887
  type \mbox{declaration part} &
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   888
  $\begin{cases}
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   889
  \mbox{\small\begin{tabular}{l}
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   890
  \isacommand{nominal\_datatype} @{text "ty\<AL>\<^isub>1 = \<dots>"}\\
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   891
  \isacommand{and} @{text "ty\<AL>\<^isub>2 = \<dots>"}\\
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   892
  \raisebox{2mm}{$\ldots$}\\[-2mm] 
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   893
  \isacommand{and} @{text "ty\<AL>\<^isub>n = \<dots>"}\\ 
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   894
  \end{tabular}}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   895
  \end{cases}$\\
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   896
  binding \mbox{function part} &
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   897
  $\begin{cases}
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   898
  \mbox{\small\begin{tabular}{l}
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
   899
  \isacommand{binder} @{text "bn\<AL>\<^isub>1"} \isacommand{and} \ldots \isacommand{and} @{text "bn\<AL>\<^isub>m"}\\
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   900
  \isacommand{where}\\
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   901
  \raisebox{2mm}{$\ldots$}\\[-2mm]
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   902
  \end{tabular}}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   903
  \end{cases}$\\
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   904
  \end{tabular}}
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
   905
  \end{equation}
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   906
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   907
  \noindent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   908
  Every type declaration @{text ty}$^\alpha_{1..n}$ consists of a collection of 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   909
  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
   910
  types that stand for the types of the arguments of the term-constructor.
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   911
  For example a term-constructor @{text "C\<^sup>\<alpha>"} might be specified with
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   912
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   913
  \begin{center}
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
   914
  @{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
   915
  \end{center}
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
   916
  
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   917
  \noindent
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   918
  whereby some of the @{text ty}$'_{1..l}$ %%(or their components) 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   919
  can be contained
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   920
  in the collection of @{text ty}$^\alpha_{1..n}$ declared in
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   921
  \eqref{scheme}. 
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   922
  In this case we will call the corresponding argument a
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   923
  \emph{recursive argument} of @{text "C\<^sup>\<alpha>"}. 
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
   924
  %The types of such recursive 
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   925
  %arguments need to satisfy a  ``positivity''
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   926
  %restriction, which ensures that the type has a set-theoretic semantics 
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   927
  %\cite{Berghofer99}.  
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
   928
  The labels
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   929
  annotated on the types are optional. Their purpose is to be used in the
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   930
  (possibly empty) list of \emph{binding clauses}, which indicate the binders
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   931
  and their scope in a term-constructor.  They come in three \emph{modes}:
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   932
  %
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   933
  \begin{center}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   934
  \begin{tabular}{@ {}l@ {}}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   935
  \isacommand{bind} {\it binders} \isacommand{in} {\it bodies}\;\;\;\;
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   936
  \isacommand{bind (set)} {\it binders} \isacommand{in} {\it bodies}\;\;\;\;
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   937
  \isacommand{bind (res)} {\it binders} \isacommand{in} {\it bodies}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
   938
  \end{tabular}
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   939
  \end{center}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
   940
  %
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   941
  \noindent
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   942
  The first mode is for binding lists of atoms (the order of binders matters);
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   943
  the second is for sets of binders (the order does not matter, but the
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
   944
  cardinality does) and the last is for sets of binders (with vacuous binders
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
   945
  preserving $\alpha$-equivalence). As indicated, the labels in the ``\isacommand{in}-part'' of a binding
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   946
  clause will be called \emph{bodies}; the
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
   947
  ``\isacommand{bind}-part'' will be called \emph{binders}. In contrast to
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   948
  Ott, we allow multiple labels in binders and bodies. 
1956
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
   949
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   950
  %For example we allow
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   951
  %binding clauses of the form:
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   952
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   953
  %\begin{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   954
  %\begin{tabular}{@ {}ll@ {}}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   955
  %@{text "Foo\<^isub>1 x::name y::name t::trm s::trm"} &  
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   956
  %    \isacommand{bind} @{text "x y"} \isacommand{in} @{text "t s"}\\
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   957
  %@{text "Foo\<^isub>2 x::name y::name t::trm s::trm"} &  
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   958
  %    \isacommand{bind} @{text "x y"} \isacommand{in} @{text "t"}, 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   959
  %    \isacommand{bind} @{text "x y"} \isacommand{in} @{text "s"}\\
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   960
  %\end{tabular}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   961
  %\end{center}
1956
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
   962
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
   963
  \noindent
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   964
  %Similarly for the other binding modes. 
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
   965
  %Interestingly, in case of \isacommand{bind (set)}
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
   966
  %and \isacommand{bind (res)} the binding clauses above will make a difference to the semantics
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   967
  %of the specifications (the corresponding $\alpha$-equivalence will differ). We will 
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   968
  %show this later with an example.
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
   969
  
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   970
  There are also some restrictions we need to impose on our binding clauses in comparison to
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   971
  the ones of Ott. The
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   972
  main idea behind these restrictions is that we obtain a sensible notion of
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   973
  $\alpha$-equivalence where it is ensured that within a given scope an 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
   974
  atom occurrence cannot be both bound and free at the same time.  The first
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
   975
  restriction is that a body can only occur in
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   976
  \emph{one} binding clause of a term constructor (this ensures that the bound
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
   977
  atoms of a body cannot be free at the same time by specifying an
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
   978
  alternative binder for the same body). For binders we distinguish between
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   979
  \emph{shallow} and \emph{deep} binders.  Shallow binders are just
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   980
  labels. The restriction we need to impose on them is that in case of
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
   981
  \isacommand{bind (set)} and \isacommand{bind (res)} the labels must either
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   982
  refer to atom types or to sets of atom types; in case of \isacommand{bind}
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   983
  the labels must refer to atom types or lists of atom types. Two examples for
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   984
  the use of shallow binders are the specification of lambda-terms, where a
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   985
  single name is bound, and type-schemes, where a finite set of names is
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   986
  bound:
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
   987
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
   988
  \begin{center}\small
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   989
  \begin{tabular}{@ {}c@ {\hspace{10mm}}c@ {}}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
   990
  \begin{tabular}{@ {}l}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   991
  \isacommand{nominal\_datatype} @{text lam} $=$\\
1719
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
   992
  \hspace{5mm}\phantom{$\mid$}~@{text "Var name"}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
   993
  \hspace{5mm}$\mid$~@{text "App lam lam"}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
   994
  \hspace{5mm}$\mid$~@{text "Lam x::name t::lam"}\\
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
   995
  \hspace{24mm}\isacommand{bind} @{text x} \isacommand{in} @{text t}\\
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
   996
  \end{tabular} &
1612
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
   997
  \begin{tabular}{@ {}l@ {}}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
   998
  \isacommand{nominal\_datatype}~@{text ty} $=$\\
1719
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
   999
  \hspace{5mm}\phantom{$\mid$}~@{text "TVar name"}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1000
  \hspace{5mm}$\mid$~@{text "TFun ty ty"}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1001
  \isacommand{and}~@{text "tsc = All xs::(name fset) T::ty"}\\
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1002
  \hspace{29mm}\isacommand{bind (res)} @{text xs} \isacommand{in} @{text T}\\
1611
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
  1003
  \end{tabular}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
  1004
  \end{tabular}
091f373baae9 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1607
diff changeset
  1005
  \end{center}
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1006
1612
c8c9b3b7189a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1611
diff changeset
  1007
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1008
  In these specifications @{text "name"} refers to an atom type, and @{text
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1009
  "fset"} to the type of finite sets.
2156
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1010
  Note that for @{text lam} it does not matter which binding mode we use. The
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1011
  reason is that we bind only a single @{text name}. However, having
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  1012
  \isacommand{bind (set)} or \isacommand{bind} in the second case makes a
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1013
  difference to the semantics of the specification (which we will define in the next section).
2156
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1014
2128
abd46dfc0212 tuned the paper
Christian Urban <urbanc@in.tum.de>
parents: 1961
diff changeset
  1015
2134
4648bd6930e4 tuned a bit the paper
Christian Urban <urbanc@in.tum.de>
parents: 2128
diff changeset
  1016
  A \emph{deep} binder uses an auxiliary binding function that ``picks'' out
2156
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1017
  the atoms in one argument of the term-constructor, which can be bound in
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1018
  other arguments and also in the same argument (we will call such binders
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1019
  \emph{recursive}, see below). The binding functions are
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  1020
  expected to return either a set of atoms (for \isacommand{bind (set)} and
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  1021
  \isacommand{bind (res)}) or a list of atoms (for \isacommand{bind}). They can
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1022
  be defined by recursion over the corresponding type; the equations
2156
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1023
  must be given in the binding function part of the scheme shown in
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1024
  \eqref{scheme}. For example a term-calculus containing @{text "Let"}s with
029f8aabed12 soem minor tuning
Christian Urban <urbanc@in.tum.de>
parents: 2141
diff changeset
  1025
  tuple patterns might be specified as:
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1026
  %
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1027
  \begin{equation}\label{letpat}
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  1028
  \mbox{\small%
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
  1029
  \begin{tabular}{l}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1030
  \isacommand{nominal\_datatype} @{text trm} $=$\\
1719
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1031
  \hspace{5mm}\phantom{$\mid$}~@{term "Var name"}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1032
  \hspace{5mm}$\mid$~@{term "App trm trm"}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1033
  \hspace{5mm}$\mid$~@{text "Lam x::name t::trm"} 
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1034
     \;\;\isacommand{bind} @{text x} \isacommand{in} @{text t}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1035
  \hspace{5mm}$\mid$~@{text "Let p::pat trm t::trm"} 
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1036
     \;\;\isacommand{bind} @{text "bn(p)"} \isacommand{in} @{text t}\\
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1037
  \isacommand{and} @{text pat} $=$
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1038
  @{text PNil}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1039
  $\mid$~@{text "PVar name"}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1040
  $\mid$~@{text "PTup pat pat"}\\ 
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1041
  \isacommand{binder}~@{text "bn::pat \<Rightarrow> atom list"}\\
1719
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1042
  \isacommand{where}~@{text "bn(PNil) = []"}\\
0c3c66f5c0e7 removed "raw" distinction
Christian Urban <urbanc@in.tum.de>
parents: 1717
diff changeset
  1043
  \hspace{5mm}$\mid$~@{text "bn(PVar x) = [atom x]"}\\
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1044
  \hspace{5mm}$\mid$~@{text "bn(PTup p\<^isub>1 p\<^isub>2) = bn(p\<^isub>1) @ bn(p\<^isub>2)"}\smallskip\\ 
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1045
  \end{tabular}}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1046
  \end{equation}
1617
99cee15cb5ff more tuning in the paper
Christian Urban <urbanc@in.tum.de>
parents: 1613
diff changeset
  1047
  
1619
373cd788d327 more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1617
diff changeset
  1048
  \noindent
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1049
  In this specification the function @{text "bn"} determines which atoms of
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1050
  the pattern @{text p} are bound in the argument @{text "t"}. Note that in the
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1051
  second-last @{text bn}-clause the function @{text "atom"} coerces a name
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1052
  into the generic atom type of Nominal Isabelle \cite{HuffmanUrban10}. This
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1053
  allows us to treat binders of different atom type uniformly.
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1054
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1055
  As said above, for deep binders we allow binding clauses such as
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1056
  %
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1057
  \begin{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1058
  \begin{tabular}{ll}
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1059
  @{text "Bar p::pat t::trm"} &  
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1060
     \isacommand{bind} @{text "bn(p)"} \isacommand{in} @{text "p t"}\\
1620
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1061
  \end{tabular}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1062
  \end{center}
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1063
17a2c6fddc0c tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1619
diff changeset
  1064
  \noindent
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1065
  where the argument of the deep binder also occurs in the body. We call such
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1066
  binders \emph{recursive}.  To see the purpose of such recursive binders,
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1067
  compare ``plain'' @{text "Let"}s and @{text "Let_rec"}s in the following
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1068
  specification:
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1069
  %
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1070
  \begin{equation}\label{letrecs}
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  1071
  \mbox{\small%
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1072
  \begin{tabular}{@ {}l@ {}}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1073
  \isacommand{nominal\_datatype}~@{text "trm ="}~\ldots\\
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1074
  \hspace{5mm}$\mid$~@{text "Let as::assn t::trm"} 
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1075
     \;\;\isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text t}\\
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1076
  \hspace{5mm}$\mid$~@{text "Let_rec as::assn t::trm"}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1077
     \;\;\isacommand{bind} @{text "bn(as)"} \isacommand{in} @{text "as t"}\\
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1078
  \isacommand{and} @{text "assn"} $=$
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1079
  @{text "ANil"}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1080
  $\mid$~@{text "ACons name trm assn"}\\
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1081
  \isacommand{binder} @{text "bn::assn \<Rightarrow> atom list"}\\
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1082
  \isacommand{where}~@{text "bn(ANil) = []"}\\
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1083
  \hspace{5mm}$\mid$~@{text "bn(ACons a t as) = [atom a] @ bn(as)"}\\
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1084
  \end{tabular}}
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1085
  \end{equation}
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1086
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1087
  \noindent
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
  1088
  The difference is that with @{text Let} we only want to bind the atoms @{text
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
  1089
  "bn(as)"} in the term @{text t}, but with @{text "Let_rec"} we also want to bind the atoms
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1090
  inside the assignment. This difference has consequences for the associated
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1091
  notions of free-atoms and $\alpha$-equivalence.
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1092
  
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1093
  To make sure that atoms bound by deep binders cannot be free at the
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1094
  same time, we cannot have more than one binding function for a deep binder. 
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1095
  Consequently we exclude specifications such as
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1096
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1097
  \begin{center}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1098
  \begin{tabular}{@ {}l@ {\hspace{2mm}}l@ {}}
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1099
  @{text "Baz\<^isub>1 p::pat t::trm"} & 
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1100
     \isacommand{bind} @{text "bn\<^isub>1(p) bn\<^isub>2(p)"} \isacommand{in} @{text t}\\
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1101
  @{text "Baz\<^isub>2 p::pat t\<^isub>1::trm t\<^isub>2::trm"} & 
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1102
     \isacommand{bind} @{text "bn\<^isub>1(p)"} \isacommand{in} @{text "t\<^isub>1"},
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1103
     \isacommand{bind} @{text "bn\<^isub>2(p)"} \isacommand{in} @{text "t\<^isub>2"}\\
2140
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1104
  \end{tabular}
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1105
  \end{center}
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1106
8beda0b4e35a tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 2139
diff changeset
  1107
  \noindent
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1108
  Otherwise it is possible that @{text "bn\<^isub>1"} and @{text "bn\<^isub>2"}  pick 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1109
  out different atoms to become bound, respectively be free, in @{text "p"}.
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1110
  (Since the Ott-tool does not derive a reasoning infrastructure for 
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1111
  $\alpha$-equated terms, it can permit such specifications.)
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1112
  
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1113
  We also need to restrict the form of the binding functions in order 
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1114
  to ensure the @{text "bn"}-functions can be defined for $\alpha$-equated 
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1115
  terms. The main restriction is that we cannot return an atom in a binding function that is also
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1116
  bound in the corresponding term-constructor. That means in \eqref{letpat} 
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1117
  that the term-constructors @{text PVar} and @{text PTup} may
1961
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1118
  not have a binding clause (all arguments are used to define @{text "bn"}).
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1119
  In contrast, in case of \eqref{letrecs} the term-constructor @{text ACons}
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1120
  may have a binding clause involving the argument @{text t} (the only one that
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1121
  is \emph{not} used in the definition of the binding function). This restriction
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1122
  is sufficient for lifting the binding function to $\alpha$-equated terms.
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1123
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1124
  In the version of
1961
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1125
  Nominal Isabelle described here, we also adopted the restriction from the
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1126
  Ott-tool that binding functions can only return: the empty set or empty list
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1127
  (as in case @{text PNil}), a singleton set or singleton list containing an
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1128
  atom (case @{text PVar}), or unions of atom sets or appended atom lists
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1129
  (case @{text PTup}). This restriction will simplify some automatic definitions and proofs
1961
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1130
  later on.
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1131
  
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1132
  In order to simplify our definitions of free atoms and $\alpha$-equivalence, 
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1133
  we shall assume specifications 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1134
  of term-calculi are implicitly \emph{completed}. By this we mean that  
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1135
  for every argument of a term-constructor that is \emph{not} 
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  1136
  already part of a binding clause given by the user, we add implicitly a special \emph{empty} binding
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  1137
  clause, written \isacommand{bind}~@{term "{}"}~\isacommand{in}~@{text "labels"}. In case
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1138
  of the lambda-terms, the completion produces
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1139
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  1140
  \begin{center}\small
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1141
  \begin{tabular}{@ {}l@ {\hspace{-1mm}}}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1142
  \isacommand{nominal\_datatype} @{text lam} =\\
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1143
  \hspace{5mm}\phantom{$\mid$}~@{text "Var x::name"}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1144
    \;\;\isacommand{bind}~@{term "{}"}~\isacommand{in}~@{text "x"}\\
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1145
  \hspace{5mm}$\mid$~@{text "App t\<^isub>1::lam t\<^isub>2::lam"}
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  1146
    \;\;\isacommand{bind}~@{term "{}"}~\isacommand{in}~@{text "t\<^isub>1 t\<^isub>2"}\\
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1147
  \hspace{5mm}$\mid$~@{text "Lam x::name t::lam"}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1148
    \;\;\isacommand{bind}~@{text x} \isacommand{in} @{text t}\\
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1149
  \end{tabular}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1150
  \end{center}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1151
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1152
  \noindent 
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1153
  The point of completion is that we can make definitions over the binding
1961
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1154
  clauses and be sure to have captured all arguments of a term constructor. 
2342
f296ef291ca9 spell check
Christian Urban <urbanc@in.tum.de>
parents: 2341
diff changeset
  1155
*}
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1156
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1157
section {* Alpha-Equivalence and Free Atoms\label{sec:alpha} *}
2342
f296ef291ca9 spell check
Christian Urban <urbanc@in.tum.de>
parents: 2341
diff changeset
  1158
f296ef291ca9 spell check
Christian Urban <urbanc@in.tum.de>
parents: 2341
diff changeset
  1159
text {*
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1160
  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
  1161
  specifications into actual type definitions in Isabelle/HOL and then
1926
e42bd9d95f09 some small changes
Christian Urban <urbanc@in.tum.de>
parents: 1890
diff changeset
  1162
  establish a reasoning infrastructure for them. As
1956
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
  1163
  Pottier and Cheney pointed out \cite{Pottier06,Cheney05}, just 
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1164
  re-arranging the arguments of
1956
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
  1165
  term-constructors so that binders and their bodies are next to each other will 
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1166
  result in inadequate representations in cases like @{text "Let x\<^isub>1 = t\<^isub>1\<dots>x\<^isub>n = t\<^isub>n in s"}. 
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1167
  Therefore we will first
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1168
  extract ``raw'' datatype definitions from the specification and then define 
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1169
  explicitly an $\alpha$-equivalence relation over them. We subsequently
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1170
  quotient the datatypes according to our $\alpha$-equivalence.
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1171
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1172
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1173
  The ``raw'' datatype definition can be obtained by stripping off the 
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1174
  binding clauses and the labels from the types. We also have to invent
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1175
  new names for the types @{text "ty\<^sup>\<alpha>"} and term-constructors @{text "C\<^sup>\<alpha>"}
1756
79569dd3479b Minor formula fixes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1755
diff changeset
  1176
  given by the user. In our implementation we just use the affix ``@{text "_raw"}''.
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1177
  But for the purpose of this paper, we use the superscript @{text "_\<^sup>\<alpha>"} to indicate 
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1178
  that a notion is given for $\alpha$-equivalence classes and leave it out 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1179
  for the corresponding notion given on the ``raw'' level. So for example 
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  1180
  we have @{text "ty\<^sup>\<alpha> \<mapsto> ty"} and @{text "C\<^sup>\<alpha> \<mapsto> C"}
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
  1181
  where @{term ty} is the type used in the quotient construction for 
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
  1182
  @{text "ty\<^sup>\<alpha>"} and @{text "C"} is the term-constructor on the ``raw'' type @{text "ty"}. 
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
  1183
1637
a5501c9fad9b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1636
diff changeset
  1184
  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
  1185
  non-empty and the types in the constructors only occur in positive 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1186
  position (see \cite{Berghofer99} for an in-depth description of the datatype package
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1187
  in Isabelle/HOL). We subsequently define each of the user-specified binding 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1188
  functions @{term "bn"}$_{1..m}$ by recursion over the corresponding 
1730
cfd3a7368543 polished and removed tys from bn-functions.
Christian Urban <urbanc@in.tum.de>
parents: 1728
diff changeset
  1189
  raw datatype. We can also easily define permutation operations by 
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1190
  recursion so that for each term constructor @{text "C"} we have that
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1191
  %
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1192
  \begin{equation}\label{ceqvt}
1961
Christian Urban <urbanc@in.tum.de>
parents: 1957
diff changeset
  1193
  @{text "p \<bullet> (C z\<^isub>1 \<dots> z\<^isub>n) = C (p \<bullet> z\<^isub>1) \<dots> (p \<bullet> z\<^isub>n)"}
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1194
  \end{equation}
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1195
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1196
  The first non-trivial step we have to perform is the generation of
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1197
  free-atom functions from the specification. For the 
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1198
  \emph{raw} types @{text "ty"}$_{1..n}$ we define the free-atom functions
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1199
  %
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1200
  %\begin{equation}\label{fvars}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1201
  @{text "fa_ty\<^isub>"}$_{1..n}$
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1202
  %\end{equation}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1203
  %
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1204
  %\noindent
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1205
  by recursion.
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1206
  We define these functions together with auxiliary free-atom functions for
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1207
  the binding functions. Given raw binding functions @{text "bn"}$_{1..m}$ 
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1208
  we define
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1209
  %
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1210
  %\begin{center}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1211
  @{text "fa_bn\<^isub>"}$_{1..m}$.
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1212
  %\end{center}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1213
  %
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1214
  %\noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1215
  The reason for this setup is that in a deep binder not all atoms have to be
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1216
  bound, as we saw in the example with ``plain'' @{text Let}s. We need therefore a function
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1217
  that calculates those free atoms in a deep binder.
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1218
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1219
  While the idea behind these free-atom functions is clear (they just
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1220
  collect all atoms that are not bound), because of our rather complicated
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1221
  binding mechanisms their definitions are somewhat involved.  Given
2346
4c5881455923 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2345
diff changeset
  1222
  a term-constructor @{text "C"} of type @{text ty} and some associated
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1223
  binding clauses @{text "bc\<^isub>1\<dots>bc\<^isub>k"}, the result of @{text
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1224
  "fa_ty (C z\<^isub>1 \<dots> z\<^isub>n)"} will be the union @{text
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1225
  "fa(bc\<^isub>1) \<union> \<dots> \<union> fa(bc\<^isub>k)"} where we will define below what @{text "fa"} for a binding
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  1226
  clause means. We only show the details for the mode \isacommand{bind (set)} (the other modes are similar). 
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1227
  Suppose the binding clause @{text bc\<^isub>i} is of the form 
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1228
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1229
  %\begin{center}
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  1230
  \mbox{\isacommand{bind (set)} @{text "b\<^isub>1\<dots>b\<^isub>p"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1231
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1232
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1233
  %\noindent
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1234
  in which the body-labels @{text "d"}$_{1..q}$ refer to types @{text ty}$_{1..q}$,
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1235
  and the binders @{text b}$_{1..p}$
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1236
  either refer to labels of atom types (in case of shallow binders) or to binding 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1237
  functions taking a single label as argument (in case of deep binders). Assuming 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1238
  @{text "D"} stands for the set of free atoms of the bodies, @{text B} for the 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1239
  set of binding atoms in the binders and @{text "B'"} for the set of free atoms in 
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1240
  non-recursive deep binders,
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1241
  then the free atoms of the binding clause @{text bc\<^isub>i} are
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1242
  %
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1243
  \begin{equation}\label{fadef}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1244
  \mbox{@{text "fa(bc\<^isub>i) \<equiv> (D - B) \<union> B'"}}.
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1245
  \end{equation}
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1246
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1247
  \noindent
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1248
  The set @{text D} is formally defined as
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1249
  %
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1250
  \begin{center}
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1251
  @{text "D \<equiv> fa_ty\<^isub>1 d\<^isub>1 \<union> ... \<union> fa_ty\<^isub>q d\<^isub>q"}
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1252
  \end{center} 
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1253
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  1254
  \noindent
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1255
  where in case @{text "d\<^isub>i"} refers to one of the raw types @{text "ty"}$_{1..n}$ from the 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1256
  specification, the function @{text "fa_ty\<^isub>i"} is the corresponding free-atom function 
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1257
  we are defining by recursion; 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1258
  %(see \eqref{fvars}); 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1259
  otherwise we set @{text "fa_ty\<^isub>i d\<^isub>i = supp d\<^isub>i"}.
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1260
  
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1261
  In order to formally define the set @{text B} we use the following auxiliary @{text "bn"}-functions
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1262
  for atom types to which shallow binders may refer
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1263
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1264
  %\begin{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1265
  %\begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1266
  %@{text "bn_atom a"} & @{text "\<equiv>"} & @{text "{atom a}"}\\
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1267
  %@{text "bn_atom_set as"} & @{text "\<equiv>"} & @{text "atoms as"}\\
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1268
  %@{text "bn_atom_list as"} & @{text "\<equiv>"} & @{text "atoms (set as)"}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1269
  %\end{tabular}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1270
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1271
  %
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1272
  \begin{center}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1273
  @{text "bn_atom a \<equiv> {atom a}"}\hspace{17mm}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1274
  @{text "bn_atom_set as \<equiv> atoms as"}\\
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1275
  @{text "bn_atom_list as \<equiv> atoms (set as)"}
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1276
  \end{center}
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1277
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1278
  \noindent 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1279
  Like the function @{text atom}, the function @{text "atoms"} coerces 
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1280
  a set of atoms to a set of the generic atom type. 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1281
  %It is defined as  @{text "atoms as \<equiv> {atom a | a \<in> as}"}. 
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1282
  The set @{text B} is then formally defined as
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1283
  %
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1284
  \begin{center}
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1285
  @{text "B \<equiv> bn_ty\<^isub>1 b\<^isub>1 \<union> ... \<union> bn_ty\<^isub>p b\<^isub>p"}
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1286
  \end{center} 
1954
23480003f9c5 some changes to the paper
Christian Urban <urbanc@in.tum.de>
parents: 1926
diff changeset
  1287
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1288
  \noindent 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1289
  where we use the auxiliary binding functions for shallow binders. 
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1290
  The set @{text "B'"} collects all free atoms in non-recursive deep
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1291
  binders. Let us assume these binders in @{text "bc\<^isub>i"} are
1956
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
  1292
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1293
  %\begin{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1294
  \mbox{@{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1295
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1296
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1297
  %\noindent
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1298
  with @{text "l"}$_{1..r}$ $\subseteq$ @{text "b"}$_{1..p}$ and none of the 
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1299
  @{text "l"}$_{1..r}$ being among the bodies @{text
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1300
  "d"}$_{1..q}$. The set @{text "B'"} is defined as
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1301
  %
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1302
  \begin{center}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1303
  @{text "B' \<equiv> fa_bn\<^isub>1 l\<^isub>1 \<union> ... \<union> fa_bn\<^isub>r l\<^isub>r"}
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1304
  \end{center} 
1628
ddf409b2da2b more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1620
diff changeset
  1305
1636
d5b223b9c2bb more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1629
diff changeset
  1306
  \noindent
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1307
  This completes the definition of the free-atom functions @{text "fa_ty"}$_{1..n}$.
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1308
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1309
  Note that for non-recursive deep binders, we have to add in \eqref{fadef}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1310
  the set of atoms that are left unbound by the binding functions @{text
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1311
  "bn"}$_{1..m}$. We used for the definition of
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1312
  this set the functions @{text "fa_bn"}$_{1..m}$, which are also defined by mutual
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1313
  recursion. Assume the user specified a @{text bn}-clause of the form
1956
028705c98304 more polishing on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1954
diff changeset
  1314
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1315
  %\begin{center}
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1316
  @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1317
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1318
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1319
  %\noindent
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1320
  where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$. For each of
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1321
  the arguments we calculate the free atoms as follows:
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1322
  %
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1323
  \begin{center}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1324
  \begin{tabular}{c@ {\hspace{2mm}}p{0.9\textwidth}}
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1325
  $\bullet$ & @{term "fa_ty\<^isub>i z\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text "rhs"} 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1326
  (that means nothing is bound in @{text "z\<^isub>i"} by the binding function),\\
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1327
  $\bullet$ & @{term "fa_bn\<^isub>i z\<^isub>i"} provided @{text "z\<^isub>i"} occurs in  @{text "rhs"}
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1328
  with the recursive call @{text "bn\<^isub>i z\<^isub>i"}, and\\
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1329
  $\bullet$ & @{term "{}"} provided @{text "z\<^isub>i"} occurs in  @{text "rhs"},
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1330
  but without a recursive call.
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1331
  \end{tabular}
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1332
  \end{center}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1333
  %
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1334
  \noindent
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1335
  For defining @{text "fa_bn (C z\<^isub>1 \<dots> z\<^isub>n)"} we just union up all these sets.
2344
e90f6a26d74b finished fv-section
Christian Urban <urbanc@in.tum.de>
parents: 2343
diff changeset
  1336
 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1337
  To see how these definitions work in practice, let us reconsider the
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1338
  term-constructors @{text "Let"} and @{text "Let_rec"} shown in
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1339
  \eqref{letrecs} together with the term-constructors for assignments @{text
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1340
  "ANil"} and @{text "ACons"}. Since there is a binding function defined for
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1341
  assignments, we have three free-atom functions, namely @{text
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1342
  "fa\<^bsub>trm\<^esub>"}, @{text "fa\<^bsub>assn\<^esub>"} and @{text
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1343
  "fa\<^bsub>bn\<^esub>"} as follows:
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1344
  %
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1345
  \begin{center}\small
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1346
  \begin{tabular}{@ {}l@ {\hspace{1mm}}c@ {\hspace{1mm}}l@ {}}
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1347
  @{text "fa\<^bsub>trm\<^esub> (Let as t)"} & @{text "="} & @{text "(fa\<^bsub>trm\<^esub> t - set (bn as)) \<union> fa\<^bsub>bn\<^esub> as"}\\
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1348
  @{text "fa\<^bsub>trm\<^esub> (Let_rec as t)"} & @{text "="} & @{text "(fa\<^bsub>assn\<^esub> as \<union> fa\<^bsub>trm\<^esub> t) - set (bn as)"}\\[1mm]
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1349
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1350
  @{text "fa\<^bsub>assn\<^esub> (ANil)"} & @{text "="} & @{term "{}"}\\
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1351
  @{text "fa\<^bsub>assn\<^esub> (ACons a t as)"} & @{text "="} & @{text "(supp a) \<union> (fa\<^bsub>trm\<^esub> t) \<union> (fa\<^bsub>assn\<^esub> as)"}\\[1mm]
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1352
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1353
  @{text "fa\<^bsub>bn\<^esub> (ANil)"} & @{text "="} & @{term "{}"}\\
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1354
  @{text "fa\<^bsub>bn\<^esub> (ACons a t as)"} & @{text "="} & @{text "(fa\<^bsub>trm\<^esub> t) \<union> (fa\<^bsub>bn\<^esub> as)"}
1725
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1355
  \end{tabular}
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1356
  \end{center}
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1357
1801cc460fc9 polished and added an example for fvars
Christian Urban <urbanc@in.tum.de>
parents: 1724
diff changeset
  1358
  \noindent
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1359
  Recall that @{text ANil} and @{text "ACons"} have no
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1360
  binding clause in the specification. The corresponding free-atom
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1361
  function @{text "fa\<^bsub>assn\<^esub>"} therefore returns all free atoms
2360
99134763d03e a bit more to the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
  1362
  occurring in an assignment (in case of @{text "ACons"}, they are given in
99134763d03e a bit more to the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
  1363
  terms of @{text supp}, @{text "fa\<^bsub>trm\<^esub>"} and @{text "fa\<^bsub>assn\<^esub>"}). 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1364
  The binding only takes place in @{text Let} and
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1365
  @{text "Let_rec"}. In case of @{text "Let"}, the binding clause specifies
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1366
  that all atoms given by @{text "set (bn as)"} have to be bound in @{text
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1367
  t}. Therefore we have to subtract @{text "set (bn as)"} from @{text
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1368
  "fa\<^bsub>trm\<^esub> t"}. However, we also need to add all atoms that are
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1369
  free in @{text "as"}. This is
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1370
  in contrast with @{text "Let_rec"} where we have a recursive
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1371
  binder to bind all occurrences of the atoms in @{text
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1372
  "set (bn as)"} also inside @{text "as"}. Therefore we have to subtract
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1373
  @{text "set (bn as)"} from both @{text "fa\<^bsub>trm\<^esub> t"} and @{text "fa\<^bsub>assn\<^esub> as"}. 
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1374
  %Like the function @{text "bn"}, the function @{text "fa\<^bsub>bn\<^esub>"} traverses the 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1375
  %list of assignments, but instead returns the free atoms, which means in this 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1376
  %example the free atoms in the argument @{text "t"}.  
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1377
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1378
  An interesting point in this
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1379
  example is that a ``naked'' assignment (@{text "ANil"} or @{text "ACons"}) does not bind any
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1380
  atoms, even if the binding function is specified over assignments. 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1381
  Only in the context of a @{text Let} or @{text "Let_rec"}, where the binding clauses are given, will
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1382
  some atoms actually become bound.  This is a phenomenon that has also been pointed
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1383
  out in \cite{ott-jfp}. For us this observation is crucial, because we would 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1384
  not be able to lift the @{text "bn"}-functions to $\alpha$-equated terms if they act on 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1385
  atoms that are bound. In that case, these functions would \emph{not} respect
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1386
  $\alpha$-equivalence.
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1387
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1388
  Next we define the $\alpha$-equivalence relations for the raw types @{text
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1389
  "ty"}$_{1..n}$ from the specification. We write them as
1733
6988077666dc abbreviations for \<otimes> and \<oplus>
Christian Urban <urbanc@in.tum.de>
parents: 1732
diff changeset
  1390
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1391
  %\begin{center}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1392
  @{text "\<approx>ty"}$_{1..n}$.
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1393
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1394
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1395
  %\noindent
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1396
  Like with the free-atom functions, we also need to
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1397
  define auxiliary $\alpha$-equivalence relations 
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1398
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1399
  %\begin{center}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1400
  @{text "\<approx>bn\<^isub>"}$_{1..m}$
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1401
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1402
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1403
  %\noindent
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1404
  for the binding functions @{text "bn"}$_{1..m}$, 
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1405
  To simplify our definitions we will use the following abbreviations for
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1406
  \emph{compound equivalence relations} and \emph{compound free-atom functions} acting on tuples
1733
6988077666dc abbreviations for \<otimes> and \<oplus>
Christian Urban <urbanc@in.tum.de>
parents: 1732
diff changeset
  1407
  %
6988077666dc abbreviations for \<otimes> and \<oplus>
Christian Urban <urbanc@in.tum.de>
parents: 1732
diff changeset
  1408
  \begin{center}
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
  1409
  \begin{tabular}{r@ {\hspace{2mm}}c@ {\hspace{2mm}}l}
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1410
  @{text "(x\<^isub>1,\<dots>, x\<^isub>n) (R\<^isub>1,\<dots>, R\<^isub>n) (x\<PRIME>\<^isub>1,\<dots>, x\<PRIME>\<^isub>n)"} & @{text "\<equiv>"} &
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1411
  @{text "x\<^isub>1 R\<^isub>1 x\<PRIME>\<^isub>1 \<and> \<dots> \<and> x\<^isub>n R\<^isub>n x\<PRIME>\<^isub>n"}\\
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1412
  @{text "(fa\<^isub>1,\<dots>, fa\<^isub>n) (x\<^isub>1,\<dots>, x\<^isub>n)"} & @{text "\<equiv>"} & @{text "fa\<^isub>1 x\<^isub>1 \<union> \<dots> \<union> fa\<^isub>n x\<^isub>n"}\\
1733
6988077666dc abbreviations for \<otimes> and \<oplus>
Christian Urban <urbanc@in.tum.de>
parents: 1732
diff changeset
  1413
  \end{tabular}
6988077666dc abbreviations for \<otimes> and \<oplus>
Christian Urban <urbanc@in.tum.de>
parents: 1732
diff changeset
  1414
  \end{center}
6988077666dc abbreviations for \<otimes> and \<oplus>
Christian Urban <urbanc@in.tum.de>
parents: 1732
diff changeset
  1415
1727
fd2913415a73 started to polish alpha-equivalence section, but needs more work
Christian Urban <urbanc@in.tum.de>
parents: 1726
diff changeset
  1416
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1417
  The $\alpha$-equivalence relations are defined as inductive predicates
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1418
  having a single clause for each term-constructor. Assuming a
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1419
  term-constructor @{text C} is of type @{text ty} and has the binding clauses
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1420
  @{term "bc"}$_{1..k}$, then the $\alpha$-equivalence clause has the form
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
  1421
  %
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
  1422
  \begin{center}
2345
a908ea36054f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2344
diff changeset
  1423
  \mbox{\infer{@{text "C z\<^isub>1 \<dots> z\<^isub>n  \<approx>ty  C z\<PRIME>\<^isub>1 \<dots> z\<PRIME>\<^isub>n"}}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1424
  {@{text "prems(bc\<^isub>1) \<dots> prems(bc\<^isub>k)"}}} 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1425
  \end{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1426
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1427
  \noindent
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1428
  The task below is to specify what the premises of a binding clause are. As a
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1429
  special instance, we first treat the case where @{text "bc\<^isub>i"} is the
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1430
  empty binding clause of the form
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1431
  %
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1432
  \begin{center}
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  1433
  \mbox{\isacommand{bind (set)} @{term "{}"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}.}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1434
  \end{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1435
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1436
  \noindent
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1437
  In this binding clause no atom is bound and we only have to $\alpha$-relate the bodies. For this
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1438
  we build first the tuples @{text "D \<equiv> (d\<^isub>1,\<dots>, d\<^isub>q)"} and @{text "D' \<equiv> (d\<PRIME>\<^isub>1,\<dots>, d\<PRIME>\<^isub>q)"}  
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1439
  whereby the labels @{text "d"}$_{1..q}$ refer to arguments @{text "z"}$_{1..n}$ and
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1440
  respectively @{text "d\<PRIME>"}$_{1..q}$ to @{text "z\<PRIME>"}$_{1..n}$. In order to relate
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1441
  two such tuples we define the compound $\alpha$-equivalence relation @{text "R"} as follows
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1442
  %
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1443
  \begin{equation}\label{rempty}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1444
  \mbox{@{text "R \<equiv> (R\<^isub>1,\<dots>, R\<^isub>q)"}}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1445
  \end{equation}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1446
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1447
  \noindent
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1448
  with @{text "R\<^isub>i"} being @{text "\<approx>ty\<^isub>i"} if the corresponding labels @{text "d\<^isub>i"} and 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1449
  @{text "d\<PRIME>\<^isub>i"} refer
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1450
  to a recursive argument of @{text C} with type @{text "ty\<^isub>i"}; otherwise
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1451
  we take @{text "R\<^isub>i"} to be the equality @{text "="}. This lets us define
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1452
  the premise for an empty binding clause succinctly as @{text "prems(bc\<^isub>i) \<equiv> D R D'"},
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1453
  which can be unfolded to the series of premises
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1454
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1455
  %\begin{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1456
  @{text "d\<^isub>1 R\<^isub>1 d\<PRIME>\<^isub>1  \<dots> d\<^isub>q R\<^isub>q d\<PRIME>\<^isub>q"}.
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1457
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1458
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1459
  %\noindent
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1460
  We will use the unfolded version in the examples below.
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1461
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1462
  Now suppose the binding clause @{text "bc\<^isub>i"} is of the general form 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1463
  %
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1464
  \begin{equation}\label{nonempty}
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  1465
  \mbox{\isacommand{bind (set)} @{text "b\<^isub>1\<dots>b\<^isub>p"} \isacommand{in} @{text "d\<^isub>1\<dots>d\<^isub>q"}.}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1466
  \end{equation}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1467
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1468
  \noindent
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1469
  In this case we define a premise @{text P} using the relation
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1470
  $\approx_{\,\textit{set}}$ given in Section~\ref{sec:binders} (similarly
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1471
  $\approx_{\,\textit{res}}$ and $\approx_{\,\textit{list}}$ for the other
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1472
  binding modes). This premise defines $\alpha$-equivalence of two abstractions
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1473
  involving multiple binders. As above, we first build the tuples @{text "D"} and
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1474
  @{text "D'"} for the bodies @{text "d"}$_{1..q}$, and the corresponding
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1475
  compound $\alpha$-relation @{text "R"} (shown in \eqref{rempty}). 
2381
fd85f4921654 samll changes
Christian Urban <urbanc@in.tum.de>
parents: 2364
diff changeset
  1476
  For $\approx_{\,\textit{set}}$  we also need
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1477
  a compound free-atom function for the bodies defined as
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1478
  %
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1479
  \begin{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1480
  \mbox{@{text "fa \<equiv> (fa_ty\<^isub>1,\<dots>, fa_ty\<^isub>q)"}}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1481
  \end{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1482
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1483
  \noindent
2381
fd85f4921654 samll changes
Christian Urban <urbanc@in.tum.de>
parents: 2364
diff changeset
  1484
  with the assumption that the @{text "d"}$_{1..q}$ refer to arguments of types @{text "ty"}$_{1..q}$.
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1485
  The last ingredient we need are the sets of atoms bound in the bodies.
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1486
  For this we take
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1487
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1488
  \begin{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1489
  @{text "B \<equiv> bn_ty\<^isub>1 b\<^isub>1 \<union> \<dots> \<union> bn_ty\<^isub>p b\<^isub>p"}\;.\\
1737
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
  1490
  \end{center}
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
  1491
8b6a285ad480 polished everything up to TODO
Christian Urban <urbanc@in.tum.de>
parents: 1736
diff changeset
  1492
  \noindent
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1493
  Similarly for @{text "B'"} using the labels @{text "b\<PRIME>"}$_{1..p}$. This 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1494
  lets us formally define the premise @{text P} for a non-empty binding clause as:
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1495
  %
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1496
  \begin{center}
2471
894599a50af3 got rid of Nominal2_Supp (is now in Nomina2_Base)
Christian Urban <urbanc@in.tum.de>
parents: 2465
diff changeset
  1497
  \mbox{@{term "P \<equiv> \<exists>p. (B, D) \<approx>set R fa p (B', D')"}}\;.
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1498
  \end{center}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1499
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1500
  \noindent
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1501
  This premise accounts for $\alpha$-equivalence of the bodies of the binding
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1502
  clause. 
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1503
  However, in case the binders have non-recursive deep binders, this premise
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1504
  is not enough:
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1505
  we also have to ``propagate'' $\alpha$-equivalence inside the structure of
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1506
  these binders. An example is @{text "Let"} where we have to make sure the
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1507
  right-hand sides of assignments are $\alpha$-equivalent. For this we use 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1508
  relations @{text "\<approx>bn"}$_{1..m}$ (which we will formally define shortly).
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1509
  Let us assume the non-recursive deep binders in @{text "bc\<^isub>i"} are
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1510
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1511
  %\begin{center}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1512
  @{text "bn\<^isub>1 l\<^isub>1, \<dots>, bn\<^isub>r l\<^isub>r"}.
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1513
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1514
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1515
  %\noindent
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1516
  The tuple @{text L} is then @{text "(l\<^isub>1,\<dots>,l\<^isub>r)"} (similarly @{text "L'"})
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1517
  and the compound equivalence relation @{text "R'"} is @{text "(\<approx>bn\<^isub>1,\<dots>,\<approx>bn\<^isub>r)"}. 
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1518
  All premises for @{text "bc\<^isub>i"} are then given by
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1519
  %
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1520
  \begin{center}
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1521
  @{text "prems(bc\<^isub>i) \<equiv> P  \<and>   L R' L'"}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1522
  \end{center} 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1523
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1524
  \noindent 
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1525
  The auxiliary $\alpha$-equivalence relations @{text "\<approx>bn"}$_{1..m}$ 
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1526
  in @{text "R'"} are defined as follows: assuming a @{text bn}-clause is of the form
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1527
  %
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1528
  %\begin{center}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1529
  @{text "bn (C z\<^isub>1 \<dots> z\<^isub>s) = rhs"}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1530
  %\end{center}
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1531
  %
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1532
  %\noindent
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1533
  where the @{text "z"}$_{1..s}$ are of types @{text "ty"}$_{1..s}$,
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1534
  then the corresponding $\alpha$-equivalence clause for @{text "\<approx>bn"} has the form
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1535
  %
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1536
  \begin{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1537
  \mbox{\infer{@{text "C z\<^isub>1 \<dots> z\<^isub>s \<approx>bn C z\<PRIME>\<^isub>1 \<dots> z\<PRIME>\<^isub>s"}}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1538
  {@{text "z\<^isub>1 R\<^isub>1 z\<PRIME>\<^isub>1 \<dots> z\<^isub>s R\<^isub>s z\<PRIME>\<^isub>s"}}}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1539
  \end{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1540
  
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1541
  \noindent
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1542
  In this clause the relations @{text "R"}$_{1..s}$ are given by 
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1543
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1544
  \begin{center}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1545
  \begin{tabular}{c@ {\hspace{2mm}}p{0.9\textwidth}}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1546
  $\bullet$ & @{text "z\<^isub>i \<approx>ty z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs} and 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1547
  is a recursive argument of @{text C},\\
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1548
  $\bullet$ & @{text "z\<^isub>i = z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} does not occur in @{text rhs}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1549
  and is a non-recursive argument of @{text C},\\
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1550
  $\bullet$ & @{text "z\<^isub>i \<approx>bn\<^isub>i z\<PRIME>\<^isub>i"} provided @{text "z\<^isub>i"} occurs in @{text rhs}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1551
  with the recursive call @{text "bn\<^isub>i x\<^isub>i"} and\\
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1552
  $\bullet$ & @{text True} provided @{text "z\<^isub>i"} occurs in @{text rhs} but without a
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1553
  recursive call.
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1554
  \end{tabular}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1555
  \end{center}
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1556
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1557
  \noindent
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1558
  This completes the definition of $\alpha$-equivalence. As a sanity check, we can show
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1559
  that the premises of empty binding clauses are a special case of the clauses for 
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1560
  non-empty ones (we just have to unfold the definition of $\approx_{\,\textit{set}}$ and take @{text "0"}
2349
eaf5209669de before examples
Christian Urban <urbanc@in.tum.de>
parents: 2348
diff changeset
  1561
  for the existentially quantified permutation).
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1562
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1563
  Again let us take a look at a concrete example for these definitions. For \eqref{letrecs}
2348
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1564
  we have three relations $\approx_{\textit{trm}}$, $\approx_{\textit{assn}}$ and
09b476c20fe1 finished alpha-section
Christian Urban <urbanc@in.tum.de>
parents: 2347
diff changeset
  1565
  $\approx_{\textit{bn}}$ with the following clauses:
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1566
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1567
  \begin{center}\small
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1568
  \begin{tabular}{@ {}c @ {}}
2350
Christian Urban <urbanc@in.tum.de>
parents: 2349
diff changeset
  1569
  \infer{@{text "Let as t \<approx>\<^bsub>trm\<^esub> Let as' t'"}}
Christian Urban <urbanc@in.tum.de>
parents: 2349
diff changeset
  1570
  {@{term "\<exists>p. (bn as, t) \<approx>lst alpha_trm fa_trm p (bn as', t')"} & @{text "as \<approx>\<^bsub>bn\<^esub> as'"}}\smallskip\\
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1571
  \makebox[0mm]{\infer{@{text "Let_rec as t \<approx>\<^bsub>trm\<^esub> Let_rec as' t'"}}
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1572
  {@{term "\<exists>p. (bn as, ast) \<approx>lst alpha_trm2 fa_trm2 p (bn as', ast')"}}}
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1573
  \end{tabular}
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1574
  \end{center}
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1575
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1576
  \begin{center}\small
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1577
  \begin{tabular}{@ {}c @ {}}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1578
  \infer{@{text "ANil \<approx>\<^bsub>assn\<^esub> ANil"}}{}\hspace{9mm}
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1579
  \infer{@{text "ACons a t as \<approx>\<^bsub>assn\<^esub> ACons a' t' as"}}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1580
  {@{text "a = a'"} & @{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>assn\<^esub> as'"}}
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1581
  \end{tabular}
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1582
  \end{center}
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1583
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1584
  \begin{center}\small
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1585
  \begin{tabular}{@ {}c @ {}}
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1586
  \infer{@{text "ANil \<approx>\<^bsub>bn\<^esub> ANil"}}{}\hspace{9mm}
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1587
  \infer{@{text "ACons a t as \<approx>\<^bsub>bn\<^esub> ACons a' t' as"}}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1588
  {@{text "t \<approx>\<^bsub>trm\<^esub> t'"} & @{text "as \<approx>\<^bsub>bn\<^esub> as'"}}
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1589
  \end{tabular}
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1590
  \end{center}
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1591
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1592
  \noindent
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1593
  Note the difference between  $\approx_{\textit{assn}}$ and
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1594
  $\approx_{\textit{bn}}$: the latter only ``tracks'' $\alpha$-equivalence of 
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1595
  the components in an assignment that are \emph{not} bound. This is needed in the 
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1596
  in the clause for @{text "Let"} (which is has
2510
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1597
  a non-recursive binder). 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1598
  %The underlying reason is that the terms inside an assignment are not meant 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1599
  %to be ``under'' the binder. Such a premise is \emph{not} needed in @{text "Let_rec"}, 
734341a79028 down to 24 pages and a bit
Christian Urban <urbanc@in.tum.de>
parents: 2509
diff changeset
  1600
  %because there all components of an assignment are ``under'' the binder. 
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1601
*}
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1602
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1603
section {* Establishing the Reasoning Infrastructure *}
1717
a3ef7fba983f Beginning of section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1716
diff changeset
  1604
a3ef7fba983f Beginning of section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1716
diff changeset
  1605
text {*
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1606
  Having made all necessary definitions for raw terms, we can start
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1607
  with establishing the reasoning infrastructure for the $\alpha$-equated types
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1608
  @{text "ty\<AL>"}$_{1..n}$, that is the types the user originally specified. We sketch
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1609
  in this section the proofs we need for establishing this infrastructure. One
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1610
  main point of our work is that we have completely automated these proofs in Isabelle/HOL.
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1611
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1612
  First we establish that the
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1613
  $\alpha$-equivalence relations defined in the previous section are 
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1614
  equivalence relations.
1717
a3ef7fba983f Beginning of section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1716
diff changeset
  1615
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1616
  \begin{lemma}\label{equiv} 
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1617
  Given the raw types @{text "ty"}$_{1..n}$ and binding functions
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1618
  @{text "bn"}$_{1..m}$, the relations @{text "\<approx>ty"}$_{1..n}$ and 
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1619
  @{text "\<approx>bn"}$_{1..m}$ are equivalence relations.%% and equivariant.
1717
a3ef7fba983f Beginning of section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1716
diff changeset
  1620
  \end{lemma}
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1621
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1622
  \begin{proof} 
1752
9e09253c80cf added alpha_bn definition
Christian Urban <urbanc@in.tum.de>
parents: 1749
diff changeset
  1623
  The proof is by mutual induction over the definitions. The non-trivial
2176
5054f170024e edits from the reviewers
Christian Urban <urbanc@in.tum.de>
parents: 2175
diff changeset
  1624
  cases involve premises built up by $\approx_{\textit{set}}$, 
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1625
  $\approx_{\textit{res}}$ and $\approx_{\textit{list}}$. They 
1752
9e09253c80cf added alpha_bn definition
Christian Urban <urbanc@in.tum.de>
parents: 1749
diff changeset
  1626
  can be dealt with as in Lemma~\ref{alphaeq}.
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1627
  \end{proof}
1718
0d057e57e9a8 More on Section 5
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1717
diff changeset
  1628
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1629
  \noindent 
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1630
  We can feed this lemma into our quotient package and obtain new types @{text
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1631
  "ty"}$^\alpha_{1..n}$ representing $\alpha$-equated terms of types @{text "ty"}$_{1..n}$. 
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1632
  We also obtain definitions for the term-constructors @{text
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1633
  "C"}$^\alpha_{1..k}$ from the raw term-constructors @{text
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1634
  "C"}$_{1..k}$, and similar definitions for the free-atom functions @{text
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1635
  "fa_ty"}$^\alpha_{1..n}$ and @{text "fa_bn"}$^\alpha_{1..m}$ as well as the binding functions @{text
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1636
  "bn"}$^\alpha_{1..m}$. However, these definitions are not really useful to the 
1775
86122d793f32 typos in paper
Christian Urban <urbanc@in.tum.de>
parents: 1771
diff changeset
  1637
  user, since they are given in terms of the isomorphisms we obtained by 
1754
0ce4f938e8cc current state
Christian Urban <urbanc@in.tum.de>
parents: 1753
diff changeset
  1638
  creating new types in Isabelle/HOL (recall the picture shown in the 
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1639
  Introduction).
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  1640
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1641
  The first useful property for the user is the fact that distinct 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1642
  term-constructors are not 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1643
  equal, that is
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  1644
  %
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  1645
  \begin{equation}\label{distinctalpha}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1646
  \mbox{@{text "C"}$^\alpha$~@{text "x\<^isub>1 \<dots> x\<^isub>r"}~@{text "\<noteq>"}~% 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1647
  @{text "D"}$^\alpha$~@{text "y\<^isub>1 \<dots> y\<^isub>s"}} 
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  1648
  \end{equation}
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  1649
  
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  1650
  \noindent
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1651
  whenever @{text "C"}$^\alpha$~@{text "\<noteq>"}~@{text "D"}$^\alpha$.
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1652
  In order to derive this fact, we use the definition of $\alpha$-equivalence
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1653
  and establish that
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  1654
  %
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  1655
  \begin{equation}\label{distinctraw}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1656
  \mbox{@{text "C x\<^isub>1 \<dots> x\<^isub>r"}\;$\not\approx$@{text ty}\;@{text "D y\<^isub>1 \<dots> y\<^isub>s"}}
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  1657
  \end{equation}
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  1658
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  1659
  \noindent
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1660
  holds for the corresponding raw term-constructors.
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1661
  In order to deduce \eqref{distinctalpha} from \eqref{distinctraw}, our quotient
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1662
  package needs to know that the raw term-constructors @{text "C"} and @{text "D"} 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1663
  are \emph{respectful} w.r.t.~the $\alpha$-equivalence relations (see \cite{Homeier05}).
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1664
  Assuming, for example, @{text "C"} is of type @{text "ty"} with argument types
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1665
  @{text "ty"}$_{1..r}$, respectfulness amounts to showing that
2359
46f753eeb0b8 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2350
diff changeset
  1666
  %
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  1667
  \begin{center}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1668
  @{text "C x\<^isub>1 \<dots> x\<^isub>r \<approx>ty C x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  1669
  \end{center}  
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  1670
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  1671
  \noindent
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1672
  holds under the assumptions that we have \mbox{@{text
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1673
  "x\<^isub>i \<approx>ty\<^isub>i x\<PRIME>\<^isub>i"}} whenever @{text "x\<^isub>i"}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1674
  and @{text "x\<PRIME>\<^isub>i"} are recursive arguments of @{text C} and
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1675
  @{text "x\<^isub>i = x\<PRIME>\<^isub>i"} whenever they are non-recursive arguments. We can prove this
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1676
  implication by applying the corresponding rule in our $\alpha$-equivalence
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1677
  definition and by establishing the following auxiliary facts 
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1678
  %
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1679
  \begin{equation}\label{fnresp}
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1680
  \mbox{%
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1681
  \begin{tabular}{l}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1682
  @{text "x \<approx>ty\<^isub>i x\<PRIME>"}~~implies~@{text "fa_ty\<^isub>i x = fa_ty\<^isub>i x\<PRIME>"}\\
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1683
  @{text "x \<approx>ty\<^isub>j x\<PRIME>"}~~implies~@{text "fa_bn\<^isub>j x = fa_bn\<^isub>j x\<PRIME>"}\\
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1684
  @{text "x \<approx>ty\<^isub>j x\<PRIME>"}~~implies~@{text "bn\<^isub>j x = bn\<^isub>j x\<PRIME>"}\\
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1685
  @{text "x \<approx>ty\<^isub>j x\<PRIME>"}~~implies~@{text "x \<approx>bn\<^isub>j x\<PRIME>"}\\
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1686
  \end{tabular}}
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1687
  \end{equation}
1717
a3ef7fba983f Beginning of section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1716
diff changeset
  1688
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1689
  \noindent
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1690
  They can be established by induction on @{text "\<approx>ty"}$_{1..n}$. Whereas the first,
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1691
  second and last implication are true by how we stated our definitions, the 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1692
  third \emph{only} holds because of our restriction
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1693
  imposed on the form of the binding functions---namely \emph{not} returning 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1694
  any bound atoms. In Ott, in contrast, the user may 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1695
  define @{text "bn"}$_{1..m}$ so that they return bound
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1696
  atoms and in this case the third implication is \emph{not} true. A 
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1697
  result is that the lifing of the corresponding binding functions in Ott to $\alpha$-equated
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1698
  terms is impossible.
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1699
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1700
  Having established respectfulness for the raw term-constructors, the 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1701
  quotient package is able to automatically deduce \eqref{distinctalpha} from 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1702
  \eqref{distinctraw}. Having the facts \eqref{fnresp} at our disposal, we can 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1703
  also lift properties that characterise when two raw terms of the form
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1704
  %
1718
0d057e57e9a8 More on Section 5
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1717
diff changeset
  1705
  \begin{center}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1706
  @{text "C x\<^isub>1 \<dots> x\<^isub>r \<approx>ty C x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1707
  \end{center}
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1708
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1709
  \noindent
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1710
  are $\alpha$-equivalent. This gives us conditions when the corresponding
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1711
  $\alpha$-equated terms are \emph{equal}, namely
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1712
  %
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1713
  \begin{center}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1714
  @{text "C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r = C\<^sup>\<alpha> x\<PRIME>\<^isub>1 \<dots> x\<PRIME>\<^isub>r"}
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1715
  \end{center}
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1716
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1717
  \noindent
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1718
  We call these conditions as \emph{quasi-injectivity}. They correspond to
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1719
  the premises in our $\alpha$-equivalence relations.
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1720
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1721
  Next we can lift the permutation 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1722
  operations defined in \eqref{ceqvt}. In order to make this 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1723
  lifting to go through, we have to show that the permutation operations are respectful. 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1724
  This amounts to showing that the 
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1725
  $\alpha$-equivalence relations are equivariant \cite{HuffmanUrban10}.
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1726
  %, which we already established 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1727
  %in Lemma~\ref{equiv}. 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1728
  As a result we can add the equations
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1729
  %
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1730
  \begin{equation}\label{calphaeqvt}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1731
  @{text "p \<bullet> (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r) = C\<^sup>\<alpha> (p \<bullet> x\<^isub>1) \<dots> (p \<bullet> x\<^isub>r)"}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1732
  \end{equation}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1733
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1734
  \noindent
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1735
  to our infrastructure. In a similar fashion we can lift the defining equations
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1736
  of the free-atom functions @{text "fn_ty\<AL>"}$_{1..n}$ and
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1737
  @{text "fa_bn\<AL>"}$_{1..m}$ as well as of the binding functions @{text
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1738
  "bn\<AL>"}$_{1..m}$ and the size functions @{text "size_ty\<AL>"}$_{1..n}$.
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1739
  The latter are defined automatically for the raw types @{text "ty"}$_{1..n}$
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1740
  by the datatype package of Isabelle/HOL.
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1741
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1742
  Finally we can add to our infrastructure a cases lemma (explained in the next section)
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1743
  and a structural induction principle 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1744
  for the types @{text "ty\<AL>"}$_{i..n}$. The conclusion of the induction principle is
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1745
  of the form
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1746
  %
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1747
  \begin{equation}\label{weakinduct}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1748
  \mbox{@{text "P\<^isub>1 x\<^isub>1 \<and> \<dots> \<and> P\<^isub>n x\<^isub>n "}}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1749
  \end{equation} 
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1750
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1751
  \noindent
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1752
  whereby the @{text P}$_{1..n}$ are predicates and the @{text x}$_{1..n}$ 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1753
  have types @{text "ty\<AL>"}$_{1..n}$. This induction principle has for each
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1754
  term constructor @{text "C"}$^\alpha$ a premise of the form
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1755
  %
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1756
  \begin{equation}\label{weakprem}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1757
  \mbox{@{text "\<forall>x\<^isub>1\<dots>x\<^isub>r. P\<^isub>i x\<^isub>i \<and> \<dots> \<and> P\<^isub>j x\<^isub>j \<Rightarrow> P (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r)"}} 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1758
  \end{equation}
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1759
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1760
  \noindent 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1761
  in which the @{text "x"}$_{i..j}$ @{text "\<subseteq>"} @{text "x"}$_{1..r}$ are 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1762
  the recursive arguments of @{text "C\<AL>"}. 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1763
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1764
  By working now completely on the $\alpha$-equated level, we
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1765
  can first show that the free-atom functions and binding functions are
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1766
  equivariant, namely
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1767
  %
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1768
  \begin{center}
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1769
  \begin{tabular}{rcl}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1770
  @{text "p \<bullet> (fa_ty\<AL>\<^isub>i  x)"} & $=$ & @{text "fa_ty\<AL>\<^isub>i (p \<bullet> x)"}\\
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1771
  @{text "p \<bullet> (fa_bn\<AL>\<^isub>j  x)"} & $=$ & @{text "fa_bn\<AL>\<^isub>j (p \<bullet> x)"}\\
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1772
  @{text "p \<bullet> (bn\<AL>\<^isub>j  x)"}    & $=$ & @{text "bn\<AL>\<^isub>j (p \<bullet> x)"}
1718
0d057e57e9a8 More on Section 5
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1717
diff changeset
  1773
  \end{tabular}
0d057e57e9a8 More on Section 5
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1717
diff changeset
  1774
  \end{center}
1717
a3ef7fba983f Beginning of section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1716
diff changeset
  1775
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1776
  \noindent
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1777
  These properties can be established using the induction principle
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1778
  in \eqref{weakinduct}.
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1779
  Having these equivariant properties established, we can
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1780
  show for every term-constructor @{text "C\<^sup>\<alpha>"} that 
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1781
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1782
  \begin{center}
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1783
  @{text "(supp x\<^isub>1 \<union> \<dots> \<union> supp x\<^isub>r) supports (C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r)"}
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1784
  \end{center}
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1785
 
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1786
  \noindent
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1787
  holds. This together with Property~\ref{supportsprop} allows us to prove
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1788
  that every @{text x} of type @{text "ty\<AL>"}$_{1..n}$ is finitely supported, 
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1789
  namely @{text "finite (supp x)"}. This can be again shown by induction 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1790
  over @{text "ty\<AL>"}$_{1..n}$. Lastly, we can show that the support of 
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1791
  elements in  @{text "ty\<AL>"}$_{1..n}$ is the same as @{text "fa_ty\<AL>"}$_{1..n}$.
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1792
  This fact is important in a nominal setting, but also provides evidence 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1793
  that our notions of free-atoms and $\alpha$-equivalence are correct.
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1794
1767
e6a5651a1d81 polished infrastruct section
Christian Urban <urbanc@in.tum.de>
parents: 1766
diff changeset
  1795
  \begin{lemma} 
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1796
  For every @{text "x"} of type @{text "ty\<AL>"}$_{1..n}$, we have
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1797
  @{text "supp x = fa_ty\<AL>\<^isub>i x"}.
1722
05843094273e More on section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1721
diff changeset
  1798
  \end{lemma}
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1799
1722
05843094273e More on section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1721
diff changeset
  1800
  \begin{proof}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1801
  The proof is by induction. In each case
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1802
  we unfold the definition of @{text "supp"}, move the swapping inside the 
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1803
  term-constructors and then use the quasi-injectivity lemmas in order to complete the
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1804
  proof. For the abstraction cases we use the facts derived in Theorem~\ref{suppabs}.
1722
05843094273e More on section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1721
diff changeset
  1805
  \end{proof}
1721
c6116722b44d More on section 5.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1720
diff changeset
  1806
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1807
  \noindent
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1808
  To sum up this section, we can established automatically a reasoning infrastructure
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1809
  for the types @{text "ty\<AL>"}$_{1..n}$ 
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1810
  by first lifting definitions from the raw level to the quotient level and
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1811
  then by establishing facts about these lifted definitions. All necessary proofs
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1812
  are generated automatically by custom ML-code. 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1813
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1814
  %This code can deal with 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  1815
  %specifications such as the one shown in Figure~\ref{nominalcorehas} for Core-Haskell.  
1728
9bbf2a1f9b3f More on paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1727
diff changeset
  1816
2508
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1817
  %\begin{figure}[t!]
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1818
  %\begin{boxedminipage}{\linewidth}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1819
  %\small
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1820
  %\begin{tabular}{l}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1821
  %\isacommand{atom\_decl}~@{text "var cvar tvar"}\\[1mm]
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1822
  %\isacommand{nominal\_datatype}~@{text "tkind ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1823
  %\phantom{$|$}~@{text "KStar"}~$|$~@{text "KFun tkind tkind"}\\ 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1824
  %\isacommand{and}~@{text "ckind ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1825
  %\phantom{$|$}~@{text "CKSim ty ty"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1826
  %\isacommand{and}~@{text "ty ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1827
  %\phantom{$|$}~@{text "TVar tvar"}~$|$~@{text "T string"}~$|$~@{text "TApp ty ty"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1828
  %$|$~@{text "TFun string ty_list"}~%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1829
  %$|$~@{text "TAll tv::tvar tkind ty::ty"}  \isacommand{bind}~@{text "tv"}~\isacommand{in}~@{text ty}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1830
  %$|$~@{text "TArr ckind ty"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1831
  %\isacommand{and}~@{text "ty_lst ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1832
  %\phantom{$|$}~@{text "TNil"}~$|$~@{text "TCons ty ty_lst"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1833
  %\isacommand{and}~@{text "cty ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1834
  %\phantom{$|$}~@{text "CVar cvar"}~%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1835
  %$|$~@{text "C string"}~$|$~@{text "CApp cty cty"}~$|$~@{text "CFun string co_lst"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1836
  %$|$~@{text "CAll cv::cvar ckind cty::cty"}  \isacommand{bind}~@{text "cv"}~\isacommand{in}~@{text cty}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1837
  %$|$~@{text "CArr ckind cty"}~$|$~@{text "CRefl ty"}~$|$~@{text "CSym cty"}~$|$~@{text "CCirc cty cty"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1838
  %$|$~@{text "CAt cty ty"}~$|$~@{text "CLeft cty"}~$|$~@{text "CRight cty"}~$|$~@{text "CSim cty cty"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1839
  %$|$~@{text "CRightc cty"}~$|$~@{text "CLeftc cty"}~$|$~@{text "Coerce cty cty"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1840
  %\isacommand{and}~@{text "co_lst ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1841
  %\phantom{$|$}@{text "CNil"}~$|$~@{text "CCons cty co_lst"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1842
  %\isacommand{and}~@{text "trm ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1843
  %\phantom{$|$}~@{text "Var var"}~$|$~@{text "K string"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1844
  %$|$~@{text "LAM_ty tv::tvar tkind t::trm"}  \isacommand{bind}~@{text "tv"}~\isacommand{in}~@{text t}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1845
  %$|$~@{text "LAM_cty cv::cvar ckind t::trm"}   \isacommand{bind}~@{text "cv"}~\isacommand{in}~@{text t}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1846
  %$|$~@{text "App_ty trm ty"}~$|$~@{text "App_cty trm cty"}~$|$~@{text "App trm trm"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1847
  %$|$~@{text "Lam v::var ty t::trm"}  \isacommand{bind}~@{text "v"}~\isacommand{in}~@{text t}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1848
  %$|$~@{text "Let x::var ty trm t::trm"}  \isacommand{bind}~@{text x}~\isacommand{in}~@{text t}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1849
  %$|$~@{text "Case trm assoc_lst"}~$|$~@{text "Cast trm co"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1850
  %\isacommand{and}~@{text "assoc_lst ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1851
  %\phantom{$|$}~@{text ANil}~%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1852
  %$|$~@{text "ACons p::pat t::trm assoc_lst"}  \isacommand{bind}~@{text "bv p"}~\isacommand{in}~@{text t}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1853
  %\isacommand{and}~@{text "pat ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1854
  %\phantom{$|$}~@{text "Kpat string tvtk_lst tvck_lst vt_lst"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1855
  %\isacommand{and}~@{text "vt_lst ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1856
  %\phantom{$|$}~@{text VTNil}~$|$~@{text "VTCons var ty vt_lst"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1857
  %\isacommand{and}~@{text "tvtk_lst ="}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1858
  %\phantom{$|$}~@{text TVTKNil}~$|$~@{text "TVTKCons tvar tkind tvtk_lst"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1859
  %\isacommand{and}~@{text "tvck_lst ="}\\ 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1860
  %\phantom{$|$}~@{text TVCKNil}~$|$ @{text "TVCKCons cvar ckind tvck_lst"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1861
  %\isacommand{binder}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1862
  %@{text "bv :: pat \<Rightarrow> atom list"}~\isacommand{and}~%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1863
  %@{text "bv1 :: vt_lst \<Rightarrow> atom list"}~\isacommand{and}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1864
  %@{text "bv2 :: tvtk_lst \<Rightarrow> atom list"}~\isacommand{and}~%
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1865
  %@{text "bv3 :: tvck_lst \<Rightarrow> atom list"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1866
  %\isacommand{where}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1867
  %\phantom{$|$}~@{text "bv (K s tvts tvcs vs) = (bv3 tvts) @ (bv2 tvcs) @ (bv1 vs)"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1868
  %$|$~@{text "bv1 VTNil = []"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1869
  %$|$~@{text "bv1 (VTCons x ty tl) = (atom x)::(bv1 tl)"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1870
  %$|$~@{text "bv2 TVTKNil = []"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1871
  %$|$~@{text "bv2 (TVTKCons a ty tl) = (atom a)::(bv2 tl)"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1872
  %$|$~@{text "bv3 TVCKNil = []"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1873
  %$|$~@{text "bv3 (TVCKCons c cty tl) = (atom c)::(bv3 tl)"}\\
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1874
  %\end{tabular}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1875
  %\end{boxedminipage}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1876
  %\caption{The nominal datatype declaration for Core-Haskell. For the moment we
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1877
  %do not support nested types; therefore we explicitly have to unfold the 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1878
  %lists @{text "co_lst"}, @{text "assoc_lst"} and so on. This will be improved
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1879
  %in a future version of Nominal Isabelle. Apart from that, the 
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1880
  %declaration follows closely the original in Figure~\ref{corehas}. The
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1881
  %point of our work is that having made such a declaration in Nominal Isabelle,
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1882
  %one obtains automatically a reasoning infrastructure for Core-Haskell.
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1883
  %\label{nominalcorehas}}
6d9018d62b40 first part of sqeezing everything into 20 pages (at the moment we have 26)
Christian Urban <urbanc@in.tum.de>
parents: 2507
diff changeset
  1884
  %\end{figure}
1766
a2d5f9ea17ad completed lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1765
diff changeset
  1885
*}
1728
9bbf2a1f9b3f More on paper
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1727
diff changeset
  1886
1587
b6da798cef68 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1579
diff changeset
  1887
1747
4abb95a7264b starting strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1746
diff changeset
  1888
section {* Strong Induction Principles *}
4abb95a7264b starting strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1746
diff changeset
  1889
4abb95a7264b starting strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1746
diff changeset
  1890
text {*
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1891
  In the previous section we were able to provide induction principles that 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1892
  allow us to perform structural inductions over $\alpha$-equated terms. 
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1893
  We call such induction principles \emph{weak}, because in case of the 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1894
  term-constructor @{text "C\<^sup>\<alpha> x\<^isub>1 \<dots> x\<^isub>r"},
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1895
  the induction hypothesis requires us to establish the implications \eqref{weakprem}.
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1896
  The problem with these implications is that in general they are difficult to establish.
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1897
  The reason is that we cannot make any assumption about the binders that might be in @{text "C\<^sup>\<alpha>"} 
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1898
  (for example we cannot assume the variable convention for them).
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1899
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1900
  In \cite{UrbanTasson05} we introduced a method for automatically
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1901
  strengthening weak induction principles for terms containing single
1768
375e15002efc tuned strong ind section
Christian Urban <urbanc@in.tum.de>
parents: 1767
diff changeset
  1902
  binders. These stronger induction principles allow the user to make additional
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1903
  assumptions about binders. 
1768
375e15002efc tuned strong ind section
Christian Urban <urbanc@in.tum.de>
parents: 1767
diff changeset
  1904
  These additional assumptions amount to a formal
375e15002efc tuned strong ind section
Christian Urban <urbanc@in.tum.de>
parents: 1767
diff changeset
  1905
  version of the informal variable convention for binders. A natural question is
375e15002efc tuned strong ind section
Christian Urban <urbanc@in.tum.de>
parents: 1767
diff changeset
  1906
  whether we can also strengthen the weak induction principles involving
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1907
  the general binders presented here. We will indeed be able to so, but for this we need an 
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1908
  additional notion for permuting deep binders. 
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1909
1768
375e15002efc tuned strong ind section
Christian Urban <urbanc@in.tum.de>
parents: 1767
diff changeset
  1910
  Given a binding function @{text "bn"} we define an auxiliary permutation 
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1911
  operation @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} which permutes only bound arguments in a deep binder.
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1912
  Assuming a clause of @{text bn} is given as 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1913
  %
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1914
  \begin{center}
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1915
  @{text "bn (C x\<^isub>1 \<dots> x\<^isub>r) = rhs"}, 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1916
  \end{center}
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1917
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1918
  \noindent 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1919
  then we define 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1920
  %
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1921
  \begin{center}
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1922
  @{text "p \<bullet>\<^bsub>bn\<^esub> (C x\<^isub>1 \<dots> x\<^isub>r) \<equiv> C y\<^isub>1 \<dots> y\<^isub>r"} 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1923
  \end{center}
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1924
  
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1925
  \noindent
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1926
  with @{text "y\<^isub>i"} determined as follows:
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1927
  %
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1928
  \begin{center}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1929
  \begin{tabular}{c@ {\hspace{2mm}}p{7cm}}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1930
  $\bullet$ & @{text "y\<^isub>i \<equiv> x\<^isub>i"} provided @{text "x\<^isub>i"} does not occur in @{text "rhs"}\\
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1931
  $\bullet$ & @{text "y\<^isub>i \<equiv> p \<bullet>\<^bsub>bn'\<^esub> x\<^isub>i"} provided @{text "bn' x\<^isub>i"} is in @{text "rhs"}\\
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1932
  $\bullet$ & @{text "y\<^isub>i \<equiv> p \<bullet> x\<^isub>i"} otherwise
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1933
  \end{tabular}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1934
  \end{center}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1935
  
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1936
  \noindent
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1937
  Using again the quotient package  we can lift the @{text "_ \<bullet>\<^bsub>bn\<^esub> _"} function to 
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  1938
  $\alpha$-equated terms. We can then prove the following two facts
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1939
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1940
  \begin{lemma}\label{permutebn} 
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1941
  Given a binding function @{text "bn\<^sup>\<alpha>"} then for all @{text p}
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1942
  {\it (i)} @{text "p \<bullet> (bn\<^sup>\<alpha> x) = bn\<^sup>\<alpha> (p \<bullet>\<AL>\<^bsub>bn\<^esub> x)"} and {\it (ii)}
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1943
    @{text "fa_bn\<^isup>\<alpha> x = fa_bn\<^isup>\<alpha> (p \<bullet>\<AL>\<^bsub>bn\<^esub> x)"}.
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1944
  \end{lemma}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1945
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1946
  \begin{proof} 
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1947
  By induction on @{text x}. The equations follow by simple unfolding 
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1948
  of the definitions. 
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1949
  \end{proof}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1950
1769
Christian Urban <urbanc@in.tum.de>
parents: 1768
diff changeset
  1951
  \noindent
1768
375e15002efc tuned strong ind section
Christian Urban <urbanc@in.tum.de>
parents: 1767
diff changeset
  1952
  The first property states that a permutation applied to a binding function is
375e15002efc tuned strong ind section
Christian Urban <urbanc@in.tum.de>
parents: 1767
diff changeset
  1953
  equivalent to first permuting the binders and then calculating the bound
2347
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1954
  atoms. The second amounts to the fact that permuting the binders has no 
9807d30c0e54 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2346
diff changeset
  1955
  effect on the free-atom function. The main point of this permutation
1769
Christian Urban <urbanc@in.tum.de>
parents: 1768
diff changeset
  1956
  function, however, is that if we have a permutation that is fresh 
Christian Urban <urbanc@in.tum.de>
parents: 1768
diff changeset
  1957
  for the support of an object @{text x}, then we can use this permutation 
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1958
  to rename the binders in @{text x}, without ``changing'' @{text x}. In case of the 
1769
Christian Urban <urbanc@in.tum.de>
parents: 1768
diff changeset
  1959
  @{text "Let"} term-constructor from the example shown 
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1960
  in \eqref{letpat} this means for a permutation @{text "r"}
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1961
  %
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1962
  \begin{equation}\label{renaming}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1963
  \begin{array}{l}
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1964
  \mbox{if @{term "supp (Abs_lst (bn p) t\<^isub>2)  \<sharp>* r"}}\\ 
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1965
  \qquad\mbox{then @{text "Let p t\<^isub>1 t\<^isub>2 = Let (r \<bullet>\<AL>\<^bsub>bn_pat\<^esub> p) t\<^isub>1 (r \<bullet> t\<^isub>2)"}}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1966
  \end{array}
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1967
  \end{equation}
1769
Christian Urban <urbanc@in.tum.de>
parents: 1768
diff changeset
  1968
Christian Urban <urbanc@in.tum.de>
parents: 1768
diff changeset
  1969
  \noindent
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1970
  This fact will be crucial when establishing the strong induction principles below.
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1971
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1972
 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1973
  In our running example about @{text "Let"}, the strong induction
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1974
  principle means that instead 
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1975
  of establishing the implication 
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  1976
  %
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1977
  \begin{center}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1978
  @{text "\<forall>p t\<^isub>1 t\<^isub>2. P\<^bsub>pat\<^esub> p \<and> P\<^bsub>trm\<^esub> t\<^isub>1 \<and> P\<^bsub>trm\<^esub> t\<^isub>2 \<Rightarrow> P\<^bsub>trm\<^esub> (Let p t\<^isub>1 t\<^isub>2)"}
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1979
  \end{center}
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1980
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  1981
  \noindent
1769
Christian Urban <urbanc@in.tum.de>
parents: 1768
diff changeset
  1982
  it is sufficient to establish the following implication
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1983
  %
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1984
  \begin{equation}\label{strong}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1985
  \mbox{\begin{tabular}{l}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1986
  @{text "\<forall>p t\<^isub>1 t\<^isub>2 c."}\\
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1987
  \hspace{5mm}@{text "set (bn p) #\<^sup>* c \<and>"}\\
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1988
  \hspace{5mm}@{text "(\<forall>d. P\<^bsub>pat\<^esub> d p) \<and> (\<forall>d. P\<^bsub>trm\<^esub> d t\<^isub>1) \<and> (\<forall>d. P\<^bsub>trm\<^esub> d t\<^isub>2)"}\\
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  1989
  \hspace{15mm}@{text "\<Rightarrow> P\<^bsub>trm\<^esub> c (Let p t\<^isub>1 t\<^isub>2)"}
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1990
  \end{tabular}}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1991
  \end{equation}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1992
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1993
  \noindent 
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1994
  While this implication contains an additional argument, namely @{text c}, and 
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1995
  also additional universal quantifications, it is usually easier to establish.
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  1996
  The reason is that we have the freshness 
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1997
  assumption @{text "set (bn\<^sup>\<alpha> p) #\<^sup>* c"}, whereby @{text c} can be arbitrarily 
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1998
  chosen by the user as long as it has finite support.
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  1999
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2000
  Let us now show how we derive the strong induction principles from the
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2001
  weak ones. In case of the @{text "Let"}-example we derive by the weak 
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2002
  induction the following two properties
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2003
  %
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2004
  \begin{equation}\label{hyps}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2005
  @{text "\<forall>q c. P\<^bsub>trm\<^esub> c (q \<bullet> t)"} \hspace{4mm} 
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2006
  @{text "\<forall>q\<^isub>1 q\<^isub>2 c. P\<^bsub>pat\<^esub> (q\<^isub>1 \<bullet>\<AL>\<^bsub>bn\<^esub> (q\<^isub>2 \<bullet> p))"}
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2007
  \end{equation} 
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2008
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2009
  \noindent
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2010
  For the @{text Let} term-constructor  we therefore have to establish @{text "P\<^bsub>trm\<^esub> c (q \<bullet> Let p t\<^isub>1 t\<^isub>2)"} 
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2011
  assuming \eqref{hyps} as induction hypotheses (the first for @{text t\<^isub>1} and @{text t\<^isub>2}). 
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2012
  By Property~\ref{avoiding} we
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2013
  obtain a permutation @{text "r"} such that 
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2014
  %
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2015
  \begin{equation}\label{rprops}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2016
  @{term "(r \<bullet> set (bn (q \<bullet> p))) \<sharp>* c "}\hspace{4mm}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2017
  @{term "supp (Abs_lst (bn (q \<bullet> p)) (q \<bullet> t\<^isub>2)) \<sharp>* r"}
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2018
  \end{equation}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2019
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2020
  \noindent
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2021
  hold. The latter fact and \eqref{renaming} give us
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  2022
  %
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  2023
  \begin{center}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2024
  \begin{tabular}{l}
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2025
  @{text "Let (q \<bullet> p) (q \<bullet> t\<^isub>1) (q \<bullet> t\<^isub>2) ="} \\
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2026
  \hspace{15mm}@{text "Let (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p)) (q \<bullet> t\<^isub>1) (r \<bullet> (q \<bullet> t\<^isub>2))"}
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2027
  \end{tabular}
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2028
  \end{center}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2029
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2030
  \noindent
2176
5054f170024e edits from the reviewers
Christian Urban <urbanc@in.tum.de>
parents: 2175
diff changeset
  2031
  So instead of proving @{text "P\<^bsub>trm\<^esub> c (q \<bullet> Let p t\<^isub>1 t\<^isub>2)"}, we can equally
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2032
  establish @{text "P\<^bsub>trm\<^esub> c (Let (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p)) (q \<bullet> t\<^isub>1) (r \<bullet> (q \<bullet> t\<^isub>2)))"}.
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2033
  To do so, we will use the implication \eqref{strong} of the strong induction
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2034
  principle, which requires us to discharge
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2035
  the following four proof obligations:
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  2036
  %
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2037
  \begin{center}
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2038
  \begin{tabular}{rl}
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2039
  {\it (i)} &   @{text "set (bn (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p))) #\<^sup>* c"}\\
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2040
  {\it (ii)} &  @{text "\<forall>d. P\<^bsub>pat\<^esub> d (r \<bullet>\<AL>\<^bsub>bn\<^esub> (q \<bullet> p))"}\\
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2041
  {\it (iii)} & @{text "\<forall>d. P\<^bsub>trm\<^esub> d (q \<bullet> t\<^isub>1)"}\\
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2042
  {\it (iv)} & @{text "\<forall>d. P\<^bsub>trm\<^esub> d (r \<bullet> (q \<bullet> t\<^isub>2))"}\\
1765
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  2043
  \end{tabular}
9a894c42e80e more on the lifting section
Christian Urban <urbanc@in.tum.de>
parents: 1764
diff changeset
  2044
  \end{center}
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2045
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2046
  \noindent
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2047
  The first follows from \eqref{rprops} and Lemma~\ref{permutebn}.{\it (i)}; the 
1771
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2048
  others from the induction hypotheses in \eqref{hyps} (in the fourth case
3e71af53cedb submitted version (just in time ;o)
Christian Urban <urbanc@in.tum.de>
parents: 1770
diff changeset
  2049
  we have to use the fact that @{term "(r \<bullet> (q \<bullet> t\<^isub>2)) = (r + q) \<bullet> t\<^isub>2"}).
1748
014a4ef807dc Fighting with space in displaying strong induction...
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1747
diff changeset
  2050
1770
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2051
  Taking now the identity permutation @{text 0} for the permutations in \eqref{hyps},
26e44bcddb5b first complete version (slightly less than 3h more to go)
Christian Urban <urbanc@in.tum.de>
parents: 1769
diff changeset
  2052
  we can establish our original goals, namely @{text "P\<^bsub>trm\<^esub> c t"} and \mbox{@{text "P\<^bsub>pat\<^esub> c p"}}.
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2053
  This completes the proof showing that the weak induction principles imply 
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2054
  the strong induction principles. 
1747
4abb95a7264b starting strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1746
diff changeset
  2055
*}
4abb95a7264b starting strong induction
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1746
diff changeset
  2056
1702
Christian Urban <urbanc@in.tum.de>
parents: 1699
diff changeset
  2057
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
  2058
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
  2059
1570
014ddf0d7271 tuned paper
Christian Urban <urbanc@in.tum.de>
parents: 1566
diff changeset
  2060
text {*
2342
f296ef291ca9 spell check
Christian Urban <urbanc@in.tum.de>
parents: 2341
diff changeset
  2061
  To our knowledge the earliest usage of general binders in a theorem prover
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2062
  is described in \cite{NaraschewskiNipkow99} about a formalisation of the
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  2063
  algorithm W. This formalisation implements binding in type-schemes using a
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  2064
  de-Bruijn indices representation. Since type-schemes in W contain only a single
2360
99134763d03e a bit more to the paper
Christian Urban <urbanc@in.tum.de>
parents: 2359
diff changeset
  2065
  place where variables are bound, different indices do not refer to different binders (as in the usual
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2066
  de-Bruijn representation), but to different bound variables. A similar idea
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2067
  has been recently explored for general binders in the locally nameless
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2068
  approach to binding \cite{chargueraud09}.  There, de-Bruijn indices consist
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2069
  of two numbers, one referring to the place where a variable is bound and the
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2070
  other to which variable is bound. The reasoning infrastructure for both
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2071
  representations of bindings comes for free in theorem provers like Isabelle/HOL or
2342
f296ef291ca9 spell check
Christian Urban <urbanc@in.tum.de>
parents: 2341
diff changeset
  2072
  Coq, since the corresponding term-calculi can be implemented as ``normal''
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2073
  datatypes.  However, in both approaches it seems difficult to achieve our
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2074
  fine-grained control over the ``semantics'' of bindings (i.e.~whether the
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2075
  order of binders should matter, or vacuous binders should be taken into
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2076
  account). To do so, one would require additional predicates that filter out
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2077
  unwanted terms. Our guess is that such predicates result in rather
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2078
  intricate formal reasoning.
1740
2afee29cf81c completed related work section
Christian Urban <urbanc@in.tum.de>
parents: 1739
diff changeset
  2079
2afee29cf81c completed related work section
Christian Urban <urbanc@in.tum.de>
parents: 1739
diff changeset
  2080
  Another representation technique for binding is higher-order abstract syntax
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2081
  (HOAS), which for example is implemented in the Twelf system. This representation
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2082
  technique supports very elegantly many aspects of \emph{single} binding, and
2342
f296ef291ca9 spell check
Christian Urban <urbanc@in.tum.de>
parents: 2341
diff changeset
  2083
  impressive work has been done that uses HOAS for mechanising the metatheory
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2084
  of SML~\cite{LeeCraryHarper07}. We are, however, not aware how multiple
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2085
  binders of SML are represented in this work. Judging from the submitted
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2086
  Twelf-solution for the POPLmark challenge, HOAS cannot easily deal with
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2087
  binding constructs where the number of bound variables is not fixed. For
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2088
  example in the second part of this challenge, @{text "Let"}s involve
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2089
  patterns that bind multiple variables at once. In such situations, HOAS
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2090
  representations have to resort to the iterated-single-binders-approach with
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2091
  all the unwanted consequences when reasoning about the resulting terms.
1740
2afee29cf81c completed related work section
Christian Urban <urbanc@in.tum.de>
parents: 1739
diff changeset
  2092
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2093
  %Two formalisations involving general binders have been 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2094
  %performed in older
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2095
  %versions of Nominal Isabelle (one about Psi-calculi and one about algorithm W 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2096
  %\cite{BengtsonParow09,UrbanNipkow09}).  Both
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2097
  %use the approach based on iterated single binders. Our experience with
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2098
  %the latter formalisation has been disappointing. The major pain arose from
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2099
  %the need to ``unbind'' variables. This can be done in one step with our
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2100
  %general binders described in this paper, but needs a cumbersome
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2101
  %iteration with single binders. The resulting formal reasoning turned out to
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2102
  %be rather unpleasant. The hope is that the extension presented in this paper
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2103
  %is a substantial improvement.
1726
2eafd8ed4bbf started with a related work section
Christian Urban <urbanc@in.tum.de>
parents: 1725
diff changeset
  2104
 
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2105
  The most closely related work to the one presented here is the Ott-tool
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2106
  \cite{ott-jfp} and the C$\alpha$ml language \cite{Pottier06}. Ott is a nifty
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2107
  front-end for creating \LaTeX{} documents from specifications of
2343
36aeb97fabb0 more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2342
diff changeset
  2108
  term-calculi involving general binders. For a subset of the specifications
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2109
  Ott can also generate theorem prover code using a raw representation of
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2110
  terms, and in Coq also a locally nameless representation. The developers of
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2111
  this tool have also put forward (on paper) a definition for
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  2112
  $\alpha$-equivalence of terms that can be specified in Ott.  This definition is
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2113
  rather different from ours, not using any nominal techniques.  To our
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2114
  knowledge there is also no concrete mathematical result concerning this
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  2115
  notion of $\alpha$-equivalence.  A definition for the notion of free variables
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2116
  is work in progress in Ott.
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2117
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2118
  Although we were heavily inspired by the syntax in Ott,
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2119
  its definition of $\alpha$-equivalence is unsuitable for our extension of
1760
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2120
  Nominal Isabelle. First, it is far too complicated to be a basis for
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2121
  automated proofs implemented on the ML-level of Isabelle/HOL. Second, it
0bb0f6e662a4 updated related work section
Christian Urban <urbanc@in.tum.de>
parents: 1758
diff changeset
  2122
  covers cases of binders depending on other binders, which just do not make
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  2123
  sense for our $\alpha$-equated terms. Third, it allows empty types that have no
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2124
  meaning in a HOL-based theorem prover. We also had to generalise slightly Ott's 
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2125
  binding clauses. In Ott you specify binding clauses with a single body; we 
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2126
  allow more than one. We have to do this, because this makes a difference 
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  2127
  for our notion of $\alpha$-equivalence in case of \isacommand{bind (set)} and 
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2128
  \isacommand{bind (res)}. 
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2129
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2130
  %Consider the examples
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2131
  %
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2132
  %\begin{center}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2133
  %\begin{tabular}{@ {}l@ {\hspace{2mm}}l@ {}}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2134
  %@{text "Foo\<^isub>1 xs::name fset t::trm s::trm"} &  
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2135
  %    \isacommand{bind (set)} @{text "xs"} \isacommand{in} @{text "t s"}\\
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2136
  %@{text "Foo\<^isub>2 xs::name fset t::trm s::trm"} &  
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2137
  %    \isacommand{bind (set)} @{text "xs"} \isacommand{in} @{text "t"}, 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2138
  %    \isacommand{bind (set)} @{text "xs"} \isacommand{in} @{text "s"}\\
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2139
  %\end{tabular}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2140
  %\end{center}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2141
  %
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2142
  %\noindent
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2143
  %In the first term-constructor we have a single
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2144
  %body that happens to be ``spread'' over two arguments; in the second term-constructor we have
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2145
  %two independent bodies in which the same variables are bound. As a result we 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2146
  %have
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2147
  % 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2148
  %\begin{center}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2149
  %\begin{tabular}{r@ {\hspace{1.5mm}}c@ {\hspace{1.5mm}}l}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2150
  %@{text "Foo\<^isub>1 {a, b} (a, b) (a, b)"} & $\not=$ & 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2151
  %@{text "Foo\<^isub>1 {a, b} (a, b) (b, a)"}\\
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2152
  %@{text "Foo\<^isub>2 {a, b} (a, b) (a, b)"} & $=$ & 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2153
  %@{text "Foo\<^isub>2 {a, b} (a, b) (b, a)"}\\
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2154
  %\end{tabular}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2155
  %\end{center}
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2156
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2157
  \noindent
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2158
  %and therefore need the extra generality to be able to distinguish between 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2159
  %both specifications.
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2160
  Because of how we set up our definitions, we also had to impose some restrictions
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2161
  (like a single binding function for a deep binder) that are not present in Ott. Our
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2162
  expectation is that we can still cover many interesting term-calculi from
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2163
  programming language research, for example Core-Haskell. 
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2164
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2165
  Pottier presents in \cite{Pottier06} a language, called C$\alpha$ml, for 
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2166
  representing terms with general binders inside OCaml. This language is
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2167
  implemented as a front-end that can be translated to OCaml with the help of
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2168
  a library. He presents a type-system in which the scope of general binders
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2169
  can be specified using special markers, written @{text "inner"} and 
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2170
  @{text "outer"}. It seems our and his specifications can be
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2171
  inter-translated as long as ours use the binding mode 
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2172
  \isacommand{bind} only.
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2173
  However, we have not proved this. Pottier gives a definition for 
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2174
  $\alpha$-equivalence, which also uses a permutation operation (like ours).
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2175
  Still, this definition is rather different from ours and he only proves that
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2176
  it defines an equivalence relation. A complete
2163
5dc48e1af733 added comments about pottiers work
Christian Urban <urbanc@in.tum.de>
parents: 2156
diff changeset
  2177
  reasoning infrastructure is well beyond the purposes of his language. 
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2178
  
2218
502eaa199726 added to the popl-paper a pointer to work by Altenkirch
Christian Urban <urbanc@in.tum.de>
parents: 2203
diff changeset
  2179
  In a slightly different domain (programming with dependent types), the 
502eaa199726 added to the popl-paper a pointer to work by Altenkirch
Christian Urban <urbanc@in.tum.de>
parents: 2203
diff changeset
  2180
  paper \cite{Altenkirch10} presents a calculus with a notion of 
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  2181
  $\alpha$-equivalence related to our binding mode \isacommand{bind (res)}.
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2182
  The definition in \cite{Altenkirch10} is similar to the one by Pottier, except that it
2218
502eaa199726 added to the popl-paper a pointer to work by Altenkirch
Christian Urban <urbanc@in.tum.de>
parents: 2203
diff changeset
  2183
  has a more operational flavour and calculates a partial (renaming) map. 
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2184
  In this way, the definition can deal with vacuous binders. However, to our
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2185
  best knowledge, no concrete mathematical result concerning this
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2186
  definition of $\alpha$-equivalence has been proved.    
1739
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  2187
*}
468c3c1adcba more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 1737
diff changeset
  2188
1493
52f68b524fd2 slightly more of the paper
Christian Urban <urbanc@in.tum.de>
parents: 1491
diff changeset
  2189
section {* Conclusion *}
1485
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
  2190
c004e7448dca temporarily disabled tests in Nominal/ROOT
Christian Urban <urbanc@in.tum.de>
parents: 1484
diff changeset
  2191
text {*
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2192
  We have presented an extension of Nominal Isabelle for dealing with
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2193
  general binders, that is term-constructors having multiple bound 
2381
fd85f4921654 samll changes
Christian Urban <urbanc@in.tum.de>
parents: 2364
diff changeset
  2194
  variables. For this extension we introduced new definitions of 
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2195
  $\alpha$-equivalence and automated all necessary proofs in Isabelle/HOL.
2364
2bf351f09317 submitted version
Christian Urban <urbanc@in.tum.de>
parents: 2363
diff changeset
  2196
  To specify general binders we used the specifications from Ott, but extended them 
2bf351f09317 submitted version
Christian Urban <urbanc@in.tum.de>
parents: 2363
diff changeset
  2197
  in some places and restricted
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2198
  them in others so that they make sense in the context of $\alpha$-equated terms. 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2199
  We also introduced two binding modes (set and res) that do not 
2488
1c18f2cf3923 a few more words about Ott
Christian Urban <urbanc@in.tum.de>
parents: 2471
diff changeset
  2200
  exist in Ott. 
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2201
  We have tried out the extension with terms from Core-Haskell, type-schemes 
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2202
  and a dozen of other calculi from programming language research. The code
2363
9832641ed955 more paper
Christian Urban <urbanc@in.tum.de>
parents: 2362
diff changeset
  2203
  will eventually become part of the next Isabelle distribution.\footnote{For the moment
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2204
  it can be downloaded from the Mercurial repository linked at
1741
0c01dda0acd5 more on the conclusion
Christian Urban <urbanc@in.tum.de>
parents: 1740
diff changeset
  2205
  \href{http://isabelle.in.tum.de/nominal/download}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  2206
  {http://isabelle.in.tum.de/nominal/download}.}
1741
0c01dda0acd5 more on the conclusion
Christian Urban <urbanc@in.tum.de>
parents: 1740
diff changeset
  2207
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2208
  We have left out a discussion about how functions can be defined over
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2209
  $\alpha$-equated terms involving general binders. In earlier versions of Nominal
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2210
  Isabelle \cite{UrbanBerghofer06} this turned out to be a thorny issue.  We
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2211
  hope to do better this time by using the function package that has recently
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2212
  been implemented in Isabelle/HOL and also by restricting function
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2213
  definitions to equivariant functions (for such functions it is possible to
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2214
  provide more automation).
1741
0c01dda0acd5 more on the conclusion
Christian Urban <urbanc@in.tum.de>
parents: 1740
diff changeset
  2215
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2216
  %There are some restrictions we imposed in this paper that we would like to lift in
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2217
  %future work. One is the exclusion of nested datatype definitions. Nested
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2218
  %datatype definitions allow one to specify, for instance, the function kinds
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2219
  %in Core-Haskell as @{text "TFun string (ty list)"} instead of the unfolded
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2220
  %version @{text "TFun string ty_list"} (see Figure~\ref{nominalcorehas}). To
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2221
  %achieve this, we need a slightly more clever implementation than we have at the moment. 
1764
9f55d7927e5b more on the strong induction section
Christian Urban <urbanc@in.tum.de>
parents: 1763
diff changeset
  2222
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2223
  %A more interesting line of investigation is whether we can go beyond the 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2224
  %simple-minded form of binding functions that we adopted from Ott. At the moment, binding
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2225
  %functions can only return the empty set, a singleton atom set or unions
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2226
  %of atom sets (similarly for lists). It remains to be seen whether 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2227
  %properties like
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2228
  %%
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2229
  %\begin{center}
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2230
  %@{text "fa_ty x  =  bn x \<union> fa_bn x"}.
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2231
  %\end{center}
2361
d73d4d151cce more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2360
diff changeset
  2232
  %
2512
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2233
  %\noindent
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2234
  %allow us to support more interesting binding functions. 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2235
  %
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2236
  %We have also not yet played with other binding modes. For example we can
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2237
  %imagine that there is need for a binding mode 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2238
  %where instead of lists, we abstract lists of distinct elements.
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2239
  %Once we feel confident about such binding modes, our implementation 
b5cb3183409e down to 22 pages
Christian Urban <urbanc@in.tum.de>
parents: 2511
diff changeset
  2240
  %can be easily extended to accommodate them.
1763
3b89de6150ed completed conclusion
Christian Urban <urbanc@in.tum.de>
parents: 1761
diff changeset
  2241
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2242
  \medskip
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2243
  \noindent
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  2244
  {\bf Acknowledgements:} %We are very grateful to Andrew Pitts for  
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  2245
  %many discussions about Nominal Isabelle. 
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  2246
  We thank Peter Sewell for 
2362
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2247
  making the informal notes \cite{SewellBestiary} available to us and 
9d8ebeded16f more on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2361
diff changeset
  2248
  also for patiently explaining some of the finer points of the work on the Ott-tool.
2511
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  2249
  %Stephanie Weirich suggested to separate the subgrammars
2ccf3086142b down to 23 pages
Christian Urban <urbanc@in.tum.de>
parents: 2510
diff changeset
  2250
  %of kinds and types in our Core-Haskell example.  
2341
f659ce282610 more work on the paper
Christian Urban <urbanc@in.tum.de>
parents: 2331
diff changeset
  2251
754
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2252
*}
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2253
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2254
(*<*)
b85875d65b10 added a paper for possible notes
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
  2255
end
1704
cbd6a709a664 fv and fv_bn
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 1703
diff changeset
  2256
(*>*)