Slides/Slides2.thy
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 23 Jul 2013 14:52:22 +0200
changeset 273 fa021a0c6984
parent 272 42f2c28d1ce6
child 274 6bf48979a72e
permissions -rw-r--r--
new slides
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
(*<*)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
theory Slides2
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
imports "../thys/UTM" "../thys/Abacus_Defs"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
begin
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
declare [[show_question_marks = false]]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
hide_const (open) s 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
abbreviation
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
  "update2 p a \<equiv> update a p"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    12
notation (Rule output)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    13
  "==>"  ("\<^raw:\mbox{}\inferrule{\mbox{>_\<^raw:}}>\<^raw:{\mbox{>_\<^raw:}}>")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    14
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    15
syntax (Rule output)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    16
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    17
  ("\<^raw:\mbox{}\inferrule{>_\<^raw:}>\<^raw:{\mbox{>_\<^raw:}}>")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    18
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    19
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    20
  ("\<^raw:\mbox{>_\<^raw:}\\>/ _")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    21
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    22
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    23
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    24
notation (Axiom output)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    25
  "Trueprop"  ("\<^raw:\mbox{}\inferrule{\mbox{}}{\mbox{>_\<^raw:}}>")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    26
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    27
notation (IfThen output)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    28
  "==>"  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    29
syntax (IfThen output)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    30
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    31
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    32
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}> /\<^raw:{\normalsize \,>and\<^raw:\,}>/ _")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    33
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    34
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    35
notation (IfThenNoBox output)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    36
  "==>"  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    37
syntax (IfThenNoBox output)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    38
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    39
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    40
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^raw:{\normalsize \,>and\<^raw:\,}>/ _")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    41
  "_asm" :: "prop \<Rightarrow> asms" ("_")
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    42
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    43
context uncomputable
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    44
begin
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
notation (latex output)
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    47
  Cons ("_::_" [48,47] 68) and
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    48
  append ("_@_" [65, 64] 65) and
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
  Oc ("1") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
  Bk ("0") and
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    51
  exponent ("_\<^bsup>_\<^esup>" [107] 109) and
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
  inv_begin0 ("I\<^isub>0") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
  inv_begin1 ("I\<^isub>1") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
  inv_begin2 ("I\<^isub>2") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
  inv_begin3 ("I\<^isub>3") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
  inv_begin4 ("I\<^isub>4") and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
  inv_begin ("I\<^bsub>cbegin\<^esub>") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
  inv_loop1 ("J\<^isub>1") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
  inv_loop0 ("J\<^isub>0") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
  inv_end1 ("K\<^isub>1") and
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    61
  inv_end0 ("K\<^isub>0") and
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    62
  recf.id ("Id\<^raw:\makebox[0mm]{\,\,\,\,>\<^isup>_\<^raw:}>\<^isub>_") and
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    63
  Pr ("Pr\<^isup>_") and
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    64
  Cn ("Cn\<^isup>_") and
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    65
  Mn ("Mn\<^isup>_") and
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    66
  tcopy ("copy") and 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    67
  tcontra ("contra") and
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    68
  tape_of ("\<langle>_\<rangle>") and 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    69
  code_tcontra ("code contra") and
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
    70
  tm_comp ("_ ; _") 
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
lemma inv_begin_print:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
  shows "s = 0 \<Longrightarrow> inv_begin n (s, tp) = inv_begin0 n tp" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    75
        "s = 1 \<Longrightarrow> inv_begin n (s, tp) = inv_begin1 n tp" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
        "s = 2 \<Longrightarrow> inv_begin n (s, tp) = inv_begin2 n tp" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    77
        "s = 3 \<Longrightarrow> inv_begin n (s, tp) = inv_begin3 n tp" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    78
        "s = 4 \<Longrightarrow> inv_begin n (s, tp) = inv_begin4 n tp" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    79
        "s \<notin> {0,1,2,3,4} \<Longrightarrow> inv_begin n (s, l, r) = False"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    80
apply(case_tac [!] tp)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    81
by (auto)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    82
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    83
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    84
lemma inv1: 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    85
  shows "0 < (n::nat) \<Longrightarrow> Turing_Hoare.assert_imp (inv_begin0 n) (inv_loop1 n)"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    86
