This is a program meant to visualize the operation of Finite Automata (both Deterministic and Nondeterministic) . It is written in python, using the Processing for Python Library for the visualization. The user can build an automaton and provide it with input to see the process by which it computes. By default, the user is building a Nondeterministic Finite Automaton (NFA) with epsilon transitions because that encompasses the function of Deterministic Finite Automata as well. After creating an NFA, the user can generate the equivalent DFA using the Powerset Construction Method.
To use the program you need a working version of Processing for Python. Open the sketch (open the automata_vis.pyde file with Processing) and click the run button. The following list is all the information you need to know:
- Circles on the screen represent states.
- The blue circle is the starting state.
- Any circle with an inner purple circle is an accepting state.
- To create a new state, double click anywhere on the screen.
- To delete a state, double click it -- you cannot delete the initial state.
- To move a state, click and drag with your mouse.
- To designate a state as accepting, right click it.
- Curves connecting states represent transitions.
- The characters listed close to the curve are the characters such that if one of them is given to the source state, it transitions to the destination.
- For any curve, if it is concave up, the source is the left vertex; if it is concave down, it is the right vertex.
- All states must define transitions for all characters of the alphabet (the default is [0,1])
- To create a transition, left click on any state.
- That will highlight it as selected (shown as a square around that state).
- Then click on another state.
- You will be prompted to provide a character for the transition, do that (by typing the character and hitting Enter), and it will appear on the screen.
- To remove a transition, repeat the same process you followed to create it.
- Typing will add to the input string, appearing on the top of the screen.
- Pressing Enter will give that string to the automaton.
- The active states of the automaton are highlighted in green.
- Typing toDFA in the input string will prompt the program to create an equivalent DFA from the NFA that is on the screen.
- Typing clear in the input string will reset everything.
- Enjoy!