Slides/Slides1.thy
author Christian Urban <urbanc@in.tum.de>
Thu, 10 Jan 2019 12:51:24 +0000
changeset 294 6836da75b3ac
parent 285 447b433b67fa
permissions -rw-r--r--
updated to Isabelle 2016-1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
(*<*)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
theory Slides1
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
imports "../thys/UTM" "../thys/Abacus_Defs"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
begin
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
declare [[show_question_marks = false]]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
hide_const (open) s 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
abbreviation
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
  "update2 p a \<equiv> update a p"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
notation (latex output)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
  Cons ("_::_" [48,47] 48) and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
  Oc ("0") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
  Bk ("1") and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
  exponent ("_\<^bsup>_\<^esup>") and
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    18
  inv_begin0 ("I\<^sub>0") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    19
  inv_begin1 ("I\<^sub>1") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    20
  inv_begin2 ("I\<^sub>2") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    21
  inv_begin3 ("I\<^sub>3") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    22
  inv_begin4 ("I\<^sub>4") and 
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
  inv_begin ("I\<^bsub>cbegin\<^esub>") and
285
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    24
  inv_loop1 ("J\<^sub>1") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    25
  inv_loop0 ("J\<^sub>0") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    26
  inv_end1 ("K\<^sub>1") and
447b433b67fa added things --- in messy state
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 271
diff changeset
    27
  inv_end0 ("K\<^sub>0")
271
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
lemma inv_begin_print:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
  shows "s = 0 \<Longrightarrow> inv_begin n (s, tp) = inv_begin0 n tp" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
        "s = 1 \<Longrightarrow> inv_begin n (s, tp) = inv_begin1 n tp" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
        "s = 2 \<Longrightarrow> inv_begin n (s, tp) = inv_begin2 n tp" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
        "s = 3 \<Longrightarrow> inv_begin n (s, tp) = inv_begin3 n tp" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
        "s = 4 \<Longrightarrow> inv_begin n (s, tp) = inv_begin4 n tp" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
        "s \<notin> {0,1,2,3,4} \<Longrightarrow> inv_begin n (s, l, r) = False"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
apply(case_tac [!] tp)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
by (auto)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
lemma inv1: 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
  shows "0 < (n::nat) \<Longrightarrow> Turing_Hoare.assert_imp (inv_begin0 n) (inv_loop1 n)"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
unfolding Turing_Hoare.assert_imp_def
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
unfolding inv_loop1.simps inv_begin0.simps
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
apply(auto)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
apply(rule_tac x="1" in exI)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
apply(auto simp add: replicate.simps)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
done
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
lemma inv2: 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
  shows "0 < n \<Longrightarrow> inv_loop0 n = inv_end1 n"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
apply(rule ext)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
apply(case_tac x)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
apply(simp add: inv_end1.simps)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
done
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
lemma measure_begin_print:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
  shows "s = 2 \<Longrightarrow> measure_begin_step (s, l, r) = length r" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
        "s = 3 \<Longrightarrow> measure_begin_step (s, l, r) = (if r = [] \<or> r = [Bk] then 1 else 0)" and
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    62
        "s = 4 \<Longrightarrow> measure_begin_step (s, l, r) = length l" and 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
        "s \<notin> {2,3,4} \<Longrightarrow> measure_begin_step (s, l, r) = 0"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
by (simp_all)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
lemma inv_begin01:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
  assumes "n > 1"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
  shows "inv_begin0 n (l, r) = (n > 1 \<and> (l, r) = (Oc \<up> (n - 2), [Oc, Oc, Bk, Oc]))"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
