Turning Automata Theory into a Hands-on Course * Susan H. Rodger Computer Science Duke University Durham, NC 27708 rodger@cs.duke.edu Bart Bressler Computer Science Duke University Durham, NC 27708 Thomas Finley Computer Science Cornell University Ithaca, NY 14853 Stephen Reading Computer Science Duke University Durham, NC 27708 ABSTRACT We present a hands-on approach to problem solving in the formal languages and automata theory course. Using the tool JFLAP, students can solve a wide range of problems that are tedious to solve using pencil and paper. In combi- nation with the more traditional theory problems, students study a wider-range of problems on a topic. Thus, students explore the formal languages and automata concepts compu- tationally and visually with JFLAP, and theoretically with- out JFLAP. In addition, we present a new feature in JFLAP, Turing machine building blocks. One can now build com- plex Turing machines by using other Turing machines as components or building blocks. Categories and Subject Descriptors F.4.3 [Theory of Computation]: Mathematical Logic and Formal Languages Formal Languages; D.1.7 [Software]: Pro- gramming Techniques Visual Programming General Terms Theory Keywords JFLAP, automata, pushdown automata, Turing machine, grammar, SLR parsing, LL parsing, L-system 1. INTRODUCTION Traditionally, the formal languages and automata (FLA) courses have assigned pencil and paper homework exercises of two types: proofs and construction exercises. The second of these types of problems are limited to small examples. Even on a moderate-size example of constructing an au- tomaton with eight states, students are unlikely to do much * The work of all four authors was supported in part by the National Science Foundation through grant NSF DUE CCLI-EMD 0442513. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SIGCSE’06 March 1–5, 2006, Houston, Texas, USA. Copyright 2006 ACM 1-59593-259-3/06/0003 ... $5.00. testing as it is tedious to trace by hand. Grading such prob- lems is similarly slow and error prone. We describe a hands-on approach to the FLA course that allows students to explore many of the FLA concepts com- putationally and visually using the tool JFLAP. We are not advocating to remove the proof type of exercises from the course, but rather to supplement them with hands-on explo- rations of related topics. For example, consider the problem of proving that if a language L is regular, then so is the lan- guage L R (the language with all strings from L reversed). This is a common proof-type problem given in this course. For some students, before proving this, it might be helpful to visualize an example first. They start with some regular language L, build a deterministic finite automaton (DFA) for it, and then convert this DFA into a DFA for L R . They must create test data for both DFA to convince themselves that the DFA are correct. This approach relates the FLA course more in line with the majority of their computer sci- ence courses which are hands on and involve constructing, debugging and testing. Others have taken similar hands-on approaches to the FLA course, but focus on a smaller number of topics. Tur- ing’s World[1] allows one to create and experiment with Turing machines and automata. The focus is on Turing ma- chines and submachines. Taylor[8] uses the software Deus Ex Machina letting users experiment with Turing machines, fi- nite automata, pushdown automata, and several other types of automata. Forlan[7] is a toolset used in conjunction with Standard ML for creating and experimenting with finite au- tomata, regular expressions and grammars. Language Emu- lator[9] is a toolkit for a number of forms of regular lan- guages including Moore and Mealy machines, and many types of translations between the forms. Grinder[4] has de- veloped the FSA Simulator for experimenting with finite state automata. It is part of Webworks[3], an extensive hy- pertextbook under development that will cover many topics in automata theory. It incorporates text, sound, pictures, il- lustrations, slide shows, video clips and active learning mod- els. In this paper we present an overview of JFLAP and then give several examples of how it can be used computationally and visually to explore FLA concepts in depth. We then present new features of JFLAP including the ability to build more interesting Turing machines with building blocks. Tur- ing machines built can be named and reused as a component in another Turing machine. We conclude with an evaluation of JFLAP’s use around the world and a description of future work.