Paper.thy
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 03 Jan 2013 00:53:14 +0000
changeset 11 3d84f4dd6a01
parent 10 44e9d0c24fbc
child 12 dd400b5797e1
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
(*<*)
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
theory Paper
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
imports UTM
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
begin
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
declare [[show_question_marks = false]]
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
(*>*)
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
section {* Introduction *}
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
text {*
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
8
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    13
\noindent
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    14
We formalised in earlier work the correctness proofs for two
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    15
algorithms in Isabelle/HOL---one about type-checking in
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    16
LF~\cite{UrbanCheneyBerghofer11} and another about deciding requests
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    17
in access control~\cite{WuZhangUrban12}.  The formalisations
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    18
uncovered a gap in the informal correctness proof of the former and
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    19
made us realise that important details were left out in the informal
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    20
model for the latter. However, in both cases we were unable to
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    21
formalise in Isabelle/HOL computability arguments about the
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    22
algorithms. The reason is that both algorithms are formulated in terms
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    23
of inductive predicates. Suppose @{text "P"} stands for one such
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    24
predicate.  Decidability of @{text P} usually amounts to showing
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    25
whether \mbox{@{term "P \<or> \<not>P"}} holds. But this does \emph{not} work
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    26
in Isabelle/HOL, since it is a theorem prover based on classical logic
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    27
where the law of excluded middle ensures that \mbox{@{term "P \<or> \<not>P"}}
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    28
is always provable no matter whether @{text P} is constructed by
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    29
computable means. The same problem would arise if we had formulated
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    30
the algorithms as recursive functions, because internally in
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    31
Isabelle/HOL, like in all HOL-based theorem provers, functions are
10
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    32
represented as inductively defined predicates too.
8
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    33
10
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    34
The only satisfying way out in a theorem prover based on classical
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    35
logic is to formalise a theory of computability. Norrish provided such
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    36
a formalisation for the HOL4 theorem prover. He choose the
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    37
$\lambda$-calculus as the starting point for his formalisation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    38
of computability theory,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    39
because of its ``simplicity'' \cite[Page 297]{Norrish11}.  Part of his
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    40
formalisation is a clever infrastructure for reducing
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    41
$\lambda$-terms. He also established the computational equivalence
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    42
between the $\lambda$-calculus and recursive functions.  Nevertheless he
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    43
concluded that it would be ``appealing'' to have formalisations for more
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    44
operational models of computations, such as Turing machines or register
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    45
machines.  One reason is that many proofs in the literature refer to
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    46
them.  He noted however that in the context of theorem provers
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    47
\cite[Page 310]{Norrish11}:
8
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    48
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    49
\begin{quote}
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    50
\it``If register machines are unappealing because of their 
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    51
general fiddliness, Turing machines are an even more 
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    52
daunting prospect.''
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    53
\end{quote}
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    54
c216ae455c90 more on the paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 7
diff changeset
    55
\noindent
10
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    56
In this paper we took on this daunting prospect and provide a formalisation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    57
of Turing machines, as well as Abacus machines (a kind of register machine)
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    58
and recursive functions. Theorem provers are at their best when the data-structures 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    59
at hand are ``structurally'' defined (like lists, natural numbers,
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    60
regular expressions, etc). The reason why reasoning about Turing machines 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    61
is challenging is because they are essentially ... 
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    62
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    63
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    64
For this we followed mainly the informal
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    65
proof given in the textbook \cite{Boolos87}.
6
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
9
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    70
``In particular, the fact that the universal machine operates with a
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    71
different alphabet with respect to the machines it simulates is
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    72
annoying.'' he writes it is preliminary work \cite{AspertiRicciotti12}
6
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
9
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    75
Our formalisation follows \cite{Boolos87}
6
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    77
\noindent
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    78
{\bf Contributions:} 
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    79
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    80
*}
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    81
9
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    82
section {* Formalisation *}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    83
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    84
text {*
10
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 9
diff changeset
    85
  
9
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    86
*}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 8
diff changeset
    87
7
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    88
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    89
section {* Wang Tiles *}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    90
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    91
text {*
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    92
  Used in texture mapings - graphics
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    93
*}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    94
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    95
6
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    96
section {* Related Work *}
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    97
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    98
text {*
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
  The most closely related work is by Norrish. He bases his approach on 
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
  lambda-terms. For this he introduced a clever rewriting technology
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
  based on combinators and de-Bruijn indices for
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
  rewriting modulo $\beta$-equivalence (to keep it manageable)
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
*}
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   105
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   106
(*
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   107
Questions:
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   108
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   109
Can this be done: Ackerman function is not primitive 
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   110
recursive (Nora Szasz)
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   111
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   112
Tape is represented as two lists (finite - usually infinite tape)?
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   113
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   114
*)
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   115
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   116
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   117
(*<*)
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   118
end
50880fcda34d added paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   119
(*>*)