Do you want to build your own finite state machine? No problem, you can it today. Just follow this steps :
Step 1:
Go to link http://www2.research.att.com/~fsmtools/fsm/license.html and download fsm tool in your architecture.
Go to link http://www.graphviz.org/ and download graphviz package and install.
Real Life Example:
For example now I show you a final state machine of a turnstile machine that you use in your daily life.
There are two states in this final state machine that is "Locked" and "Un-Locked". I represent it "0" and "1" respectively in my fsm file. It's look like:
And the lexicon or symbol file look like:
At the end the final state machine is:
Thank you.
Have a nice day.
Step 1:
Go to link http://www2.research.att.com/~fsmtools/fsm/license.html and download fsm tool in your architecture.
Go to link http://www.graphviz.org/ and download graphviz package and install.
Step 2:
Write a fsm file like a text file with some rules. First column is "from state", second column is "to state", third column is input symbol, last column is weight and last row/rows are final state. Create this file and save it with ".fsm" extension. For example: A.fsm.
Now write a lexicon or symbol file with some rules. First row is input symbol that you mentioned before and second column is serial number. Create this file and save it with ".lex" extension.
For example: A.lex.
Step 3:
Now open your terminal or cmd and go with terminal or cmd to those folder where you made this two files. You can build your grep with some command now. First put the url until bin/fsmcompile where you save your fsm folder and put a command like: (late file name is A) "fsmcompile -i A.lex A.fsm > A.fsa". Now put another command like: "fsmdraw -i A.lex A.fsa | dot -Teps > A.eps". You can see that A.eps file create same folder automatically, open it and can see like:
Real Life Example:
For example now I show you a final state machine of a turnstile machine that you use in your daily life.
There are two states in this final state machine that is "Locked" and "Un-Locked". I represent it "0" and "1" respectively in my fsm file. It's look like:
And the lexicon or symbol file look like:
At the end the final state machine is:
Thank you.
Have a nice day.
No comments:
Post a Comment