SUNY Geneseo Department of Mathematics
Friday, March 11
Math 304
Spring 2016
Prof. Doug Baldwin
interpret( 〈M〉, w )
(〈M〉 = list of states, transition function as table indexed by state and tape symbol)
tape = [ w ]
tapePos = 1
state = q0
while state ≠ qaccept and state ≠ qreject
nextState, symbol, dir = M.transitions( state, tape(tapePos) )
state = nextState
tape(tapePos) = symbol
if direction = 'L'
tapePos = tapePos - 1
else
tapePos = tapePos + 1
end while