unfolding Turing_Hoare.assert_imp_def
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    87
unfolding inv_loop1.simps inv_begin0.simps
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    88
apply(auto)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    89
apply(rule_tac x="1" in exI)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    90
apply(auto simp add: replicate.simps)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    91
done
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    92
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    93
lemma inv2: 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    94
  shows "0 < n \<Longrightarrow> inv_loop0 n = inv_end1 n"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    95
apply(rule ext)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    96
apply(case_tac x)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    97
apply(simp add: inv_end1.simps)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    98
done
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
lemma measure_begin_print:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
  shows "s = 2 \<Longrightarrow> measure_begin_step (s, l, r) = length r" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
        "s = 3 \<Longrightarrow> measure_begin_step (s, l, r) = (if r = [] \<or> r = [Bk] then 1 else 0)" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
        "s = 4 \<Longrightarrow> measure_begin_step (s, l, r) = length l" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   105
        "s \<notin> {2,3,4} \<Longrightarrow> measure_begin_step (s, l, r) = 0"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
by (simp_all)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   107
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   108
lemma inv_begin01:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   109
  assumes "n > 1"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   110
  shows "inv_begin0 n (l, r) = (n > 1 \<and> (l, r) = (Oc \<up> (n - 2), [Oc, Oc, Bk, Oc]))"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   111
using assms by auto                          
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   112
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   113
lemma inv_begin02:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   114
  assumes "n = 1"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   115
  shows "inv_begin0 n (l, r) = (n = 1 \<and> (l, r) = ([], [Bk, Oc, Bk, Oc]))"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   116
