Skip to content

Instantly share code, notes, and snippets.

@AldairCoronel
Created June 10, 2019 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AldairCoronel/f38af170964a4c5fdfa4515c92a38e8e to your computer and use it in GitHub Desktop.
Save AldairCoronel/f38af170964a4c5fdfa4515c92a38e8e to your computer and use it in GitHub Desktop.
tm_states :: State -> Char -> (State, Char, Movement)
tm_states "q0" 'a' = ("q1", 'A', R)
tm_states "q0" 'B' = ("q4", 'B', R)
tm_states "q1" 'a' = ("q1", 'a', R)
tm_states "q1" 'b' = ("q2", 'B', R)
tm_states "q1" 'B' = ("q1", 'B', R)
tm_states "q2" 'b' = ("q2", 'b', R)
tm_states "q2" 'C' = ("q2", 'C', R)
tm_states "q2" 'c' = ("q3", 'C', L)
tm_states "q3" 'A' = ("q0", 'A', R)
tm_states "q3" 'C' = ("q3", 'C', L)
tm_states "q3" 'b' = ("q3", 'b', L)
tm_states "q3" 'B' = ("q3", 'B', L)
tm_states "q3" 'a' = ("q3", 'a', L)
tm_states "q4" 'B' = ("q4", 'B', R)
tm_states "q4" 'C' = ("q4", 'C', R)
tm_states "q4" '_' = ("qf", '_', R)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment