Over the weekend I read chapter 7 of the Linz book. It is about Pushdown Automata. The major difference between Pushdown Automata and DFA is that PA uses a stack to hold relevant information. There are two kinds of PA, nondeterministic and deterministic. Generally, nondeterministic pushdown automata (NPDA) are used more frequently. Edges in NPDA include three pieces of information: input variable, top element in the stack, and element to replace the top of the stack. NPDA is proved to be equivalent to context-free grammars and context-free languages. There is a part in JFLAP that lets you transfrom from one to another.
Today is a day to celebrate: my office is finally ready! I have a big monitor in there. I spent most of my day implementing a Finite State Machine tester. This tester is modified from
FAEditor created by Martin last summer. The tester, as shown below in a screenshot, is able to provide a whole exercise set. Clicking on different question indices will lead to different questions. Students are able to either create a new machine with the editor or load one from local machine. After they finish, the “test” button will begin the tests and the results are shown at the bottom of the page. Test cases, standard answers and test results are provided, just like how Duke CS classes’ APT testers. Test cases are provided because I believe it is harder for students to “hard code” them in the machine than to actually think about the problems.
Test problems are imported from a JSON file which can be modified by instructors. There will probably also be an exercise problem editor, in which users can create problems and save in JSON format. JSON file is read synchronously, because the exercise may only continue after the problems are loaded! I totally ignored the warning from jQuery about doing so would be detrimental to user experience. I had no choice. Another challenge that I faced was integrating the multiple problem feature. I solved it using a variable to store current exercise, and created an update function to update user interface and the tester.
Tomorrow I will probably be working on the problem editor, or implement a new kind of exercise.