CS421 - Theory of Computing (Required Course) Spring 2006 CRN: 21807 Instructor: Rika Yoshii TR 4:00 to 5:15 Arts 220 Office Hours: TR 2:30 to 4pm tentatively in SCI2 231 750-4121 Email: ryoshii@csusm.edu Web: csweb.csusm.edu/ryoshii/ryoshii.html This document contains important information about the course. You are responsible for knowing all rules and procedures discussed in this document. If you have not attended the course by the end of the first week I reserve the right to administratively drop you from the course. AIM OF THE COURSE Welcome to cs421 Theory of Computing! This course is an introduction to the formal models of computation. We will explore the fundamental ideas underlying computing and text processing which had their beginnings in various fields such as engineering, mathematics and linguistics. The language-theory concepts covered here are used in the specification of programming languages, and thus in the design and implementation of compliers and text processors. You must know these concepts in order to develop any text processor and be assured of its correctness. Because the concepts seem abstract, I will try to relate each to the design and implementation of compiler parts. We will first introduce you to the notion of a finite description of a language - the grammar. We will then discuss the relationships between classes of “machines” and classes of grammars. Topics will include: regular grammars, regular expressions, and finite state automata; context free grammars and push down automata; Turing machines and the halting problem. Goals for yourself: I hope, by the end of the semester, you will learn to use formal methods for designing and implementing any text processor instead of using ad hoc methods. Prerequisites: Data Structures and Discrete Math. Those without the above pre-reqs will be asked to drop immediately. Curriculum 91 Knowledge units covered are: AL7, PL7 and PL8 THE TEXT AND REQUIRED MATERIAL The required book is “An Introduction to Formal Languages and Automata” by Peter Linz. (3rd edition). References I use are: Introduction to Automata Theory, Languages and Computation by Hopcroft and Ullman. Formal Languages and Their Relation to Automata by Hopcroft and Ullman - Chapter 2. On-line notes will usually be available before class. My notes will often contain more information than the textbook. Therefore, please be sure to print and place them in a binder for the class. They will be in /cs/cs421 on empress.csusm.edu (unix server). I will make announcements, handouts, assignments and homework solutions in electronic mail. You are responsible for checking your email whenever you are on campus and more often if you have access from home. Please feel free to send me questions over email. LECTURES Lectures will go over the concepts and algorithms covered in the text. Please familiarize yourself with the topic before you come to each lecture (Read my typed notes before lectures!). It is very difficult to grasp the details from the lectures alone; therefore, you are asked to re-read the corresponding chapter after each lecture, and ask me any questions at the beginning of the next lecture, during my office hours, or via email. As a member of the educational technology community, I firmly believe in “interactive learning.” Therefore, you will be encouraged to share your opinions, and answer my questions in class. Learning is not a passive activity. I will give you extra-credit opportunities for presentations in class. GROUP WORK Note that it is very important for you to learn to work in a group situation to become a software engineer. Almost all software engineering projects will be done by groups. You will need to learn to deal with problems such as schedule conflicts and personality conflicts. Therefore, most homework assignments and the project will be done with your partners. You will select your partners and inform me during the first week of the course. Each group must have 3 people. YOU MUST INFORM ME and YOUR PARTNERS if you decide to drop the course. Group size has little to do with amount of work; but if you are down to 1 person in a group, we will re-assign you to another group. Although everyone must work on all problems individually, you must then get together to type up the final version of each assignment. Each member MUST bring his/her own draft of all problems to the meeting. Each member's draft must be attached to the submission, or you will not get any credit for the problem(s). For details, see the HW-grading-policy file. Things you should decide before you work on HW1: - how to contact each other, - how to go over each other's work (e.g. email), - when to assemble the work together in person. HOMEWORK and WORKLOAD Homework assignments are based on lectures and reading materials. They become available as I finish each topic. Some problems are analysis problems (e.g. exercises from the textbook while others are implementation of algorithms.) All homework programs will be done using C++ (compilable with g++) so that they can be executed on our machines. Report grading and recording errors promptly in writing. No work will be re-graded after the next assignment has been graded. Use grade-error-report. As with any senior level course, you will be asked to spend about 6 hours a week outside the class for preparation, review and assignments. How to Succeed in Any Class Create a binder of your own “book” for the course. For each lecture you attend, have sections for: Notes taken in class (add to my notes) Additional information from the book Some example problems you worked on Any other info (e.g. from the web) And insert the completed homework in between. GROUP PROJECT The list of acceptable projects and requirements will be available later in the semester and be due towards the end of the semester. You will actually Implement a scanner and a parser. LATE WORK Once you fall behind, it will be very difficult to catch up. Therefore, we will stick to strict deadlines. We will deduct 5 pts for each calendar day that the assigned homework is late. No excuses are allowed. We will not accept any late work beyond the start of the next lecture since solutions will be made available. If you miss two assignments in a row, you will be asked to drop the course since there is no way for you to catch up and pass the class. Absolutely no late work is accepted for the project. CHEATING POLICY I take the issue of cheating and plagiarism very seriously. Any copying of any part of another's work will result in zero points for all parties involved (copier and copiee). INCOMPLETE Please refer to our web page for the policy on Incompletes. They are given only for emergency situations. GRADING Your grade will be based on the following criteria: HW assignments - 70% Project - 30% ----------------------Total 100% (plus any extra work or class participation added to the HW total - up to 3% of the HW total) Scale: Total Grade --------------------------93-100 A 90-92 A88-89 B+ 83-87 B 80-82 B78-79 C+ 70-77 C 65-69 C63-64 D+ 60-62 D 56-59 D0-55 F This is an absolute scale. You can guarantee yourself a particular grade by attaining the appropriate overall percentage. You will not have to worry how other students are doing. The scale may be adjusted down depending on the class performance, but it will never be adjusted upwards. Tentative Schedule – APPROXIMATE Class starts January 17th, 2006 Jan 31 Last day to add classes. Jan 31 Last day to drop full semester classes with no academic record March 26 – Apr 2 Spring Break (between Week 10 and 11) Note: Some HW assignments may be given in multiple parts. Some HW assignments may be given as in class exercises. Week Topic ---------------------------------------------1-3 Introduction/Background - math background, definitions and notation - Grammars, Languages and Automata (HW1 and HW2) 4-6 Finite Automata and Regular Grammars - finite state systems - deterministic FA - non-deterministic FA - FA with e-moves Regular Languages and Regular Grammars - Regular expressions - Regular languages - Regular grammars (HW3) - 2-way FA - FA with output - Applications 7 Properties of Regular Languages - Pumping Lemma - Closure properties - Decision Algorithms (HW4) 8-10 Context Free Grammars - Derivation Trees - Parsing and Ambiguity - Simplification - Chomsky Normal Form - Griebach Normal Form (HW5) Chapter 1.1 1.2 and Reference 2 3 notes 4 5&6 11 Pushdown Automata - definition - relation to CFGs (HW6) 7 12 Properties of Context-Free Languages - Pumping Lemma - Closure properties - Decision Algorithm (HW7) 8 13-14 Turing Machines - relation to languages - computable languages - techniques for construction - modifications - Church's hypothesis - as an enumerator (HW8) 9&10 15-16 Undecidability - recursive and recursively enumerable languages - Universal Turing Machine - undecidability - Project demos 11&12