using assms by auto                          
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    70
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
lemma inv_begin02:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
  assumes "n = 1"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
  shows "inv_begin0 n (l, r) = (n = 1 \<and> (l, r) = ([], [Bk, Oc, Bk, Oc]))"
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
using assms by auto
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    75
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
(*>*)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    77
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    78
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    79
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    80
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    81
  \renewcommand{\slidecaption}{SMAL, 16 July 2013}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    82
  \newcommand{\bl}[1]{#1}                        
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    83
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    84
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    85
  \begin{frame}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    86
  \frametitle{%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    87
  \begin{tabular}{@ {}c@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    88
  \\[-3mm]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    89
  \Large Reasoning about Turing Machines\\[-1mm] 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    90
  \Large and Low-Level Code\\[-3mm] 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    91
  \end{tabular}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    92
  
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    93
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    94
   Christian Urban\\[1mm]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    95
  %%\small King's College London
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    96
  \end{center}\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    97
 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    98
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
  in cooperation with Jian Xu and Xingyuan Zhang
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   105
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   107
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   108
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   109
  \frametitle{A Trend in Verification}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   110
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   111
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   112
  \item in the past:\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   113
  \begin{quote}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   114
  model a problem mathematically and proof properties about the 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   115
  model
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   116
  \end{quote}\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   117
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   118
  \item needs elegance, is still very hard\bigskip\pause
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   119
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   120
  \item does not help with ensuring the correctness of running programs
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   121
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   122
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   123
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   124
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   125
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   126
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   127
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   128
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   129
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   130
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   131
  \frametitle{A Trend in Verification}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   132
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   133
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   134
  \item make the specification executable (e.g.~Compcert)\bigskip\pause
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   135
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   136
  you would expect the trend would be to for example model C, implement 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   137
  your programs in C and verify the programs written in C (e.g.~seL4) 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   138
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   139
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   140
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   141
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   142
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   143
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   144
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   145
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   146
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   147
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   148
  \frametitle{A Trend in Verification}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   149
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   150
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   151
  \item but actually people start to verify machine code directly
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   152
  (e.g.~bignum arithmetic implemented in x86-64 -- 700 instructions)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   153
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   154
  \item CPU models exists, but the strategy is to use a small subset
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   155
  which you use in your programs
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   156
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   157
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   158
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   159
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   160
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   161
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   162
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   163
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   164
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   165
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   166
  \frametitle{Why Turing Machines}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   167
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   168
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   169
  \item at the beginning it was just a nice student project
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   170
  about computability
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   171
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   172
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   173
  \includegraphics[scale=0.3]{boolos.jpg}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   174
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   175
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   176
  \item found an inconsistency in the definition of halting computations
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   177
  (Chap.~3 vs Chap.~8)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   178
  \pause
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   179
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   180
  \item \small Norrish formalised computability via lambda-calculus (and nominal);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   181
  Asperti and Riccioti formalised TMs but didn't get proper UTM
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   182
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   183
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   184
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   185
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   186
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   187
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   188
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   189
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   190
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   191
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   192
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   193
  \frametitle{Turing Machines}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   194
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   195
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   196
  \item tapes contain 0 or 1 only
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   197
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   198
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   199
\begin{tikzpicture}[scale=1]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   200
  \draw[very thick] (-3.0,0)   -- ( 3.0,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   201
  \draw[very thick] (-3.0,0.5) -- ( 3.0,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   202
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   203
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   204
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   205
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   206
  \draw[very thick] (-1.25,0)   -- (-1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   207
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   208
  \draw[very thick] (-1.75,0)   -- (-1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   209
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   210
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   211
  \draw[fill]     (1.35,0.1) rectangle (1.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   212
  \draw[fill]     (0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   213
  \draw[fill]     (-0.35,0.1) rectangle (-0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   214
  \draw[fill]     (-1.65,0.1) rectangle (-1.35,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   215
  \draw (-0.25,0.8) -- (-0.25,-0.8);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   216
  \draw[<->] (-1.25,-0.7) -- (0.75,-0.7);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   217
  \node [anchor=base] at (-0.85,-0.5) {\small left list\;\;\;\;\mbox{}};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   218
  \node [anchor=base] at (0.40,-0.5) {\small \mbox{}\;\;\;\;right list};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   219
  \node [anchor=base] at (0.1,0.7) {\small \;\;head};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   220
  \node [anchor=base] at (-2.2,0.2) {\ldots};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   221
  \node [anchor=base] at ( 2.3,0.2) {\ldots};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   222
  \end{tikzpicture}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   223
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   224
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   225
  \item steps function
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   226
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   227
  \begin{quote}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   228
  What does the tape look like after the TM has executed n steps?
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   229
  \end{quote}\pause
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   230
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   231
  designate the 0-state as halting state and remain there forever
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   232
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   233
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   234
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   235
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   236
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   237
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   238
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   239
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   240
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   241
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   242
  \frametitle{Copy Turing Machines}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   243
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   244
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   245
  \item TM that copies a number on the input tape
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   246
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   247
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   248
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   249
\begin{tikzpicture}[scale=0.7]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   250
  \node [anchor=base] at (2.2,0.1) {\small$\Rightarrow$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   251
  \node [anchor=base] at (5.6,0.1) {\small$\Rightarrow$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   252
  \node [anchor=base] at (10.5,0.1) {\small$\Rightarrow$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   253
  \node [anchor=base] at (2.2,-0.8) {\small$\overbrace{\text{cbegin}}^{}$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   254
  \node [anchor=base] at (5.6,-0.8) {\small$\overbrace{\text{cloop}}^{}$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   255
  \node [anchor=base] at (10.5,-0.8) {\small$\overbrace{\text{cend}}^{}$};
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   256
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   257
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   258
  \begin{scope}[shift={(0.5,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   259
  \draw[very thick] (-0.25,0)   -- ( 1.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   260
  \draw[very thick] (-0.25,0.5) -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   261
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   262
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   263
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   264
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   265
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   266
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   267
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   268
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   269
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   270
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   271
  \begin{scope}[shift={(2.9,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   272
  \draw[very thick] (-0.25,0)   -- ( 2.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   273
  \draw[very thick] (-0.25,0.5) -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   274
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   275
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   276
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   277
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   278
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   279
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   280
  \draw[rounded corners=1mm] (0.15,-0.1) rectangle (0.85,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   281
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   282
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   283
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   284
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   285
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   286
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   287
  \begin{scope}[shift={(6.8,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   288
  \draw[very thick] (-0.75,0)   -- ( 3.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   289
  \draw[very thick] (-0.75,0.5) -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   290
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   291
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   292
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   293
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   294
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   295
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   296
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   297
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   298
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   299
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   300
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   301
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   302
  \draw[fill]     ( 2.85,0.1) rectangle (3.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   303
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   304
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   305
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   306
  \begin{scope}[shift={(11.7,0)}]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   307
  \draw[very thick] (-0.75,0)   -- ( 3.25,0);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   308
  \draw[very thick] (-0.75,0.5) -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   309
  \draw[very thick] (-0.75,0)   -- (-0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   310
  \draw[very thick] (-0.25,0)   -- (-0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   311
  \draw[very thick] ( 0.25,0)   -- ( 0.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   312
  \draw[very thick] ( 0.75,0)   -- ( 0.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   313
  \draw[very thick] ( 1.25,0)   -- ( 1.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   314
  \draw[very thick] ( 1.75,0)   -- ( 1.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   315
  \draw[very thick] ( 2.25,0)   -- ( 2.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   316
  \draw[very thick] ( 2.75,0)   -- ( 2.75,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   317
  \draw[very thick] ( 3.25,0)   -- ( 3.25,0.5);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   318
  \draw[rounded corners=1mm] (-0.35,-0.1) rectangle (0.35,0.6);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   319
  \draw[fill]     (-0.15,0.1) rectangle (0.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   320
  \draw[fill]     ( 2.35,0.1) rectangle (2.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   321
  \draw[fill]     ( 2.85,0.1) rectangle (3.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   322
  \draw[fill]     ( 1.85,0.1) rectangle (2.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   323
  \draw[fill]     ( 0.35,0.1) rectangle (0.65,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   324
  \draw[fill]     ( 0.85,0.1) rectangle (1.15,0.4);
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   325
  \end{scope}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   326
  \end{tikzpicture}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   327
  \end{center}\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   328
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   329
  \footnotesize
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   330
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   331
  \begin{tabular}{@ {\hspace{-8mm}}c@ {\hspace{2mm}}c@ {\hspace{2mm}}c}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   332
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   333
  @{text cbegin} @{text "\<equiv>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   334
  \hspace{2mm}@{text "["}@{text "(W\<^bsub>0\<^esub>, 0), (R, 2), (R, 3),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   335
  \hspace{2mm}\phantom{@{text "["}}@{text "(R, 2), (W\<^bsub>1\<^esub>, 3), (L, 4),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   336
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 4), (L, 0)"}@{text "]"} 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   337
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   338
  &
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   339
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   340
  @{text cloop} @{text "\<equiv>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   341
  \hspace{2mm}@{text "["}@{text "(R, 0), (R, 2), (R, 3),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   342
  \hspace{2mm}\phantom{@{text "["}}@{text "(W\<^bsub>0\<^esub>, 2), (R, 3), (R, 4),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   343
  \hspace{2mm}\phantom{@{text "["}}@{text "(W\<^bsub>1\<^esub>, 5), (R, 4), (L, 6),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   344
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5), (L, 6), (L, 1)"}@{text "]"} 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   345
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   346
  &
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   347
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   348
  @{text cend} @{text "\<equiv>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   349
  \hspace{2mm}@{text "["}@{text "(L, 0), (R, 2), (W\<^bsub>1\<^esub>, 3),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   350
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 4), (R, 2), (R, 2),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   351
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5), (W\<^bsub>0\<^esub>, 4), (R, 0),"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   352
  \hspace{2mm}\phantom{@{text "["}}@{text "(L, 5)"}@{text "]"} 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   353
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   354
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   355
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   356
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   357
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   358
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   359
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   360
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   361
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   362
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   363
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   364
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   365
  \definecolor{mygrey}{rgb}{.80,.80,.80}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   366
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   367
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   368
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   369
  \frametitle{Hoare Logic for TMs}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   370
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   371
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   372
  \item Hoare-triples and Hoare-pairs:
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   373
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   374
  \small
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   375
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   376
  \begin{tabular}{@ {\hspace{-6mm}}c@ {\hspace{-3mm}}c@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   377
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   378
  \colorbox{mygrey}{@{thm (lhs) Hoare_halt_def}} @{text "\<equiv>"}\\[1mm]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   379
  \hspace{5mm}@{text "\<forall>"}@{term "tp"}.\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   380
  \hspace{7mm}if @{term "P tp"} holds then\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   381
  \hspace{7mm}@{text "\<exists>"}@{term n}. such that\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   382
  \hspace{7mm}@{text "is_final (steps (1, tp) p n)"} \hspace{1mm}@{text "\<and>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   383
  \hspace{7mm}@{text "Q holds_for (steps (1, tp) p n)"}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   384
  \end{tabular} &
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   385
  \begin{tabular}[t]{@ {}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   386
  \colorbox{mygrey}{@{thm (lhs) Hoare_unhalt_def}} @{text "\<equiv>"}\\[1mm]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   387
  \hspace{5mm}@{text "\<forall>"}@{term "tp"}.\\ 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   388
  \hspace{7mm}if @{term "P tp"} holds then\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   389
  \hspace{7mm}@{text "\<forall>"}@{term n}. @{text "\<not> is_final (steps (1, tp) p n)"}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   390
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   391
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   392
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   393
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   394
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   395
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   396
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   397
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   398
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   399
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   400
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   401
  \definecolor{mygrey}{rgb}{.80,.80,.80}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   402
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   403
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   404
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   405
  \frametitle{Hoare Reasoning}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   406
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   407
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   408
  \item reasoning is still quite difficult---invariants
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   409
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   410
  \footnotesize
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   411
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   412
\begin{tabular}{@ {\hspace{-4mm}}lcl@ {\hspace{-0.9cm}}l@ {}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   413
  \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   414
  @{thm (lhs) inv_begin1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin1.simps} & (starting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   415
  @{thm (lhs) inv_begin2.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin2.simps}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   416
  @{thm (lhs) inv_begin3.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin3.simps}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   417
  @{thm (lhs) inv_begin4.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin4.simps}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   418
  @{thm (lhs) inv_begin0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_begin01} @{text "\<or>"}& (halting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   419
                                &             & @{thm (rhs) inv_begin02}\smallskip \\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   420
   \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   421
  @{thm (lhs) inv_loop1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_loop1_loop.simps} @{text "\<or>"}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   422
                               &             & @{thm (rhs) inv_loop1_exit.simps} & (starting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   423
  @{thm (lhs) inv_loop0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_loop0.simps}& (halting state)\smallskip\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   424
   \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   425
  @{thm (lhs) inv_end1.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_end1.simps} & (starting state)\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   426
  @{thm (lhs) inv_end0.simps} & @{text "\<equiv>"} & @{thm (rhs) inv_end0.simps} & (halting state)\smallskip\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   427
  \hline
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   428
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   429
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   430
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   431
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   432
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   433
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   434
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   435
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   436
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   437
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   438
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   439
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   440
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   441
  \frametitle{Register Machines}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   442
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   443
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   444
  \item instructions
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   445
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   446
  \begin{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   447
  \begin{tabular}{rcl@ {\hspace{10mm}}l}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   448
  @{text "I"} & $::=$  & @{term "Inc R\<iota>"} & increment register @{text "R"} by one\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   449
  & $\mid$ & @{term "Dec R\<iota> L\<iota>"} & if content of @{text R} is non-zero,\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   450
  & & & then decrement it by one\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   451
  & & & otherwise jump to instruction @{text L}\\
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   452
  & $\mid$ & @{term "Goto L\<iota>"} & jump to instruction @{text L}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   453
  \end{tabular}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   454
  \end{center}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   455
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   456
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   457
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   458
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   459
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   460
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   461
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   462
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   463
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   464
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   465
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   466
  \frametitle{Recursive Functions}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   467
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   468
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   469
  \item addition, multiplication, \ldots
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   470
  \item logical operations, quantifiers\ldots
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   471
  \item coding of numbers (Cantor encoding)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   472
  \item UF\pause\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   473
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   474
  \item Recursive Functions $\Rightarrow$ Register Machines
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   475
  \item Register Machines $\Rightarrow$ Turing Machines
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   476
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   477
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   478
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   479
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   480
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   481
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   482
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   483
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   484
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   485
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   486
  \frametitle{Sizes}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   487
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   488
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   489
  \item UF (size: 140843)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   490
  \item Register Machine (size: 2 Mio instructions)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   491
  \item UTM (size: 38 Mio states)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   492
  \end{itemize}\bigskip\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   493
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   494
  \small
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   495
  old version: RM (12 Mio) UTM (112 Mio)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   496
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   497
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   498
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   499
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   500
text_raw {*
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   501
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   502
  \mode<presentation>{
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   503
  \begin{frame}[c]
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   504
  \frametitle{Separation Algebra}%
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   505
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   506
  \begin{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   507
  \item introduced a separation algebra framework for register machines and TMs 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   508
  \item we can semi-automate the reasoning for our small TMs
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   509
  \item we can assemble bigger programs out of smaller components\bigskip
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   510
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   511
  \item looks awfully like ``real'' assembly code\pause
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   512
  \item Conclusion: we have a playing ground for reasoning about low-level 
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   513
  code; we work on automation
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   514
  \end{itemize}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   515
  \end{frame}}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   516
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   517
*}
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   518
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   519
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   520
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   521
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   522
(*<*)
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   523
end
4457185b22ef added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   524
(*>*)