Finite State Machine

Part of my goal with this blog is to write about the Ubuntu experience, I’m still working on a wireless writeup but it keeps getting pushed back because everyone knows about Ubuntu wireless. I’m a student at the University of Toronto, and I’m currently taking CSC363 — Computability and Complexity. Anyways I’m doing my first assignment and the first question is to draw a finite state machine. My problem was that I would draw the finite state machine and the figure out that I missed some special case and have to re draw it. Getting frustrated I fired up synaptic and searched for (finite stat machine), synaptic returns four results but the one that catches my eye is graphviz, partly because it has the ubuntu logo beside it meaning its an officially supported package like gaim (anyone find a link to support this, I cant), and partly because of its decryption “rich set of graph drawing tools”. I install it and it all goes well, and then i do what I always do after I install a program, I run it.

I type “graphviz” into the terminal and nothing happens. Well thats weird usualy I can just run programs based off the names I installed them with. I go back to synaptic and check that its installed correctly which it is. So skip to the bottom of the description below and it turns out that graphviz website, all the time that I’m doing this my buddy is sitting beside me trying to find a windows program to draw finite state machines.

Heading over to the website it turns out that they have some great examples of finite state machines and the “source code” that was used to make them. It is at about this time that my buddy finds JFLAP and starts to download it, you have to fill out a bunch of information before you can. A bit more searching on that website and I learn that I can “compile” that source code code to a png image with the following command “ccomps -x fsm.dot | dot | gvpack | neato -s -n2 -Tpng > fsm.png”

Now as a side note the nifty thing is that JFLAP (the program my buddy found) is a jar file so we should be able to run it on linux, while I continued to use graphviz to do my assignment because I liked to type up the finite state machine and then compile it, if you want to test your finite state machine you may want to look into using JFLAP.

After I get my assignment back Ill post my finite state machine and its source if there is interest.

6 Responses to Finite State Machine

  1. Keith says:

    Dia (http://www.gnome.org/projects/dia/) is another nifty program for creating different types of diagrams. It’s not completely painless to use for some things, but if you are just doing basic UML, etc diagrams, it will do the trick.

  2. Someone who knows octal and hex says:

    I’m sure it’s elsewhere (synaptic help?) but…
    https://help.ubuntu.com/community/SynapticHowto#head-944768c71cce2578ed4de9f367d37772ed2df659

  3. ranf says:

    You could download the “Makefile” from my little test project:
    https://code.launchpad.net/~ranf/+junk/hibernate.dot

    Just change line 1 to “PROJECT=fsm” and run “make test”.

  4. earobinson says:

    Thanks for the other suggestions for programs I can use, I may just check them out next time I need to make a finite state machine.

    Someone who knows octal and hex, I dont think the link you posted actually says anything about the ubuntu symbol in synaptic cuz thats what I looked at first.

  5. Thanks for accept me as the member. I may just check them out next time I need to make a finite state machine.

    Someone who knows octal and hex, I dont think the link you posted actually says anything about the ubuntu symbol in synaptic cuz thats what I looked at first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: