This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: HW 2 – Unification, Type Derivation, Regular Expressions and Finite State Automata, Parse Trees and Ambiguous Grammars CS 421 – Fall 2007 Revision 1.0 Assigned Tuesday, October 23, 2007 Due Tuesday, October 30, 2007, 2:00 PM - in class Extension No extension, due to proximity to second midterm 1 Change Log 1.0 Initial Release. 2 Turn-In Procedure Your answers to the following questions are to be hand-written, or printed, neatly on one or more sheets of paper, each with your name in the upper right corner. The homework is to be turned in in class at the start of class. Alternately, you may hand it to Prof. Elsa Gunter in person before the deadline. 3 Objectives and Background The purpose of this HW is to test your understanding of • How to unify a system of equations • How to perform type derivations in simplified OCaml • How to use regular expressions and finite state automata to formally express sets of strings (called languages ) given by an English language description • How to create a parse tree for a given string with a given grammar • How to disambiguate a grammar Another purpose of HW2 is to provide you with experience answering non-programming written questions of the kind you may experience on the second midterm and final. Caution: It is strongly advised that you know how to do these problems before the second midterm....
View Full Document
- Fall '08
- Regular expression, Formal grammar