# contains 1100 or does not contain 1010
transitions :
  #   state x alpha -> state
  - [ s,      ~,        q0 ]
  - [ q0,     [0,1],    q0 ]
  - [ q0,      1,       q1 ]
  - [ q1,      1,       q2 ]
  - [ q2,      0,       q3 ]
  - [ q3,      0,       q4 ]
  - [ q4,     [0,1],    q4 ]
  - [ s,       ~,       r0 ]
  - [ r0,      0,       r0 ]
  - [ r0,      1,       r1 ]
  - [ r1,      0,       r2 ]
  - [ r1,      1,       r0 ]
  - [ r2,      1,       r3 ]
  - [ r2,      0,       r0 ]
  - [ r3,      0,       r4 ]
  - [ r3,      1,       r1 ]
start:    s
accept:  [q4, rS, r0, r1, r2, r3 ]
tests :
  - [ yes,                  ]
  - [ yes, 1100             ]
  - [ yes, 111110000000     ]
  - [ no,  1010             ]
  - [ no,  1111111010000000 ]
  - [ no,  101010101010     ]
  - [ yes, 110011100        ]
  - [ no,  1011010          ]
  - [ no,  1001010          ]
# These last two tests were motivated by class discussion,
# when the machine had (r3, 1, r0)
# and showed that I needed to send the failed r3 to r1 instead.
# so that the failed 1 could be the start of the 1010 pattern.
# Matt suggested that the failed r2 also had that problem,
# but since the last two characters in that case are 00,
# it should as it does go back to r1 and start looking for the 1st 1.
