Paper/Paper.thy
changeset 155 1834acc6fd76
parent 154 9b9e0d37fc19
child 156 7c9dbacc6c7c
equal deleted inserted replaced
154:9b9e0d37fc19 155:1834acc6fd76
  1396   Turing machines, an unexpected outcome of our work is that we
  1396   Turing machines, an unexpected outcome of our work is that we
  1397   identified an inconsistency in their use of a definition. This is
  1397   identified an inconsistency in their use of a definition. This is
  1398   unexpected since \cite{Boolos87} is a classic textbook which has
  1398   unexpected since \cite{Boolos87} is a classic textbook which has
  1399   undergone several editions (we used the fifth edition). The central
  1399   undergone several editions (we used the fifth edition). The central
  1400   idea about Turing machines is that when started with standard tapes
  1400   idea about Turing machines is that when started with standard tapes
  1401   they compute a partial arithmetic function.  The inconsitency is
  1401   they compute a partial arithmetic function.  The inconsitency arises
  1402   when they define when this function should \emph{not} return a
  1402   when they define the case when this function should \emph{not} return a
  1403   result. They write in Chapter 3 \cite[Page 32]{Boolos87}:
  1403   result. They write in Chapter 3, Page 32:
  1404 
  1404 
  1405   \begin{quote}\it
  1405   \begin{quote}\it
  1406   ``If the function that is to be computed assigns no value to the arguments that 
  1406   ``If the function that is to be computed assigns no value to the arguments that 
  1407   are represented initially on the tape, then the machine either will never halt, 
  1407   are represented initially on the tape, then the machine either will never halt, 
  1408   or will halt in some nonstandard configuration\ldots''
  1408   or will halt in some nonstandard configuration\ldots''
  1409   \end{quote}
  1409   \end{quote}
  1410   
  1410   
  1411   \noindent
  1411   \noindent
  1412   Interestingly, they do not implement this definition when constructing
  1412   Interestingly, they do not implement this definition when constructing
  1413   their universal Turing machine. On page 93, a recursive function 
  1413   their universal Turing machine. In Chapter 8, on page 93, a recursive function 
  1414   @{term stdh} is defined as:
  1414   @{term stdh} is defined as:
  1415 	
  1415 	
  1416   \begin{equation}\label{stdh_def}
  1416   \begin{equation}\label{stdh_def}
  1417   @{text "stdh(m, x, t) \<equiv> stat(conf(m, x, t)) + nstd(conf(m, x, t))"}
  1417   @{text "stdh(m, x, t) \<equiv> stat(conf(m, x, t)) + nstd(conf(m, x, t))"}
  1418   \end{equation}
  1418   \end{equation}
  1419   
  1419   
  1420   \noindent
  1420   \noindent
  1421   where @{text "stat(conf(m, x, t))"} computes the current state of the
  1421   where @{text "stat(conf(m, x, t))"} computes the current state of the
  1422   simulated Turing machine, and the @{text "nstd(conf(m, x, t))"} returns @{text 1}
  1422   simulated Turing machine, and @{text "nstd(conf(m, x, t))"} returns @{text 1}
  1423   if the tape content is non-standard. If either one evaluates to
  1423   if the tape content is non-standard. If either one evaluates to
  1424   nonzero, then @{text "stdh(m, x, t)"} will be nonzero, because of the $+$
  1424   something that is not zero, then @{text "stdh(m, x, t)"} will be not zero, because of 
  1425   operation. One the same page, a function @{text "halt(m, x)"} is defined 
  1425   the $+$-operation. One the same page, a function @{text "halt(m, x)"} is defined 
  1426   in terms of @{text stdh} for computing the steps the Turing machine needs to
  1426   in terms of @{text stdh} for computing the steps the Turing machine needs to
  1427   execute before it halts. According to this definition, the simulated
  1427   execute before it halts (in case it halts at all). According to this definition, the simulated
  1428   Turing machine will continue to run after entering the @{text 0}-state
  1428   Turing machine will continue to run after entering the @{text 0}-state
  1429   with a non-standard tape. The consequence of this inconsistency is
  1429   with a non-standard tape. The consequence of this inconsistency is
  1430   that there exists Turing machines that compute non-values
  1430   that there exist Turing machines that given some arguments do not compute a value
  1431   according to Chapter 3, but returns a proper result according to
  1431   according to Chapter 3, but return a proper result according to
  1432   the definition in Chapter 8. One such Turing machine is:
  1432   the definition in Chapter 8. One such Turing machine is:
  1433 
  1433 
  1434   %This means that if you encode the plus function but only give one argument,
  1434   %This means that if you encode the plus function but only give one argument,
  1435   %then the TM will either loop {\bf or} stop with a non-standard tape
  1435   %then the TM will either loop {\bf or} stop with a non-standard tape
  1436 
  1436 
  1439 
  1439 
  1440   %SO the following TM calculates something according to def from chap 8,
  1440   %SO the following TM calculates something according to def from chap 8,
  1441   %but not with chap 3. For example:
  1441   %but not with chap 3. For example:
  1442   
  1442   
  1443   \begin{center}
  1443   \begin{center}
  1444   @{term "[(L, (0::nat)), (L, 2), (R, 2), (R, 0)]"}
  1444   @{term "counter_example \<equiv> [(L, (0::nat)), (L, 2), (R, 2), (R, 0)]"}
  1445   \end{center}
  1445   \end{center}
  1446 
  1446 
  1447   \noindent
  1447   \noindent
  1448   If started with @{term "([], [Oc])"} it halts with the
  1448   If started with standard tape @{term "([], [Oc])"}, it halts with the
  1449   non-standard tape @{term "([Oc], [])"} according to the definition in Chapter 3---so no
  1449   non-standard tape @{term "([Oc], [])"} according to the definition in Chapter 3---so no
  1450   result is calculated; but with the standard tape @{term "([], [Oc])"} according to def Chapter 8.
  1450   result is calculated; but with the standard tape @{term "([], [Oc])"} according to the 
       
  1451   definition in Chapter 8. We solve this inconsitency in our formalisation by
       
  1452   setting up our definitions so that the @{text counter_example} Turing machine does not 
       
  1453   produce any result, but loops forever fetching @{term Nop}s in state @{text 0}. 
       
  1454   
  1451 *}
  1455 *}
  1452 
  1456 
  1453 (*
  1457 (*
  1454 section {* XYZ *}
  1458 section {* XYZ *}
  1455 
  1459