###################################################################### # busybeaver3.yvtm # # A .yvtm file (yaml virtual turing machine) # is a representation of a Turing machine. # # See: # - http://en.wikipedia.org/wiki/Turing_machine # - https://en.wikipedia.org/wiki/Busy_beaver # - http://www.yaml.org/start.html # # There are libraries for reading YAML file for # lots of coding languages. For python, # the following code # # >>> import yaml # >>> turing = yaml.load(open('busybeaver3.yvtm')) # # would give the following python data structure # # turing = {'tape' : '0', # 'accept' : [], # 'reject' : [], # 'blank' : '0', # 'machine': [['one', '0', 'two', '1', 'right'], # ['one', '1', 'HALT', '1', 'right'], # ['two', '0', 'three','0', 'right'], # ['two', '1', 'two', '1', 'right'], # ['three', '0', 'three','1', 'left'], # ['three', '1', 'one', '1', 'left']] # } # # Notes : # - The tape has blank symbols as far as needed to the left and right. # - The leftmost symbol in the "tape" spec is the first read. # - The move command is one of (right, left, stay). # - The machine should stops after either # - moving into any of the accept or reject states # - there is no appropriate rule. # - The tape (and blank) specification below has quotes # so that it is a string, not a number. (The YAML spec # will turn a bare word into a string, but not a bare number.) # # Are we having fun yet? # # # Jim Mahoney | Oct 2016 | MIT License ##################################################################### tape: "0" start: one blank: "0" accept: [] reject: [] machine: # current read next write move # state symbol state symbol to # ----- ------ -------- ----- ----- - [ one, 0, two, 1, right ] - [ one, 1, HALT, 1, right ] - [ two, 0, three, 0, right ] - [ two, 1, two, 1, right ] - [ three, 0, three, 1, left ] - [ three, 1, one, 1, left ]