using assms by auto
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   117
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   118
(*>*)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   119
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   120
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   121
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   122
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   123
  \renewcommand{\slidecaption}{ITP, 24 July 2013}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   124
  \newcommand{\bl}[1]{#1}                        
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   125
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   126
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   127
  \begin{frame}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   128
  \frametitle{%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   129
  \begin{tabular}{@ {}c@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   130
  \\[-3mm]
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   131
  {\fontsize{20}{20}\selectfont{}Mechanising Turing Machines and}\\[-2mm] 
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   132
  {\fontsize{20}{20}\selectfont{}Computability Theory in Isabelle}\\[-3mm] 
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   133
  \end{tabular}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   134
  
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   135
  \bigskip\medskip\medskip
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   136
 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   137
  \begin{center}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   138
  \begin{tabular}{c@ {\hspace{1cm}}c}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   139
  \includegraphics[scale=0.29]{jian.jpg}  &
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   140
  \includegraphics[scale=0.034]{xingyuan.jpg} \\
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   141
  Jian Xu & Xingyuan Zhang\\[-3mm]
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   142
  \end{tabular}\\[3mm]
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   143
  \small PLA University of Science and Technology
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   144
  \end{center}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   145
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   146
  \begin{center}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   147
  Christian Urban\\[0mm]
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   148
  \small King's College London
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   149
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   150
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   151
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   152
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   153
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   154
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   155
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   156
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   157
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   158
  \begin{frame}[c]
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   159
  \frametitle{Why Turing Machines?}%
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   160
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   161
  \begin{itemize}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   162
  \item At the beginning, it was just a student project
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   163
  about computability.\smallskip
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   164
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   165
  \begin{center}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   166
  \begin{tabular}{c}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   167
  \includegraphics[scale=0.3]{boolos.jpg}\\[-2mm]
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   168
  \footnotesize Computability and Logic (5th.~ed)\\[-2mm]
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   169
  \footnotesize Boolos, Burgess and Jeffrey\\[2mm]
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   170
  \end{tabular}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   171
  \end{center}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   172
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   173
  \item found an inconsistency in the definition of halting computations
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   174
  (Chap.~3 vs Chap.~8)
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   175
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   176
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   177
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   178
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   179
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   180
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   181
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   182
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   183
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   184
  \begin{frame}[c]
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   185
  \frametitle{Some Previous Works}%
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   186
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   187
  \begin{itemize}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   188
  \item Norrish formalised computability theory in HOL starting
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   189
  from the lambda-calculus\smallskip 
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   190
  \begin{itemize}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   191
  \item \textcolor{gray}{for technical reasons we could not follow him}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   192
  \item \textcolor{gray}{some proofs use TMs (Wang tilings)}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   193
  \end{itemize}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   194
  \bigskip
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   195
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   196
  \item Asperti and Ricciotti formalised TMs in Matita\smallskip
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   197
  \begin{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   198
  \item \textcolor{gray}{no undecidability $\Rightarrow$ interest in complexity}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   199
  \item \textcolor{gray}{their UTM operates on a different alphabet than the TMs it simulates.}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   200
  \begin{quote}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   201
  \textcolor{gray}{"In particular, the fact that the universal machine operates with a different 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   202
  alphabet with respect to the machines it simulates is annoying." [Asperti and Ricciotti]}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   203
  \end{quote}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   204
  \end{itemize}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   205
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   206
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   207
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   208
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   209
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   210
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   211
text_raw {*
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   212
  \tikzstyle{every node}=[node distance=25mm,text height=1.5ex, text depth=.25ex]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   213
  \tikzstyle{node1}=[rectangle, minimum size=12mm, rounded corners=3mm, very thick, 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   214
                     draw=black!50, top color=white, bottom color=black!20]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   215
  \tikzstyle{node2}=[rectangle, minimum size=12mm, rounded corners=3mm, very thick, 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   216
                     draw=red!70, top color=white, bottom color=red!50!black!20]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   217
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   218
  \mode<presentation>{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   219
  \begin{frame}[c]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   220
  \frametitle{The Big Picture}%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   221
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   222
  \begin{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   223
  \begin{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   224
  \matrix[ampersand replacement=\&,column sep=13mm, row sep=5mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   225
  { \node (def1)   [node1] {\large\hspace{1mm}TMs\hspace{1mm}\mbox{}}; \&
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   226
    \node (proof1) [node1] {\begin{tabular}{c}Register\\Machines\end{tabular}}; \&
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   227
    \node (alg1)   [node1] {\begin{tabular}{c}Recursive\\ Functions\end{tabular}}; \\    
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   228
  };
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   229
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   230
  \draw[->,black!50,line width=2mm] (proof1) -- (def1);
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   231
  \draw[<-,black!50,line width=2mm] (proof1) -- (alg1);
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   232
  
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   233
  \end{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   234
  \end{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   235
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   236
  \only<2->{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   237
  \begin{textblock}{3}(8.3,4.0)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   238
  \begin{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   239
  \node at (0,0) [single arrow, shape border rotate=270, fill=black!50,text=white]{};
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   240
  \draw (0,1) node {\begin{tabular}{l}verified\\[-1mm] translator\end{tabular}};
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   241
  \end{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   242
  \end{textblock}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   243
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   244
  \begin{textblock}{3}(3.1,4.0)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   245
  \begin{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   246
  \node at (0,0) [single arrow, shape border rotate=270, fill=black!50,text=white]{};
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   247
  \draw (0,1) node {\begin{tabular}{l}verified\\[-1mm] translator\end{tabular}};
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   248
  \end{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   249
  \end{textblock}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   250
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   251
  \only<3->{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   252
  \begin{textblock}{4}(10.9,9.4)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   253
  \begin{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   254
  \draw (0,0) node {\begin{tabular}{l}UF\end{tabular}};
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   255
  \end{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   256
  \end{textblock}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   257
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   258
  \begin{textblock}{3}(1,10.0)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   259
  \begin{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   260
  \draw (0,0) node {\small\begin{tabular}{l}undecidabilty\\of the halting\\ problem\end{tabular}};
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   261
  \end{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   262
  \end{textblock}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   263
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   264
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   265
  \end{frame}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   266
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   267
*}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   268
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   269
text_raw {*
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   270
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   271
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   272
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   273
  \frametitle{Turing Machines}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   274
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   275
  \begin{itemize}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   276
  \item tapes are lists and contain @{text 0}s or @{text 1}s only
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   277
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   278
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   279
\begin{tikzpicture}[scale=1]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   280
  \draw[very thick] (-3.0,0)   -- ( 3.0,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   281
  \draw[very thick] (-3.0,0.5) -- ( 3.0,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   282
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   283
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   284
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   285
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   286
  \draw[very thick] (-1.25,0)   -- (-1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   287
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   288
  \draw[very thick] (-1.75,0)   -- (-1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   289
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   290
  \draw[very thick] ( 3.0,0)   -- ( 3.0,0.5);
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   291
  \draw[very thick] (-3.0,0)   -- (-3.0,0.5);
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   292
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   293
  \draw[fill]     (1.35,0.1) rectangle (1.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   294
  \draw[fill]     (0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   295
  \draw[fill]     (-0.35,0.1) rectangle (-0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   296
  \draw[fill]     (-1.65,0.1) rectangle (-1.35,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   297
  \draw (-0.25,0.8) -- (-0.25,-0.8);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   298
  \draw[<->] (-1.25,-0.7) -- (0.75,-0.7);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   299
  \node [anchor=base] at (-0.85,-0.5) {\small left list\;\;\;\;\mbox{}};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   300
  \node [anchor=base] at (0.40,-0.5) {\small \mbox{}\;\;\;\;right list};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   301
  \node [anchor=base] at (0.1,0.7) {\small \;\;head};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   302
  \node [anchor=base] at (-2.2,0.2) {\ldots};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   303
  \node [anchor=base] at ( 2.3,0.2) {\ldots};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   304
  \end{tikzpicture}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   305
  \end{center}\pause
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   306
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   307
  \item @{text steps} function:
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   308
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   309
  \begin{quote}\rm
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   310
  What does the TM claclulate after it has executed @{text n} steps?
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   311
  \end{quote}\pause
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   312
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   313
  \item designate the @{text 0}-state as "halting state" and remain there 
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   314
  forever, i.e.~have a @{text Nop}-action
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   315
  \end{itemize}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   316
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   317
  \end{frame}}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   318
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   319
*}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   320
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   321
text_raw {*
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   322
  
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   323
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   324
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   325
  \mode<presentation>{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   326
  \begin{frame}[c]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   327
  \frametitle{Register Machines}%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   328
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   329
  \begin{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   330
  \item programs are lists of instructions
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   331
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   332
  \begin{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   333
  \begin{tabular}{@ {}rcl@ {\hspace{8mm}}l}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   334
  @{text "I"} & $::=$  & @{term "Goto L\<iota>"}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   335
  & \textcolor{black!60}{jump to instruction @{text L}}\\[1mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   336
  & $\mid$ & @{term "Inc R\<iota>"} & \textcolor{black!60}{increment register @{text "R"} by one}\\[1mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   337
  & $\mid$ & @{term "Dec R\<iota> L\<iota>"} & \textcolor{black!60}{if content of @{text R} is non-zero,}\\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   338
  & & & \textcolor{black!60}{then decrement it by one}\\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   339
  & & & \textcolor{black!60}{otherwise jump to instruction @{text L}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   340
  \end{tabular}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   341
  \end{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   342
  \end{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   343
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   344
  \only<2->{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   345
  \begin{textblock}{4}(0.3,4.2)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   346
  \begin{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   347
  \node[ellipse callout, fill=red] at (0, 0){\textcolor{yellow}{Spaghetti Code!}};
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   348
  \end{tikzpicture}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   349
  \end{textblock}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   350
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   351
  \end{frame}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   352
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   353
*}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   354
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   355
text_raw {*
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   356
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   357
  \mode<presentation>{
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   358
  \begin{frame}[c]
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   359
  \frametitle{Recursive Functions}%
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   360
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   361
  \begin{itemize}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   362
  \item[] 
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   363
  \begin{center}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   364
  \begin{tabular}{@ {}rcl@ {\hspace{8mm}}l}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   365
  @{text "rec"} & $::=$  & @{term "Z"} & \textcolor{black!60}{zero-function}\\[1mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   366
  & $\mid$ & @{term "S"} & \textcolor{black!60}{successor-function}\\[1mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   367
  & $\mid$ & @{term "id n m"} & \textcolor{black!60}{projection}\\[1mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   368
  & $\mid$ & @{term "Cn n f gs"} & \textcolor{black!60}{composition}\\[1mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   369
  & $\mid$ & @{term "Pr n f g"} & \textcolor{black!60}{primitive recursion}\\[1mm]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   370
  & $\mid$ & @{term "Mn n f"} & \textcolor{black!60}{minimisation}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   371
  \end{tabular}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   372
  \end{center}\bigskip
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   373
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   374
  \item @{text "eval :: rec \<Rightarrow> nat list \<Rightarrow> nat"}\\ 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   375
  can be defined by simple recursion\\ (HOL has @{term "Least"})
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   376
  
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   377
  \item \small you define
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   378
  \begin{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   379
  \item addition, multiplication, logical operations, quantifiers\ldots
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   380
  \item coding of numbers (Cantor encoding), UTM
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   381
  \end{itemize}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   382
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   383
  \end{itemize}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   384
  
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   385
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   386
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   387
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   388
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   389
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   390
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   391
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   392
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   393
  \begin{frame}[c]
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   394
  \frametitle{Copy Turing Machine}%
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   395
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   396
  \begin{itemize}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   397
  \item TM that copies a number on the input tape\smallskip
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   398
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   399
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   400
  \begin{center}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   401
  \begin{tikzpicture}[scale=0.7]
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   402
  \node [anchor=base] at (2.2,0.1) {\small$\Rightarrow$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   403
  \node [anchor=base] at (5.6,0.1) {\small$\Rightarrow$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   404
  \node [anchor=base] at (10.5,0.1) {\small$\Rightarrow$};
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   405
  \node [anchor=base] at (2.2,-0.8) {\small$\overbrace{@{text cbegin}}^{}$};
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   406
  \node [anchor=base] at (5.6,-0.8) {\small$\overbrace{@{text cloop}}^{}$};
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   407
  \node [anchor=base] at (10.5,-0.8) {\small$\overbrace{@{text cend}}^{}$};
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   408
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   409
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   410
  \begin{scope}[shift={(0.5,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   411
  \draw[very thick] (-0.25,0)   -- ( 1.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   412
  \draw[very thick] (-0.25,0.5) -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   413
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   414
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   415
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   416
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   417
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   418
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   419
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   420
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   421
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   422
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   423
  \begin{scope}[shift={(2.9,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   424
  \draw[very thick] (-0.25,0)   -- ( 2.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   425
  \draw[very thick] (-0.25,0.5) -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   426
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   427
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   428
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   429
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   430
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   431
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   432
  \draw[rounded corners=1mm] (0.15,-0.1) rectangle (0.85,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   433
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   434
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   435
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   436
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   437
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   438
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   439
  \begin{scope}[shift={(6.8,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   440
  \draw[very thick] (-0.75,0)   -- ( 3.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   441
  \draw[very thick] (-0.75,0.5) -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   442
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   443
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   444
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   445
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   446
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   447
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   448
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   449
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   450
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   451
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   452
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   453
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   454
  \draw[fill]     ( 2.85,0.1) rectangle (3.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   455
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   456
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   457
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   458
  \begin{scope}[shift={(11.7,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   459
  \draw[very thick] (-0.75,0)   -- ( 3.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   460
  \draw[very thick] (-0.75,0.5) -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   461
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   462
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   463
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   464
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   465
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   466
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   467
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   468
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   469
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   470
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   471
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   472
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   473
  \draw[fill]     ( 2.85,0.1) rectangle (3.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   474
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   475
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   476
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   477
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   478
  \end{tikzpicture}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   479
  \end{center}\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   480
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   481
  \footnotesize
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   482
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   483
  \begin{tabular}{@ {\hspace{-8mm}}c@ {\hspace{2mm}}c@ {\hspace{2mm}}c}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   484
  \multicolumn{3}{@ {\hspace{-8mm}}l}{\small@{text "copy \<equiv> cbegin ; cloop ; cend"}}\\[4mm]
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   485
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   486
  @{text cbegin} @{text "\<equiv>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   487
  \hspace{2mm}@{text "["}@{text "(W\<^bsub>0\<^esub>, 0), (R, 2), (R, 3),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   488
  \hspace{2mm}\phantom{@{text "["}}@{text "(R, 2), (W\<^bsub>1\<^esub>, 3), (L, 4),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   489
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 4), (L, 0)"}@{text "]"} 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   490
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   491
  &
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   492
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   493
  @{text cloop} @{text "\<equiv>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   494
  \hspace{2mm}@{text "["}@{text "(R, 0), (R, 2), (R, 3),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   495
  \hspace{2mm}\phantom{@{text "["}}@{text "(W\<^bsub>0\<^esub>, 2), (R, 3), (R, 4),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   496
  \hspace{2mm}\phantom{@{text "["}}@{text "(W\<^bsub>1\<^esub>, 5), (R, 4), (L, 6),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   497
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5), (L, 6), (L, 1)"}@{text "]"} 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   498
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   499
  &
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   500
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   501
  @{text cend} @{text "\<equiv>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   502
  \hspace{2mm}@{text "["}@{text "(L, 0), (R, 2), (W\<^bsub>1\<^esub>, 3),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   503
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 4), (R, 2), (R, 2),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   504
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5), (W\<^bsub>0\<^esub>, 4), (R, 0),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   505
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5)"}@{text "]"} 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   506
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   507
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   508
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   509
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   510
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   511
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   512
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   513
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   514
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   515
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   516
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   517
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   518
  \definecolor{mygrey}{rgb}{.80,.80,.80}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   519
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   520
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   521
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   522
  \frametitle{Hoare Logic for TMs}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   523
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   524
  \begin{itemize}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   525
  \item Hoare-triples\onslide<2>{ and Hoare-pairs:}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   526
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   527
  \small
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   528
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   529
  \begin{tabular}{@ {\hspace{-6mm}}c@ {\hspace{-3mm}}c@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   530
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   531
  \colorbox{mygrey}{@{thm (lhs) Hoare_halt_def}} @{text "\<equiv>"}\\[1mm]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   532
  \hspace{5mm}@{text "\<forall>"}@{term "tp"}.\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   533
  \hspace{7mm}if @{term "P tp"} holds then\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   534
  \hspace{7mm}@{text "\<exists>"}@{term n}. such that\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   535
  \hspace{7mm}@{text "is_final (steps (1, tp) p n)"} \hspace{1mm}@{text "\<and>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   536
  \hspace{7mm}@{text "Q holds_for (steps (1, tp) p n)"}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   537
  \end{tabular} &
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   538
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   539
  \onslide<2>{
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   540
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   541
  \colorbox{mygrey}{@{thm (lhs) Hoare_unhalt_def}} @{text "\<equiv>"}\\[1mm]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   542
  \hspace{5mm}@{text "\<forall>"}@{term "tp"}.\\ 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   543
  \hspace{7mm}if @{term "P tp"} holds then\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   544
  \hspace{7mm}@{text "\<forall>"}@{term n}. @{text "\<not> is_final (steps (1, tp) p n)"}
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   545
  \end{tabular}}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   546
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   547
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   548
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   549
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   550
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   551
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   552
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   553
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   554
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   555
(*<*)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   556
lemmas HR1 = 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   557
  Hoare_plus_halt[where ?S.0="R\<iota>" and ?A="p\<^isub>1" and B="p\<^isub>2"]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   558
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   559
lemmas HR2 =
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   560
  Hoare_plus_unhalt[where ?A="p\<^isub>1" and B="p\<^isub>2"]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   561
(*>*)
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   562
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   563
text_raw {*
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   564
  \definecolor{mygrey}{rgb}{.80,.80,.80}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   565
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   566
  \mode<presentation>{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   567
  \begin{frame}[c]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   568
  \frametitle{Some Derived Rules}%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   569
  \large
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   570
  
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   571
  \begin{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   572
  @{thm[mode=Rule] Hoare_consequence}\bigskip\bigskip\\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   573
  
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   574
  \begin{tabular}{@ {\hspace{-5mm}}c@ {\hspace{4mm}}c@ {}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   575
  $\inferrule*
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   576
  {@{thm (prem 1) HR1} \\ @{thm (prem 2) HR1}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   577
  {@{thm (concl) HR1}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   578
  $ &
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   579
  $
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   580
  \inferrule*
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   581
  {@{thm (prem 1) HR2} \\ @{thm (prem 2) HR2}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   582
  {@{thm (concl) HR2}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   583
  $
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   584
  \end{tabular}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   585
  \end{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   586
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   587
  \end{frame}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   588
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   589
*}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   590
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   591
text_raw {*
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   592
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   593
  \mode<presentation>{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   594
  \begin{frame}[t]
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   595
  \frametitle{Undecidability}%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   596
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   597
  \begin{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   598
  @{thm tcontra_def}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   599
  \end{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   600
  
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   601
  \only<2>{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   602
  \begin{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   603
  \item Suppose @{text H} decides @{text contra} called with code 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   604
  of @{text contra} halts, then\smallskip
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   605
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   606
  \begin{center}\small
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   607
  \begin{tabular}{@ {}l@ {}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   608
  \begin{tabular}[t]{@ {\hspace{-5mm}}l@ {}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   609
  @{term "P\<^isub>1 \<equiv> \<lambda>tp. tp = ([]::cell list, <code_tcontra>)"}\\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   610
  @{term "P\<^isub>2 \<equiv> \<lambda>tp. tp = ([Bk], <(code_tcontra, code_tcontra)>)"}\\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   611
  @{term "P\<^isub>3 \<equiv> \<lambda>tp. \<exists>k. tp = (Bk \<up> k, <0::nat>)"}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   612
  \end{tabular}\bigskip\bigskip
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   613
  \\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   614
  \begin{tabular}[b]{@ {\hspace{20mm}}l@ {}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   615
  $\inferrule*{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   616
    \inferrule*{@{term "{P\<^isub>1} tcopy {P\<^isub>2}"} \\ @{term "{P\<^isub>2} H {P\<^isub>3}"}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   617
    {@{term "{P\<^isub>1} (tcopy |+| H) {P\<^isub>3}"}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   618
    \\ @{term "{P\<^isub>3} dither \<up>"}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   619
   }
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   620
   {@{term "{P\<^isub>1} tcontra \<up>"}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   621
  $
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   622
  \end{tabular}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   623
  \end{tabular}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   624
  \end{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   625
  \end{itemize}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   626
  \only<3>{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   627
  \begin{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   628
  \item Suppose @{text H} decides @{text contra} called with code 
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   629
  of @{text contra} does \emph{not} halt, then\smallskip
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   630
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   631
  \begin{center}\small
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   632
  \begin{tabular}{@ {}l@ {}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   633
  \begin{tabular}[t]{@ {\hspace{-5mm}}l@ {}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   634
  @{term "Q\<^isub>1 \<equiv> \<lambda>tp. tp = ([]::cell list, <code_tcontra>)"}\\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   635
  @{term "Q\<^isub>2 \<equiv> \<lambda>tp. tp = ([Bk], <(code_tcontra, code_tcontra)>)"}\\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   636
  @{term "Q\<^isub>3 \<equiv> \<lambda>tp. \<exists>k. tp = (Bk \<up> k, <1::nat>)"}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   637
  \end{tabular}\bigskip\bigskip
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   638
  \\
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   639
  \begin{tabular}[b]{@ {\hspace{20mm}}l@ {}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   640
  $\inferrule*{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   641
    \inferrule*{@{term "{Q\<^isub>1} tcopy {Q\<^isub>2}"} \\ @{term "{Q\<^isub>2} H {Q\<^isub>3}"}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   642
    {@{term "{Q\<^isub>1} (tcopy |+| H) {Q\<^isub>3}"}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   643
    \\ @{term "{Q\<^isub>3} dither {Q\<^isub>3}"}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   644
   }
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   645
   {@{term "{Q\<^isub>1} tcontra {Q\<^isub>3}"}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   646
  $
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   647
  \end{tabular}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   648
  \end{tabular}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   649
  \end{center}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   650
  \end{itemize}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   651
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   652
  \end{frame}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   653
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   654
*}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   655
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   656
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   657
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   658
  \definecolor{mygrey}{rgb}{.80,.80,.80}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   659
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   660
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   661
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   662
  \frametitle{Hoare Reasoning}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   663
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   664
  \begin{itemize}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   665
  \item reasoning is still quite demanding;\\
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   666
  the invariants of the copy-machine:\\[-5mm]\mbox{}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   667
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   668
  \footnotesize
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   669
  \begin{center}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   670
  \begin{tabular}{@ {\hspace{-5mm}}c@ {}}
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   671
  \begin{tabular}{@ {}l@ {\hspace{1mm}}c@ {\hspace{1mm}}l@ {\hspace{-0.9cm}}l@ {}}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   672
  \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   673
  @{thm (lhs) inv_begin1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin1.simps} & (starting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   674
  @{thm (lhs) inv_begin2.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin2.simps}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   675
  @{thm (lhs) inv_begin3.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin3.simps}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   676
  @{thm (lhs) inv_begin4.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin4.simps}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   677
  @{thm (lhs) inv_begin0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin01} @{text "\<or>"}& (halting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   678
                                &             & @{thm (rhs) inv_begin02}\smallskip \\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   679
   \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   680
  @{thm (lhs) inv_loop1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_loop1_loop.simps} @{text "\<or>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   681
                               &             & @{thm (rhs) inv_loop1_exit.simps} & (starting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   682
  @{thm (lhs) inv_loop0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_loop0.simps}& (halting state)\smallskip\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   683
   \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   684
  @{thm (lhs) inv_end1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_end1.simps} & (starting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   685
  @{thm (lhs) inv_end0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_end0.simps} & (halting state)\smallskip\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   686
  \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   687
  \end{tabular}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   688
  \end{tabular}
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   689
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   690
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   691
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   692
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   693
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   694
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   695
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   696
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   697
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   698
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   699
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   700
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   701
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   702
  \begin{frame}[c]
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   703
  \frametitle{Midway Conclusion}%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   704
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   705
  \begin{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   706
  \item feels awfully like reasoning about machine code
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   707
  \item compositional constructions / reasoning
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   708
  \item sizes
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   709
  
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   710
  \end{itemize}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   711
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   712
  \end{frame}}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   713
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   714
*}
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   715
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   716
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   717
text_raw {*
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   718
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   719
  \mode<presentation>{
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   720
  \begin{frame}[c]
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   721
  \frametitle{Recursive Functions}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   722
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   723
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   724
  \item addition, multiplication, \ldots
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   725
  \item logical operations, quantifiers\ldots
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   726
  \item coding of numbers (Cantor encoding)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   727
  \item UF\pause\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   728
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   729
  \item Recursive Functions $\Rightarrow$ Register Machines
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   730
  \item Register Machines $\Rightarrow$ Turing Machines
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   731
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   732
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   733
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   734
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   735
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   736
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   737
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   738
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   739
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   740
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   741
  \frametitle{Sizes}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   742
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   743
  \begin{itemize}
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   744
  \item UF (size: @{text 140843})
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   745
  \item Register Machine (size: @{text 2} Mio instructions)
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   746
  \item UTM (size: @{text 38} Mio states)
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   747
  \end{itemize}\bigskip\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   748
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   749
  \small
272
42f2c28d1ce6 new verison of the slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
   750
  old version: RM (@{text 12} Mio) UTM (@{text 112} Mio)
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   751
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   752
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   753
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   754
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   755
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   756
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   757
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   758
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   759
  \frametitle{Separation Algebra}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   760
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   761
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   762
  \item introduced a separation algebra framework for register machines and TMs 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   763
  \item we can semi-automate the reasoning for our small TMs
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   764
  \item we can assemble bigger programs out of smaller components\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   765
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   766
  \item looks awfully like ``real'' assembly code\pause
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   767
  \item Conclusion: we have a playing ground for reasoning about low-level 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   768
  code; we work on automation
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   769
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   770
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   771
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   772
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   773
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   774
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   775
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   776
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   777
(*<*)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   778
end
273
fa021a0c6984 new slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 272
diff changeset
   779
end
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   780
(*>*)