Tested using: Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Mac OS X 10.6.2
To create a FSM machine: 1) Make or use one of the sample input files (input, input1, or abc2) input is the example shown in class. input1 and abc2's FSM diagrams can be found in their corresponding name.png 2) At this time, the input file is hardcoded into the fsm_machine.py at line 13; sorry for any inconvenience at the moment. Please take a look at the input file sample for proper formatting of your data. Please don't include any special characters or parentheses. 3) The input order is: q=states (with first item being start state) f=accept states a=alphabet transition function maps 4) To create your machine: python fsm_machine.py check output and make sure there are no odd characters or garbage in the output. Then feel free to export the machine code from shell i.e. python fsm_machine.py > your_machine.py
To run your machine: python your_machine.py
- Enter string
- the fsm will say "yes" if acceptable "no" if not acceptable by this machine