Slides/Slides3.thy
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 22 Feb 2024 13:38:10 +0000
changeset 298 ac5461882f3e
parent 287 d5a0e25c4742
permissions -rw-r--r--
test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
(*<*)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
theory Slides3
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
imports "../thys/UTM" "../thys/Abacus_Defs"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
begin
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
declare [[show_question_marks = false]]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
hide_const (open) s 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
abbreviation
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
  "update2 p a \<equiv> update a p"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
notation (Rule output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
  "==>"  ("\<^raw:\mbox{}\inferrule{\mbox{>_\<^raw:}}>\<^raw:{\mbox{>_\<^raw:}}>")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
syntax (Rule output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
  ("\<^raw:\mbox{}\inferrule{>_\<^raw:}>\<^raw:{\mbox{>_\<^raw:}}>")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
  ("\<^raw:\mbox{>_\<^raw:}\\>/ _")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
notation (Axiom output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
  "Trueprop"  ("\<^raw:\mbox{}\inferrule{\mbox{}}{\mbox{>_\<^raw:}}>")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
notation (IfThen output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
  "==>"  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
syntax (IfThen output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}> /\<^raw:{\normalsize \,>and\<^raw:\,}>/ _")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
  "_asm" :: "prop \<Rightarrow> asms" ("\<^raw:\mbox{>_\<^raw:}>")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
notation (IfThenNoBox output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
  "==>"  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _/ \<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
syntax (IfThenNoBox output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
  "_bigimpl" :: "asms \<Rightarrow> prop \<Rightarrow> prop"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
  ("\<^raw:{\normalsize{}>If\<^raw:\,}> _ /\<^raw:{\normalsize \,>then\<^raw:\,}>/ _.")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
  "_asms" :: "prop \<Rightarrow> asms \<Rightarrow> asms" ("_ /\<^raw:{\normalsize \,>and\<^raw:\,}>/ _")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
  "_asm" :: "prop \<Rightarrow> asms" ("_")
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
context uncomputable
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
begin
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
notation (latex output)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
  Cons ("_::_" [48,47] 68) and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
  append ("_@_" [65, 64] 65) and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
  Oc ("1") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
  Bk ("0") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
  exponent ("_\<^bsup>_\<^esup>" [107] 109) and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
  inv_begin0 ("I\<^sub>0") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
  inv_begin1 ("I\<^sub>1") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
  inv_begin2 ("I\<^sub>2") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
  inv_begin3 ("I\<^sub>3") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
  inv_begin4 ("I\<^sub>4") and 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
  inv_begin ("I\<^bsub>cbegin\<^esub>") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
  inv_loop1 ("J\<^sub>1") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
  inv_loop0 ("J\<^sub>0") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
  inv_end1 ("K\<^sub>1") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
  inv_end0 ("K\<^sub>0") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    62
  recf.id ("Id\<^raw:\makebox[0mm]{\,\,\,\,>\<^sup>_\<^raw:}>\<^sub>_") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
  Pr ("Pr\<^sup>_") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
  Cn ("Cn\<^sup>_") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
  Mn ("Mn\<^sup>_") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
  tcopy ("copy") and 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
  tcontra ("contra") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
  tape_of ("\<langle>_\<rangle>") and 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
  code_tcontra ("code contra") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    70
  tm_comp ("_ ; _") 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
lemma inv_begin_print:
447b433b67fa added things --- in messy state
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
447b433b67fa added things --- in messy state
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 
447b433b67fa added things --- in messy state
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 
447b433b67fa added things --- in messy state
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 
447b433b67fa added things --- in messy state
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
447b433b67fa added things --- in messy state
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"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    80
apply(case_tac [!] tp)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    81
by (auto)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    82
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    83
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    84
lemma inv1: 
447b433b67fa added things --- in messy state
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)"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    86
unfolding Turing_Hoare.assert_imp_def
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    87
unfolding inv_loop1.simps inv_begin0.simps
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    88
apply(auto)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    89
apply(rule_tac x="1" in exI)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    90
apply(auto simp add: replicate.simps)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    91
done
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    92
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    93
lemma inv2: 
447b433b67fa added things --- in messy state
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"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    95
apply(rule ext)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    96
apply(case_tac x)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    97
apply(simp add: inv_end1.simps)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    98
done
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
lemma measure_begin_print:
447b433b67fa added things --- in messy state
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
447b433b67fa added things --- in messy state
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
447b433b67fa added things --- in messy state
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 
447b433b67fa added things --- in messy state
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"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
by (simp_all)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   107
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   108
lemma inv_begin01:
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   109
  assumes "n > 1"
447b433b67fa added things --- in messy state
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]))"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   111
using assms by auto                          
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   112
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   113
lemma inv_begin02:
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   114
  assumes "n = 1"
447b433b67fa added things --- in messy state
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]))"
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   116
using assms by auto
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   117
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   118
(*>*)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   119
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   120
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   121
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   122
text_raw {*
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   123
  \renewcommand{\slidecaption}{Imperial College, 24 November 2013}
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   124
  \newcommand{\bl}[1]{#1}                        
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   125
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   126
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   127
  \begin{frame}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   128
  \frametitle{%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   129
  \begin{tabular}{@ {}c@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   130
  \\[-3mm]
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   131
  {\fontsize{30}{30}\selectfont{}Turing Machines and}\\[-1mm]  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   132
  {\fontsize{30}{30}\selectfont{}Separation Logic}\\[0mm]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   133
  {\fontsize{22}{22}\selectfont{}(Work in Progress)}\\[-3mm] 
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   134
  \end{tabular}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   135
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   136
  \bigskip\medskip\medskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   137
 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   138
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   139
  \begin{tabular}{c@ {\hspace{1cm}}c}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   140
  \includegraphics[scale=0.29]{jian.jpg}  &
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   141
  \includegraphics[scale=0.034]{xingyuan.jpg} \\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   142
  Jian Xu & Xingyuan Zhang\\[-3mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   143
  \end{tabular}\\[3mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   144
  \small PLA University of Science and Technology
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   145
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   146
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   147
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   148
  Christian Urban\\[0mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   149
  \small King's College London
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   150
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   151
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   152
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   153
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   154
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   155
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   156
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   157
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   158
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   159
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   160
  \frametitle{Why Turing Machines?}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   161
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   162
  \begin{itemize}
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   163
  \item we wanted to formalise computability theory
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   164
  \item at the beginning, it was just a student project\smallskip
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   165
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   166
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   167
  \begin{tabular}{c}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   168
  \includegraphics[scale=0.3]{boolos.jpg}\\[-2mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   169
  \footnotesize Computability and Logic (5th.~ed)\\[-2mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   170
  \footnotesize Boolos, Burgess and Jeffrey\\[2mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   171
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   172
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   173
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   174
  \item found an inconsistency in the definition of halting computations
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   175
  (Chap.~3 vs Chap.~8)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   176
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   177
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   178
  \only<2->{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   179
  \begin{textblock}{1}(0.7,4)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   180
  \begin{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   181
  \draw (0,0) node[inner sep=2mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   182
  {\normalsize
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   183
  \begin{minipage}{11cm}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   184
  \begin{quote}\rm
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   185
  \begin{itemize}
287
d5a0e25c4742 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 286
diff changeset
   186
  \item TMs are a fantastic model of low-level code
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   187
  \item completely unstructured\makebox[0mm][10mm]{\mbox{}}\;\; 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   188
  \only<2>{\textcolor{cream}{\fontspec{Chalkduster}Spaghetti Code}}%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   189
  \only<3->{\textcolor{red}{\fontspec{Chalkduster}Spaghetti Code}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   190
  \bigskip
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   191
  \item good testbed for verification techniques
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   192
  \item Can we verify a program with 38 Mio instructions?
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   193
  \item we can delay implementing a concrete machine model (for OS/low-level code verification)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   194
  \end{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   195
  \end{quote}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   196
  \end{minipage}};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   197
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   198
  \end{textblock}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   199
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   200
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   201
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   202
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   203
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   204
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   205
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   206
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   207
  \begin{frame}[c]
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   208
  \frametitle{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   209
  \begin{tabular}{c}Some Previous Works\\[-5mm]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   210
  \hspace{3.5cm}\small (but not interested in low-level code)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   211
  \end{tabular}}%
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   212
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   213
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   214
  \item Norrish formalised computability theory in HOL starting
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   215
  from the lambda-calculus\smallskip 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   216
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   217
  \item \textcolor{gray}{for technical reasons we could not follow his work}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   218
  \item \textcolor{gray}{some proofs use TMs (Wang tilings)}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   219
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   220
  \bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   221
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   222
  \item Asperti and Ricciotti formalised TMs in Matita\smallskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   223
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   224
  \item \textcolor{gray}{no undecidability result $\Rightarrow$ interest in complexity}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   225
  \item \textcolor{gray}{their UTM operates on a different alphabet than the TMs it simulates}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   226
  \begin{quote}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   227
  \textcolor{gray}{"In particular, the fact that the universal machine operates with a different 
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   228
  alphabet with respect to the machines it simulates is annoying." (Asperti and Ricciotti)}
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   229
  \end{quote}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   230
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   231
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   232
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   233
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   234
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   235
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   236
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   237
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   238
  \tikzstyle{every node}=[node distance=25mm,text height=1.5ex, text depth=.25ex]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   239
  \tikzstyle{node1}=[rectangle, minimum size=12mm, rounded corners=3mm, very thick, 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   240
                     draw=black!50, top color=white, bottom color=black!20]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   241
  \tikzstyle{node2}=[rectangle, minimum size=12mm, rounded corners=3mm, very thick, 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   242
                     draw=red!70, top color=white, bottom color=red!50!black!20]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   243
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   244
  \mode<presentation>{
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   245
  \begin{frame}[t]
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   246
  \frametitle{The Big Picture}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   247
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   248
  \mbox{}\\[19mm]
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   249
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   250
  \begin{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   251
  \matrix[ampersand replacement=\&,column sep=13mm, row sep=5mm]
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   252
  { \node (tm)   [node1] {\large\hspace{1mm}TMs\hspace{1mm}\mbox{}}; \&
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   253
    \node (reg) [node1] {\begin{tabular}{c}Register\\Machines\end{tabular}}; \&
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   254
    \node (rf)   [node1] {\begin{tabular}{c}Recursive\\ Functions\end{tabular}}; \\    
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   255
  };
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   256
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   257
  \only<2->{\draw[->,black!50,line width=2mm] (reg) -- (tm);}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   258
  \only<2->{\draw[<-,black!50,line width=2mm] (reg) -- (rf);}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   259
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   260
  \only<4->{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   261
   \draw [<-, black!50,line width=2mm, rounded corners]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   262
     %  start right of digit.east, that is, at the point that is the
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   263
     %  linear combination of digit.east and the vector (2mm,0pt). We
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   264
     %  use the ($ ... $) notation for computing linear combinations
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   265
     ($ (rf.south) + (0mm,0) $)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   266
     %  Now go down
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   267
     -- ++(0,-2.5)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   268
     %  And back to the left of digit.west
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   269
     -| ($ (tm.south) - (0mm,0) $);}
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   270
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   271
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   272
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   273
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   274
  \only<1->{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   275
  \begin{textblock}{3}(1,4.9)
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   276
  \begin{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   277
  \draw (0,0) node {\small\begin{tabular}{l}undecidability\\of the halting\\ problem\end{tabular}};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   278
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   279
  \end{textblock}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   280
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   281
  \only<2->{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   282
  \begin{textblock}{3}(8.3,8.4)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   283
  \begin{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   284
  \node at (0,0) [single arrow, shape border rotate=90, fill=black!50,text=white]{};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   285
  \draw (0,-1) node {\begin{tabular}{l}verified\\[-1mm] translator\end{tabular}};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   286
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   287
  \end{textblock}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   288
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   289
  \begin{textblock}{3}(3.1,8.4)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   290
  \begin{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   291
  \node at (0,0) [single arrow, shape border rotate=90, fill=black!50,text=white]{};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   292
  \draw (0,-1) node {\begin{tabular}{l}verified\\[-1mm] translator\end{tabular}};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   293
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   294
  \end{textblock}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   295
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   296
  \only<3->{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   297
  \begin{textblock}{4}(12.5,5.8)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   298
  \begin{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   299
  \draw (0,0) node {\begin{tabular}{l}UF\end{tabular}};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   300
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   301
  \end{textblock}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   302
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   303
  \only<4->{
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   304
  \begin{textblock}{4}(3.3,13.3)
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   305
  \begin{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   306
  \draw (0,0) node {\begin{tabular}{l}a correct UTM by translation\end{tabular}};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   307
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   308
  \end{textblock}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   309
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   310
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   311
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   312
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   313
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   314
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   315
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   316
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   317
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   318
  \frametitle{Turing Machines}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   319
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   320
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   321
  \item tapes are lists and contain @{text 0}s or @{text 1}s only
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   322
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   323
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   324
\begin{tikzpicture}[scale=1]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   325
  \draw[very thick] (-3.0,0)   -- ( 3.0,0);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   326
  \draw[very thick] (-3.0,0.5) -- ( 3.0,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   327
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   328
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   329
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   330
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   331
  \draw[very thick] (-1.25,0)   -- (-1.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   332
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   333
  \draw[very thick] (-1.75,0)   -- (-1.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   334
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   335
  \draw[very thick] ( 3.0,0)   -- ( 3.0,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   336
  \draw[very thick] (-3.0,0)   -- (-3.0,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   337
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   338
  \draw[fill]     (1.35,0.1) rectangle (1.65,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   339
  \draw[fill]     (0.85,0.1) rectangle (1.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   340
  \draw[fill]     (-0.35,0.1) rectangle (-0.65,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   341
  \draw[fill]     (-1.65,0.1) rectangle (-1.35,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   342
  \draw (-0.25,0.8) -- (-0.25,-0.8);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   343
  \draw[<->] (-1.25,-0.7) -- (0.75,-0.7);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   344
  \node [anchor=base] at (-0.85,-0.5) {\small left list\;\;\;\;\mbox{}};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   345
  \node [anchor=base] at (0.40,-0.5) {\small \mbox{}\;\;\;\;right list};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   346
  \node [anchor=base] at (0.1,0.7) {\small \;\;head};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   347
  \node [anchor=base] at (-2.2,0.2) {\ldots};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   348
  \node [anchor=base] at ( 2.3,0.2) {\ldots};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   349
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   350
  \end{center}\pause
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   351
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   352
  \item @{text steps} function:
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   353
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   354
  \begin{quote}\rm
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   355
  What does the TM calculate after it has executed @{text n} steps?
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   356
  \end{quote}\pause
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   357
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   358
  \item designate the @{text 0}-state as "halting state" and remain there 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   359
  forever, i.e.~have a @{text Nop}-action
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   360
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   361
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   362
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   363
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   364
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   365
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   366
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   367
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   368
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   369
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   370
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   371
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   372
  \frametitle{Register Machines}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   373
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   374
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   375
  \item programs are lists of instructions
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   376
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   377
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   378
  \begin{tabular}{@ {}rcl@ {\hspace{8mm}}l}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   379
  @{text "I"} & $::=$  & @{term "Goto L\<iota>"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   380
  & \textcolor{black!60}{jump to instruction @{text L}}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   381
  & $\mid$ & @{term "Inc R\<iota>"} & \textcolor{black!60}{increment register @{text "R"} by one}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   382
  & $\mid$ & @{term "Dec R\<iota> L\<iota>"} & \textcolor{black!60}{if the content of @{text R} is non-zero,}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   383
  & & & \textcolor{black!60}{then decrement it by one}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   384
  & & & \textcolor{black!60}{otherwise jump to instruction @{text L}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   385
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   386
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   387
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   388
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   389
  \only<2->{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   390
  \begin{textblock}{4}(0.3,11.8)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   391
  \begin{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   392
  \node[ellipse callout, fill=red, callout absolute pointer={(-0.2,1)}] 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   393
   at (0, 0){\large\fontspec{Chalkduster}\textcolor{yellow}{Spaghetti Code!}};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   394
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   395
  \end{textblock}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   396
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   397
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   398
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   399
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   400
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   401
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   402
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   403
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   404
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   405
  \frametitle{Recursive Functions}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   406
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   407
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   408
  \item[] 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   409
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   410
  \begin{tabular}{@ {}rcl@ {\hspace{8mm}}l}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   411
  @{text "rec"} & $::=$  & @{term "Z"} & \textcolor{black!60}{zero-function}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   412
  & $\mid$ & @{term "S"} & \textcolor{black!60}{successor-function}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   413
  & $\mid$ & @{term "id n m"} & \textcolor{black!60}{projection}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   414
  & $\mid$ & @{term "Cn n f gs"} & \textcolor{black!60}{composition}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   415
  & $\mid$ & @{term "Pr n f g"} & \textcolor{black!60}{primitive recursion}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   416
  & $\mid$ & @{term "Mn n f"} & \textcolor{black!60}{minimisation}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   417
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   418
  \end{center}\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   419
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   420
  \item @{text "eval :: rec \<Rightarrow> nat list \<Rightarrow> nat"}\\ 
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   421
  \hspace{3mm}can be defined by recursion (HOL has @{term "Least"})
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   422
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   423
  \item \small you define
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   424
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   425
  \item addition, multiplication, logical operations, quantifiers\ldots
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   426
  \item coding of numbers (Cantor encoding), UF
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   427
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   428
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   429
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   430
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   431
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   432
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   433
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   434
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   435
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   436
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   437
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   438
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   439
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   440
  \frametitle{Copy Turing Machine}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   441
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   442
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   443
  \item TM that copies a number on the input tape
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   444
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   445
  @{text "copy \<equiv> cbegin ; cloop ; cend"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   446
  \end{center}\smallskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   447
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   448
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   449
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   450
  \begin{tikzpicture}[scale=0.7]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   451
  \node [anchor=base] at (2.2,0.1) {\small$\Rightarrow$};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   452
  \node [anchor=base] at (5.6,0.1) {\small$\Rightarrow$};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   453
  \node [anchor=base] at (10.5,0.1) {\small$\Rightarrow$};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   454
  \node [anchor=base] at (2.2,-0.8) {\small$\overbrace{@{text cbegin}}^{}$};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   455
  \node [anchor=base] at (5.6,-0.8) {\small$\overbrace{@{text cloop}}^{}$};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   456
  \node [anchor=base] at (10.5,-0.8) {\small$\overbrace{@{text cend}}^{}$};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   457
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   458
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   459
  \begin{scope}[shift={(0.5,0)}]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   460
  \draw[very thick] (-0.25,0)   -- ( 1.25,0);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   461
  \draw[very thick] (-0.25,0.5) -- ( 1.25,0.5);
447b433b67fa added things --- in messy state
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);
447b433b67fa added things --- in messy state
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);
447b433b67fa added things --- in messy state
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);
447b433b67fa added things --- in messy state
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);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   466
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   467
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   468
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   469
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   470
  \end{scope}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   471
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   472
  \begin{scope}[shift={(2.9,0)}]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   473
  \draw[very thick] (-0.25,0)   -- ( 2.25,0);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   474
  \draw[very thick] (-0.25,0.5) -- ( 2.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   475
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   476
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   477
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   478
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   479
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   480
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   481
  \draw[rounded corners=1mm] (0.15,-0.1) rectangle (0.85,0.6);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   482
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   483
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   484
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   485
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   486
  \end{scope}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   487
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   488
  \begin{scope}[shift={(6.8,0)}]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   489
  \draw[very thick] (-0.75,0)   -- ( 3.25,0);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   490
  \draw[very thick] (-0.75,0.5) -- ( 3.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   491
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   492
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   493
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   494
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   495
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   496
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   497
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   498
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   499
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   500
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   501
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   502
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   503
  \draw[fill]     ( 2.85,0.1) rectangle (3.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   504
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   505
  \end{scope}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   506
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   507
  \begin{scope}[shift={(11.7,0)}]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   508
  \draw[very thick] (-0.75,0)   -- ( 3.25,0);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   509
  \draw[very thick] (-0.75,0.5) -- ( 3.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   510
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   511
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   512
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   513
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   514
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   515
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   516
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   517
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   518
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   519
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   520
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   521
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   522
  \draw[fill]     ( 2.85,0.1) rectangle (3.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   523
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   524
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   525
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   526
  \end{scope}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   527
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   528
  \end{center}\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   529
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   530
  \footnotesize
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   531
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   532
  \begin{tabular}{@ {\hspace{-8mm}}c@ {\hspace{2mm}}c@ {\hspace{2mm}}c}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   533
  \begin{tabular}[t]{@ {}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   534
  @{text cbegin} @{text "\<equiv>"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   535
  \hspace{2mm}@{text "["}@{text "(W\<^bsub>0\<^esub>, 0), (R, 2), (R, 3),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   536
  \hspace{2mm}\phantom{@{text "["}}@{text "(R, 2), (W\<^bsub>1\<^esub>, 3), (L, 4),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   537
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 4), (L, 0)"}@{text "]"} 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   538
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   539
  &
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   540
  \begin{tabular}[t]{@ {}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   541
  @{text cloop} @{text "\<equiv>"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   542
  \hspace{2mm}@{text "["}@{text "(R, 0), (R, 2), (R, 3),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   543
  \hspace{2mm}\phantom{@{text "["}}@{text "(W\<^bsub>0\<^esub>, 2), (R, 3), (R, 4),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   544
  \hspace{2mm}\phantom{@{text "["}}@{text "(W\<^bsub>1\<^esub>, 5), (R, 4), (L, 6),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   545
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5), (L, 6), (L, 1)"}@{text "]"} 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   546
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   547
  &
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   548
  \begin{tabular}[t]{@ {}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   549
  @{text cend} @{text "\<equiv>"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   550
  \hspace{2mm}@{text "["}@{text "(L, 0), (R, 2), (W\<^bsub>1\<^esub>, 3),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   551
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 4), (R, 2), (R, 2),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   552
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5), (W\<^bsub>0\<^esub>, 4), (R, 0),"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   553
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5)"}@{text "]"} 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   554
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   555
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   556
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   557
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   558
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   559
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   560
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   561
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   562
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   563
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   564
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   565
text_raw {*
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   566
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   567
  \mode<presentation>{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   568
  \begin{frame}[c]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   569
  \frametitle{Dither Machine}%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   570
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   571
  \begin{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   572
  \item TM that is the identity with @{text "1"} and loops with @{text "0"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   573
  \smallskip
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   574
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   575
\begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   576
  \begin{tabular}{l@ {\hspace{3mm}}lcl}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   577
  & \multicolumn{1}{c}{start tape}\\[1mm]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   578
  \raisebox{2mm}{halting case:} &
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   579
  \begin{tikzpicture}[scale=0.8]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   580
  \draw[very thick] (-2,0)   -- ( 0.75,0);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   581
  \draw[very thick] (-2,0.5) -- ( 0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   582
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   583
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   584
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   585
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   586
  \draw[very thick] (-1.25,0)   -- (-1.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   587
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   588
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   589
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   590
  \node [anchor=base] at (-1.7,0.2) {\ldots};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   591
  \end{tikzpicture} 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   592
  & \raisebox{2mm}{$\;\;\large\Rightarrow\;\;$} &
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   593
  \begin{tikzpicture}[scale=0.8]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   594
  \draw[very thick] (-2,0)   -- ( 0.75,0);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   595
  \draw[very thick] (-2,0.5) -- ( 0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   596
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   597
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   598
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   599
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   600
  \draw[very thick] (-1.25,0)   -- (-1.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   601
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   602
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   603
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   604
  \node [anchor=base] at (-1.7,0.2) {\ldots};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   605
  \end{tikzpicture}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   606
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   607
  \raisebox{2mm}{non-halting case:} &
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   608
  \begin{tikzpicture}[scale=0.8]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   609
  \draw[very thick] (-2,0)   -- ( 0.25,0);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   610
  \draw[very thick] (-2,0.5) -- ( 0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   611
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   612
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   613
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   614
  \draw[very thick] (-1.25,0)   -- (-1.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   615
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   616
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   617
  \node [anchor=base] at (-1.7,0.2) {\ldots};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   618
  \end{tikzpicture} 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   619
  & \raisebox{2mm}{$\;\;\large\Rightarrow\;\;$} &
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   620
  \raisebox{2mm}{loops}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   621
  \end{tabular}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   622
  \end{center}\bigskip
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   623
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   624
  \small
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   625
  \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   626
  \begin{tabular}[t]{@ {}l@ {}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   627
  @{text dither} @{text "\<equiv>"} @{text "["}@{text "(W\<^bsub>0\<^esub>, 1), (R, 2), (L, 1), (L, 0)"}@{text "]"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   628
  \end{tabular}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   629
  \end{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   630
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   631
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   632
  \end{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   633
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   634
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   635
  \end{frame}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   636
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   637
*}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   638
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   639
text_raw {*
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   640
  \definecolor{mygrey}{rgb}{.80,.80,.80}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   641
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   642
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   643
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   644
  \frametitle{Hoare Logic for TMs}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   645
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   646
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   647
  \item Hoare-triples\onslide<2>{ and Hoare-pairs:}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   648
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   649
  \small
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   650
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   651
  \begin{tabular}{@ {\hspace{-6mm}}c@ {\hspace{-3mm}}c@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   652
  \begin{tabular}[t]{@ {}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   653
  \colorbox{mygrey}{@{thm (lhs) Hoare_halt_def}} @{text "\<equiv>"}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   654
  \hspace{5mm}@{text "\<forall>"}@{term "tp"}.\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   655
  \hspace{7mm}if @{term "P tp"} holds then\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   656
  \hspace{7mm}@{text "\<exists>"}@{term n}. such that\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   657
  \hspace{7mm}@{text "is_final (steps (1, tp) p n)"} \hspace{1mm}@{text "\<and>"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   658
  \hspace{7mm}@{text "Q holds_for (steps (1, tp) p n)"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   659
  \end{tabular} &
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   660
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   661
  \onslide<2>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   662
  \begin{tabular}[t]{@ {}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   663
  \colorbox{mygrey}{@{thm (lhs) Hoare_unhalt_def}} @{text "\<equiv>"}\\[1mm]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   664
  \hspace{5mm}@{text "\<forall>"}@{term "tp"}.\\ 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   665
  \hspace{7mm}if @{term "P tp"} holds then\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   666
  \hspace{7mm}@{text "\<forall>"}@{term n}. @{text "\<not> is_final (steps (1, tp) p n)"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   667
  \end{tabular}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   668
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   669
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   670
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   671
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   672
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   673
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   674
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   675
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   676
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   677
(*<*)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   678
lemmas HR1 = 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   679
  Hoare_plus_halt[where ?S.0="R\<iota>" and ?A="p\<^sub>1" and B="p\<^sub>2"]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   680
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   681
lemmas HR2 =
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   682
  Hoare_plus_unhalt[where ?A="p\<^sub>1" and B="p\<^sub>2"]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   683
(*>*)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   684
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   685
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   686
  \definecolor{mygrey}{rgb}{.80,.80,.80}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   687
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   688
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   689
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   690
  \frametitle{Some Derived Rules}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   691
  \large
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   692
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   693
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   694
  @{thm[mode=Rule] Hoare_consequence}\bigskip\bigskip\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   695
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   696
  \begin{tabular}{@ {\hspace{-5mm}}c@ {\hspace{4mm}}c@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   697
  $\inferrule*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   698
  {@{thm (prem 1) HR1} \\ @{thm (prem 2) HR1}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   699
  {@{thm (concl) HR1}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   700
  $ &
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   701
  $
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   702
  \inferrule*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   703
  {@{thm (prem 1) HR2} \\ @{thm (prem 2) HR2}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   704
  {@{thm (concl) HR2}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   705
  $
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   706
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   707
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   708
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   709
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   710
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   711
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   712
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   713
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   714
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   715
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   716
  \begin{frame}[b]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   717
  \frametitle{Undecidability}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   718
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   719
  \begin{textblock}{7}(4,2.4)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   720
  @{thm tcontra_def}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   721
  \end{textblock}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   722
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   723
  \only<2>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   724
  \begin{itemize}
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   725
  \item Suppose @{text H} decides whether @{text contra} called with the code 
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   726
  of @{text contra} halts, then\smallskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   727
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   728
  \begin{center}\small
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   729
  \begin{tabular}{@ {}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   730
  \begin{tabular}[t]{@ {\hspace{-5mm}}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   731
  @{term "P\<^sub>1 \<equiv> \<lambda>tp. tp = ([]::cell list, <code_tcontra>)"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   732
  @{term "P\<^sub>2 \<equiv> \<lambda>tp. tp = ([Bk], <(code_tcontra, code_tcontra)>)"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   733
  @{term "P\<^sub>3 \<equiv> \<lambda>tp. \<exists>k. tp = (Bk \<up> k, <0::nat>)"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   734
  \end{tabular}\bigskip\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   735
  \\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   736
  \begin{tabular}[b]{@ {\hspace{20mm}}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   737
  $\inferrule*{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   738
    \inferrule*{@{term "{P\<^sub>1} tcopy {P\<^sub>2}"} \\ @{term "{P\<^sub>2} H {P\<^sub>3}"}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   739
    {@{term "{P\<^sub>1} (tcopy |+| H) {P\<^sub>3}"}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   740
    \\ @{term "{P\<^sub>3} dither \<up>"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   741
   }
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   742
   {@{term "{P\<^sub>1} tcontra \<up>"}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   743
  $
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   744
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   745
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   746
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   747
  \end{itemize}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   748
  \only<3>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   749
  \begin{itemize}
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   750
  \item Suppose @{text H} decides wether @{text contra} called with the code 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   751
  of @{text contra} does \alert{not} halt, then\\[-8mm]\mbox{}
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   752
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   753
  \begin{center}\small
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   754
  \begin{tabular}{@ {}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   755
  \begin{tabular}[t]{@ {\hspace{-1mm}}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   756
  @{term "Q\<^sub>1 \<equiv> \<lambda>tp. tp = ([]::cell list, <code_tcontra>)"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   757
  @{term "Q\<^sub>2 \<equiv> \<lambda>tp. tp = ([Bk], <(code_tcontra, code_tcontra)>)"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   758
  @{term "Q\<^sub>3 \<equiv> \<lambda>tp. \<exists>k. tp = (Bk \<up> k, <1::nat>)"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   759
  \end{tabular}\bigskip\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   760
  \\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   761
  \begin{tabular}[b]{@ {\hspace{20mm}}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   762
  $\inferrule*{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   763
    \inferrule*{@{term "{Q\<^sub>1} tcopy {Q\<^sub>2}"} \\ @{term "{Q\<^sub>2} H {Q\<^sub>3}"}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   764
    {@{term "{Q\<^sub>1} (tcopy |+| H) {Q\<^sub>3}"}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   765
    \\ @{term "{Q\<^sub>3} dither {Q\<^sub>3}"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   766
   }
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   767
   {@{term "{Q\<^sub>1} tcontra {Q\<^sub>3}"}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   768
  $
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   769
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   770
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   771
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   772
  \end{itemize}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   773
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   774
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   775
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   776
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   777
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   778
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   779
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   780
  \definecolor{mygrey}{rgb}{.80,.80,.80}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   781
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   782
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   783
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   784
  \frametitle{Hoare Reasoning}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   785
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   786
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   787
  \item reasoning is quite demanding, e.g.~the invariants 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   788
  of the copy-machine:\\[-5mm]\mbox{}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   789
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   790
  \footnotesize
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   791
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   792
  \begin{tabular}{@ {\hspace{-5mm}}c@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   793
  \begin{tabular}{@ {}l@ {\hspace{1mm}}c@ {\hspace{1mm}}l@ {\hspace{-0.9cm}}l@ {}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   794
  \hline
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   795
  @{thm (lhs) inv_begin1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin1.simps} & (starting state)\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   796
  @{thm (lhs) inv_begin2.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin2.simps}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   797
  @{thm (lhs) inv_begin3.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin3.simps}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   798
  @{thm (lhs) inv_begin4.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin4.simps}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   799
  @{thm (lhs) inv_begin0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin01} @{text "\<or>"}& (halting state)\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   800
                                &             & @{thm (rhs) inv_begin02}\smallskip \\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   801
   \hline
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   802
  @{thm (lhs) inv_loop1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_loop1_loop.simps} @{text "\<or>"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   803
                               &             & @{thm (rhs) inv_loop1_exit.simps} & (starting state)\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   804
  @{thm (lhs) inv_loop0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_loop0.simps}& (halting state)\smallskip\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   805
   \hline
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   806
  @{thm (lhs) inv_end1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_end1.simps} & (starting state)\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   807
  @{thm (lhs) inv_end0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_end0.simps} & (halting state)\smallskip\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   808
  \hline
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   809
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   810
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   811
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   812
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   813
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   814
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   815
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   816
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   817
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   818
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   819
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   820
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   821
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   822
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   823
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   824
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   825
  \frametitle{Midway Conclusion}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   826
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   827
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   828
  \item feels awfully like reasoning about machine code
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   829
  \item compositional constructions / reasoning is not at all frictionless
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   830
  \item sizes
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   831
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   832
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   833
  \begin{tabular}{ll}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   834
  & sizes:\smallskip\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   835
  UF       & @{text 140843} constructors\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   836
  URM      & @{text 2} Mio instructions\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   837
  UTM      & @{text 38} Mio states\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   838
  \end{tabular}
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   839
  \end{center}\smallskip
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   840
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   841
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   842
 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   843
  \only<1>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   844
  \begin{textblock}{4}(2,13.9)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   845
  \begin{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   846
  \draw (0,0) node {\small\begin{tabular}{l}$^\star$old version: 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   847
  URM (@{text 12} Mio) UTM (@{text 112} Mio)\end{tabular}};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   848
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   849
  \end{textblock}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   850
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   851
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   852
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   853
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   854
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   855
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   856
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   857
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   858
  \begin{frame}[c]
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   859
  \frametitle{{\fontsize{20}{20}\selectfont{}The Trouble With Hoare-Triples}}%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   860
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   861
  \begin{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   862
  \item Whenever we wanted to prove 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   863
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   864
  \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   865
  \large @{text "{P} p {Q}"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   866
  \end{center}\bigskip\medskip
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   867
 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   868
  \item[@{text "(1)"}] we had to find invariants for each state\\ \textcolor{gray}{(not easy)}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   869
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   870
  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   871
  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   872
  \item[@{text "(2)"}] we had to find a termination order proving that @{text p} terminates
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   873
  \textcolor{gray}{(not easy either)}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   874
  \end{itemize}\pause
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   875
  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   876
  \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   877
  \alert{very little opportunity for automation}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   878
  \end{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   879
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   880
  \end{frame}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   881
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   882
*} 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   883
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   884
text_raw {*
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   885
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   886
  \mode<presentation>{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   887
  \begin{frame}[c]
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   888
  \frametitle{\begin{tabular}{@ {}c@ {}}\Large Inspiration from other Works\end{tabular}}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   889
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   890
  \onslide<3->{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   891
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   892
  \item Jensen, Benton, Kennedy ({\bf 2013}),
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   893
  {\it High-Level Separation Logic for Low-Level Code}\medskip\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   894
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   895
  \item Myreen ({\bf 2008}), {\it Formal Verification of Machine-Code Programs},
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   896
  PhD thesis\medskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   897
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   898
  \item Klein, Kolanski, Boyton ({\bf 2012}), {\it Mechanised Separation Algebra}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   899
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   900
  \end{itemize}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   901
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   902
  \only<2->{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   903
  \begin{textblock}{4}(1.4,0.9)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   904
  \begin{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   905
  \draw (0,0) node {\fontspec{Chalkduster}\textcolor{red!80}{\LARGE Stealing}};
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   906
  \end{tikzpicture}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   907
  \end{textblock}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   908
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   909
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   910
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   911
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   912
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   913
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   914
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   915
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   916
  \frametitle{Better Composability}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   917
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   918
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   919
  \item an idea from Jensen, Benton \& Kennedy who looked at X86 
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   920
  assembler programs and macros\bigskip
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   921
  
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   922
  \item assembler for TMs:\medskip
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   923
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   924
  \begin{tabular}{l}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   925
  @{text "move_one_left"} @{text "\<equiv>"}\\ 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   926
  \hspace{13mm} @{text "\<Lambda> exit."}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   927
  \hspace{16mm} @{text "Inst (L, exit) (L, exit)"} @{text ";"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   928
  \hspace{16mm} @{text "Label exit"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   929
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   930
  \end{center}\bigskip\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   931
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   932
  \begin{tabular}{l}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   933
  $\Rightarrow$ represent "state" labels as functions\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   934
  \phantom{$\Rightarrow$} (with bound variables $\Rightarrow$ locality) 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   935
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   936
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   937
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   938
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   939
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   940
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   941
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   942
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   943
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   944
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   945
  \frametitle{Better Composability}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   946
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   947
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   948
  \begin{tabular}{@ {\hspace{-10mm}}l}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   949
  @{text "move_left_until_zero"} @{text "\<equiv>"} \\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   950
  \hspace{31mm} @{text "\<Lambda> start exit."}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   951
  \hspace{36mm} @{text "Label start"} @{text ";"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   952
  \hspace{36mm} @{text "if_zero exit"} @{text ";"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   953
  \hspace{36mm} @{text "move_left"} @{text ";"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   954
  \hspace{36mm} @{text "jmp start"} @{text ";"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   955
  \hspace{36mm} @{text "Label exit"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   956
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   957
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   958
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   959
  \small
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   960
  \begin{tabular}{l}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   961
  @{text "if_zero e \<equiv> \<Lambda> exit. Inst (W\<^sub>0, e), (W\<^sub>1, exit); Label exit"}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   962
  \hspace{5mm}@{text "jmp e \<equiv> Inst (W\<^sub>0, e), (W\<^sub>1, e)"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   963
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   964
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   965
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   966
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   967
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   968
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   969
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   970
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   971
  \mode<presentation>{
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   972
  \begin{frame}[t]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   973
  \frametitle{An RM-API with TMs}%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   974
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   975
  \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   976
  \begin{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   977
  \matrix[ampersand replacement=\&,column sep=13mm, row sep=5mm]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   978
  { \node (tm)   [node1, minimum size=44mm] {\mbox{}}; \&
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   979
    \node (rf)   [node1] {\begin{tabular}{c}Recursive\\ Functions\end{tabular}}; \\    
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   980
  };
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   981
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   982
  \draw[->,black!50,line width=2mm] (rf) -- (tm);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   983
  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   984
  \node [above, rotate=90] at (tm.east) {\textcolor{gray}{Reg.Mach. API}};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   985
  \node [below right] at (tm.north west) {\textcolor{gray}{Macros}};
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   986
  \node [node1] at (tm) {\large\hspace{1mm}TMs\hspace{1mm}\mbox{}}; 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   987
  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   988
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   989
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   990
  \end{center}
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   991
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   992
  \begin{itemize}
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   993
  \item Suppose the first four registers of an RM contain 1,2,0 and 3, then the encoding is
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   994
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   995
  \begin{center}
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   996
  \begin{tikzpicture}[scale=1]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   997
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   998
  \draw[very thick] (-0.25,0)   -- ( 8.25,0);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
   999
  \draw[very thick] (-0.25,0.5) -- ( 8.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1000
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1001
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1002
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1003
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1004
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1005
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1006
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1007
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1008
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1009
  \draw[very thick] ( 3.75,0)   -- ( 3.75,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1010
  \draw[very thick] ( 4.25,0)   -- ( 4.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1011
  \draw[very thick] ( 4.75,0)   -- ( 4.75,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1012
  \draw[very thick] ( 5.25,0)   -- ( 5.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1013
  \draw[very thick] ( 5.75,0)   -- ( 5.75,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1014
  \draw[very thick] ( 6.25,0)   -- ( 6.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1015
  \draw[very thick] ( 6.75,0)   -- ( 6.75,0.5); 
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1016
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1017
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1018
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1019
  \draw[fill]     ( 1.35,0.1) rectangle (1.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1020
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1021
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1022
  \draw[fill]     ( 3.35,0.1) rectangle (3.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1023
  \draw[fill]     ( 4.35,0.1) rectangle (4.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1024
  \draw[fill]     ( 4.85,0.1) rectangle (5.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1025
  \draw[fill]     ( 5.35,0.1) rectangle (5.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1026
  \draw[fill]     ( 5.85,0.1) rectangle (6.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1027
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1028
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1029
  \end{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1030
  \end{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1031
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1032
  \end{frame}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1033
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1034
*}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1035
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1036
text_raw {*
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1037
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1038
  \mode<presentation>{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1039
  \begin{frame}[c]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1040
  \frametitle{Inc a}%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1041
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1042
  \begin{center}
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1043
  \begin{tabular}{@ {\hspace{-10mm}}l}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1044
  @{text "Inc a"} @{text "\<equiv>"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1045
  \hspace{16mm} @{text "locate a"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1046
  \hspace{16mm} @{text "right_until_zero"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1047
  \hspace{16mm} @{text "move_right"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1048
  \hspace{16mm} @{text "shift_right"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1049
  \hspace{16mm} @{text "move_left"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1050
  \hspace{16mm} @{text "left_until_double_zero"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1051
  \hspace{16mm} @{text "write_one"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1052
  \hspace{16mm} @{text "left_until_double_zero"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1053
  \hspace{16mm} @{text "move_right"} @{text ";"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1054
  \hspace{16mm} @{text "move_right"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1055
  \end{tabular}
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1056
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1057
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1058
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1059
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1060
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1061
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1062
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1063
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1064
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1065
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1066
  \frametitle{Separation Algebra}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1067
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1068
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1069
  \item use some infrastructure introduced by Klein et al in Isabelle/HOL
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1070
  \item and an idea by Myreen\bigskip\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1071
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1072
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1073
  \large @{text "\<lbrace>p\<rbrace> c \<lbrace>q\<rbrace>"}\bigskip\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1074
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1075
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1076
  \item[] @{text "p, c, q"} will be assertions in a separation logic\pause
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1077
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1078
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1079
  e.g.~~@{text "\<lbrace>st i \<star> hd n \<star> ones u v \<star> zero (v + 1)\<rbrace>"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1080
  \end{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1081
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1082
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1083
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1084
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1085
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1086
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1087
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1088
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1089
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1090
  \frametitle{Separation Triples}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1091
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1092
  \Large
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1093
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1094
  \begin{tabular}{l@ {\hspace{-10mm}}l}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1095
  @{text "\<lbrace>p\<rbrace> c \<lbrace>q\<rbrace>"} @{text "\<equiv>"}\smallskip\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1096
  & @{text "\<forall> cf r."}\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1097
  & \hspace{3mm} @{text "(p \<star> c \<star> r) cf"} implies\\
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1098
  & \hspace{3mm} @{text "\<exists> k. "} @{text "(q \<star> c \<star> r) (steps k cf)"} 
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1099
  \end{tabular}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1100
  \end{center}\bigskip\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1101
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1102
  \normalsize
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1103
  \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1104
  @{text "\<lbrace> st i \<star> hd v \<star> zero u \<star> ones (u + 1) v \<rbrace>"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1105
  @{text "i:[left_until_zero]:j"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1106
  @{text "\<lbrace> st j \<star> hd u \<star> zero u \<star> ones (u + 1) v \<rbrace>"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1107
  \end{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1108
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1109
  \end{frame}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1110
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1111
*}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1112
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1113
text_raw {*
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1114
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1115
  \mode<presentation>{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1116
  \begin{frame}[c]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1117
  \frametitle{Inductions over \textit{ones}}%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1118
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1119
  \begin{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1120
  \item What most simplifies the work is that we can do inductions over
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1121
  the ''input'' (inductively defined assertions)\pause\medskip
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1122
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1123
  \item Suppose @{text "right_until_zero"}:\bigskip
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1124
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1125
    \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1126
  \begin{tikzpicture}[scale=1]
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1127
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1128
  \draw[very thick] (-0.25,0)   -- ( 8.25,0);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1129
  \draw[very thick] (-0.25,0.5) -- ( 8.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1130
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1131
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1132
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1133
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1134
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1135
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1136
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1137
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1138
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1139
  \draw[very thick] ( 3.75,0)   -- ( 3.75,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1140
  \draw[very thick] ( 4.25,0)   -- ( 4.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1141
  \draw[very thick] ( 4.75,0)   -- ( 4.75,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1142
  \draw[very thick] ( 5.25,0)   -- ( 5.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1143
  \draw[very thick] ( 5.75,0)   -- ( 5.75,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1144
  \draw[very thick] ( 6.25,0)   -- ( 6.25,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1145
  \draw[very thick] ( 6.75,0)   -- ( 6.75,0.5); 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1146
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1147
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1148
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1149
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1150
  \draw[fill]     ( 1.35,0.1) rectangle (1.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1151
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1152
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1153
  \draw[fill]     ( 3.35,0.1) rectangle (3.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1154
  \draw[fill]     ( 3.85,0.1) rectangle (4.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1155
  \draw[fill]     ( 4.35,0.1) rectangle (4.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1156
  \draw[fill]     ( 4.85,0.1) rectangle (5.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1157
  \draw[fill]     ( 5.35,0.1) rectangle (5.65,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1158
  \draw[fill]     ( 5.85,0.1) rectangle (6.15,0.4);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1159
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1160
  \path (2.75,0) edge [decorate,decoration={brace,amplitude=14pt}, thick] node[below=8pt] 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1161
  {\small\textcolor{gray}{@{text "ones u v"}}} (-0.25,0);
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1162
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1163
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1164
  \end{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1165
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1166
  \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1167
  @{text "\<lbrace> st i \<star> hd u \<star> zero (v + 1) \<star> ones u v \<rbrace>"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1168
  @{text "i:[right_until_zero]:j"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1169
  @{text "\<lbrace> st j \<star> hd (v + 1) \<star> zero (v + 1) \<star> ones u v \<rbrace>"}\\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1170
  \end{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1171
  \end{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1172
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1173
  \begin{textblock}{3}(11,10)
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1174
  \begin{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1175
  \only<2>{\node at (0,0) [single arrow, shape border rotate=270, fill=red,text=white]{\mbox{\alert{a}}};}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1176
  \end{tikzpicture}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1177
  \end{textblock}
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1178
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1179
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1180
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1181
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1182
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1183
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1184
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1185
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1186
  \begin{frame}[c]
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1187
  \frametitle{Automation}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1188
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1189
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1190
  \item we introduced some tactics for handling sequential programs\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1191
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1192
  \begin{center}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1193
  @{text "\<lbrace>p\<rbrace> i:[c\<^sub>1 ; ... ; c\<^sub>n]:j \<lbrace>q\<rbrace>"}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1194
  \end{center}\bigskip\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1195
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1196
  \item for loops we often only have to do inductions on the length 
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1197
  of the input (e.g.~how many @{text "0"}s/@{text "1"}s are on the tape)
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1198
  
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1199
  \item no termination measures are needed
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1200
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1201
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1202
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1203
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1204
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1205
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1206
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1207
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1208
text_raw {*
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1209
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1210
  \mode<presentation>{
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1211
  \begin{frame}[c]
286
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1212
  \frametitle{Register Machines}%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1213
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1214
  \begin{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1215
  \item We could also use Jensen's et al work to give
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1216
  a more appropriate \alert{view}  on register machines
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1217
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1218
  \begin{center}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1219
  @{text "\<lbrace>p\<rbrace> i:[rm_c]:j \<lbrace>q\<rbrace>"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1220
  \end{center}\bigskip
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1221
  \end{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1222
  
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1223
  \small
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1224
  \begin{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1225
      \item Rule for @{text "Inc"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1226
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1227
             \begin{tabular}{rl}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1228
               @{text "RM."} & @{text "\<lbrace> pc i \<star> m a v \<rbrace>"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1229
               & @{text "i:[ Inc a ]:j"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1230
               & @{text "\<lbrace> pc j \<star> m a (Suc v)\<rbrace>"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1231
             \end{tabular}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1232
     \item Rules for @{text "Dec"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1233
     \begin{tabular}{c c}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1234
       \begin{tabular}{r l}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1235
            @{text "RM."} & @{text "\<lbrace>(pc i \<star> m a (Suc v))\<rbrace>"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1236
          & @{text "i :[ Dec a e ]: j"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1237
          & @{text "\<lbrace>pc j \<star> m a v\<rbrace>"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1238
       \end{tabular} &
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1239
       \begin{tabular}{r l}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1240
         @{text "RM."} & @{text "\<lbrace> pc i \<star> m a 0 \<rbrace>"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1241
         & @{text "i:[ Dec a e ]:j"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1242
         & @{text "\<lbrace> pc e \<star> m a 0 \<rbrace>"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1243
       \end{tabular}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1244
     \end{tabular}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1245
    %\item Rule for @{text "Goto"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1246
    %
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1247
    %   \begin{tabular}{r l}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1248
    %     @{text "RM."} & @{text "\<lbrace> pc i \<rbrace>"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1249
    %    &@{text "i:[ (Goto e) ]:j"} \\
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1250
    %    &@{text "\<lbrace> pc e \<rbrace>"}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1251
    %   \end{tabular} 
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1252
  \end{itemize}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1253
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1254
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1255
  \end{frame}}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1256
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1257
*}
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1258
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1259
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1260
text_raw {*
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1261
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1262
  \mode<presentation>{
b49ff5328a66 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 285
diff changeset
  1263
  \begin{frame}[c]
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1264
  \frametitle{Conclusion}%
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1265
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1266
  \begin{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1267
  \item What started out as a student project, turned out to be much more
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1268
  fun than first thought.\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1269
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1270
  \item Where can you claim that you proved the correctness of
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1271
  a @{text "38"} Mio instruction program?
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1272
  (ca.~@{text 7000} is the soa \raisebox{-1mm}{\includegraphics[scale=0.077]{smiley.jpg}})
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1273
  \bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1274
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1275
  \item We learned a lot about current verification technology for low-level code
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1276
  (we had no infrastructure: CPU model).\bigskip
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1277
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1278
  \item The existing literature on TMs \& RMs leave out quite a bit of the story
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1279
  (not to mention contains bugs).
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1280
  \end{itemize}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1281
  
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1282
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1283
  \end{frame}}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1284
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1285
*}
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1286
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1287
(*<*)
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1288
end
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1289
end
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
  1290
(*>*)