Paper.thy
changeset 29 1569a56bd81b
parent 28 d22d02d41b26
child 30 ba789a0768a2
equal deleted inserted replaced
28:d22d02d41b26 29:1569a56bd81b
   313   two Turing machine by ``shifting'' the states of one by an appropriate
   313   two Turing machine by ``shifting'' the states of one by an appropriate
   314   amount to a higher segment.
   314   amount to a higher segment.
   315 
   315 
   316   An \emph{instruction} @{term i} of a Turing machine is a pair consisting of a
   316   An \emph{instruction} @{term i} of a Turing machine is a pair consisting of a
   317   natural number (the next state) and an action. A \emph{program} @{term p} of a Turing
   317   natural number (the next state) and an action. A \emph{program} @{term p} of a Turing
   318   machine is then a list of such pairs. Given a program @{term p}, a state
   318   machine is then a list of such pairs. We have organised our programs
       
   319   such that 
       
   320 
       
   321   \begin{center}
       
   322   XXX
       
   323   \end{center}
       
   324 
       
   325   \noindent
       
   326   Given a program @{term p}, a state
   319   and the cell being read by the read-write unit, we need to fetch
   327   and the cell being read by the read-write unit, we need to fetch
   320   the corresponding instruction from the program. For this we define 
   328   the corresponding instruction from the program. For this we define 
   321   the function @{term fetch}
   329   the function @{term fetch}
   322  
   330  
   323   \begin{center}
   331   \begin{center}
   423   which looks up the content of register $R$; if $R$
   431   which looks up the content of register $R$; if $R$
   424   is not in this list, then we return 0. Similarly we
   432   is not in this list, then we return 0. Similarly we
   425   have a setting function, written @{term "abc_lm_s m R\<iota> n"}, which
   433   have a setting function, written @{term "abc_lm_s m R\<iota> n"}, which
   426   sets the value of $R$ to $n$, and if $R$ was not yet in $m$
   434   sets the value of $R$ to $n$, and if $R$ was not yet in $m$
   427   it pads it approriately with 0s.
   435   it pads it approriately with 0s.
       
   436 
       
   437 
       
   438   Abacus machine halts when it jumps out of range.
   428 *}
   439 *}
   429 
   440 
   430 
   441 
   431 section {* Recursive Functions *}
   442 section {* Recursive Functions *}
   432 
   443