1 / 15

Interactive Pushdown Automata Animation

Interactive Pushdown Automata Animation. Jennifer McDonald Jenimac@ccs.neu.edu College of Computer Science Northeastern University Boston, MA This work was partially supported by NSF grant DUE-9950829. Recipe for Visualization Tool Design (serves many hungry students).

Download Presentation

Interactive Pushdown Automata Animation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Interactive Pushdown Automata Animation Jennifer McDonald Jenimac@ccs.neu.edu College of Computer Science Northeastern University Boston, MA This work was partially supported by NSF grant DUE-9950829

  2. Recipe for Visualization Tool Design(serves many hungry students) • ¾ cup Interactivity • 2 tbsp Multiple representation of data • 6 oz Algorithmic animation with control • 1 Starting point from which to explore Mix well and serve to any students who wish to explore and learn!

  3. Interactivity • Students should be able to enter their own test data. • Students should be able to modify the existing structure to see how changing one piece will affect the overall outcome. • Students should be able to create and test their own structure.

  4. Multiple Views • All data members pertinent to the algorithm should be displayed to the user. • Data should be represented graphically, algorithmically, and/or mathematically. The more ways data is displayed, the better! • Views should be succinct and should fit on one screen.

  5. Algorithmic Animation with Control • Providing an animation of processes commonly demonstrated on the chalk-board can greatly increase a student’s understanding of the algorithm. • Students must be given control so that they can learn at their own pace. • Start, pause, step, and speed controls should always be available with an animation. • Giving students the ability to control color is also helpful.

  6. A Starting Point from which to Explore • Supply simple test cases for students to explore and get accustomed to the program. • Instruct students to start with simple test data such as the empty set.

  7. A Brief History of the Program • Began as an honors adjunct project for my own Automata Theory class. • Was later revised to be a proof-of-concept program for the JPT. • After the JPT overhaul it became a useful tool for the classroom.

  8. JPT as a Development Aid • Encapsulated away technical difficulties (listeners, threads, etc). • Solved layout and display problems that I was having. • Added error checking capabilities and allowed me to concentrate on implementing the algorithm.

  9. Level 1: All states in the automaton. (Hashtable) qS q1 q2 q3 q4 qF qF q1 qS q2 q4 q1 q4 Level 2: States that can be reached from each state in the automaton. (Hashtables) qF q3 q3 qF q4 qF The Data Structure A three dimensional container with two hashtables and a vector.

  10. qS q1 q2 q3 q4 qF Level 3: The transition rules to move from source state to target state. (Vectors) q1 E:$/E 1:$/E 0:$/E qF E:E/E • Searching this model is extremely efficient. • Uses the JPT Stringable interface to save and load from file: • To load model from a file: • automata = new Automata(FileUtilities.readFile(file)); • automata.draw(graphics); • repaint(); • To save model to a file: • FileUtilities.writeFile(file, automata.toStringData(), true);

  11. The Algorithm • Depth-first search of the PDA. • Recursion over six methods. • Three stacks to track progress: pushdownStack pathStack undoStack • Returns all paths found until a successful path is found. Animator chooses the path to animate.

  12. Check state of machine, return if successful path criteria has been met. If not, forward the source state and the current tape pointer. processTape( source state, tape ptr ) Find all states reachable from the source state. For each source-target pair, test transitions between them. Forward source, target, tape symbol, tape pointer, and the transitions between the pair. continueSearch( source state, tape symbol, tape ptr) Test the first transition to see if its stack criteria match the current stack conditions. If so, create a new path node and forward it along with the current tape pointer to visit. Repeat for every transition in the vector. testTransitions( source state, target state, tape symbol, tape ptr, transitions vector) visit( path node, tape ptr ) x N* Advance and rewind the machine. Advance pushes the node onto the path stack and the nodes action onto the undo stack. It then performs the action, increases the tape pointer and recurses back to process tape. Rewind reverts the machine to its former state before the advance method was called. advance( path node, tape ptr ) rewind() * Where M is the number of target states reachable from the source state and N is the number of transitions between the source state and the target state that move on Epsilon or the given tape symbol x M*

  13. The Animated Path If all possible paths are tested, why aren’t they all animated? For automata with many states and transitions, showing all paths can be confusing and time consuming. What is the acceptance criteria? Paths are accepted if they result in every character being read off of the tape and the stack is empty. What if the user creates a PDA with an infinite loop? Path traversal is limited to the depth maximum entered in the GUI. The default maximum is 100.

  14. The Future of the Pushdown Automata Program • The program will be introduced to the Automata Theory class during the Spring quarter. • You can download and use the program in your classroom: http://www.jenimac.com/JPT • “To do” list for Version 2.0: Dragable/editable capabilities when designing automaton. Animation option: best path or all paths showing depth first search. Acceptance criteria specification: user can choose to accept at end of tape, end of stack, or both.

  15. Interactive Pushdown Automata AnimationJennifer McDonaldCollege of Computer ScienceNortheastern UniversityBoston, MAEmail: jenimac@ccs.neu.eduWebsite: www.jenimac.com/JPTNU webiste: www.ccs.neu.edu/jptAcknowledgmentsThanks to my mentoring professors: Richard RasalaViera Proulxand also to:Jeff RaabThis work was partially supported by NSF grant DUE-9950829

More Related