CSE P573 - Assignment 4 - Natural Language Processing Due: November 1, 2004 Turn in your assignment in both of two ways: 1. Hand in hardcopy in class AND 2. Before or after class email your prolog files and test sentences to danny@cs.washington.edu. Important: include your full name and the phrase "hw4" in the names of any file attachments. Do ONE of the following: Choice A: Expand genesis_compound.pl so that it handles: 1. Passive voice, e.g.: The apple is eaten. The apple is eaten by Adam. The apple is given to Adam by Eve. 2. Conditional statements, e.g.: If Eve loves the snake then Adam eats the apple. Adam eats the apple if Eve loves the snake. 3. Verb phrases that use "is" to describe the subject with either an adjective or noun phrase, e.g.: Eve is happy. The snake is Satan. Given at least a dozen examples showing that your grammar returns both a reasonable parse tree AND a reasonable logical form for each sentence. If a term needed for the logical form for a sentence does not actually appear in the sentence because of the use of passive voice, use the anonymous term "somebody" instead. For example, the first sentence above would get the meaning: eat(somebody,apple) Sentence-level connectives should still work, e.g. you should be able to handle: If Eve eats the apple then Adam eats the apple and Adam sleeps. For sentences that are syntactically ambiguous (such as the one just given), print out all the different parses by using the ";" after each is printed. You may find it difficult to make the passive voice work with compound subjects or objects, e.g.: Adam and Eve are loved by the snake. Give it a try, but if get stuck it is okay to not handle such combinations -- indicate whether you did or not on your turn in. Choice B: Select a paragraph from the newspaper or a children's book containing at least 3 sentences, and expand genesis_dcg_syntax.pl so that it is able to parse the paragraph. (This is the Definite Clause Grammar version of genesis_syntax.pl.) Describe the source of the text and show all of the parse trees for each sentence. Circle the parse tree that most accurately captures the true syntactic structure of each sentence (as best as you are able to tell). For the incorrect parse trees, briefly note what kind of information would need to be added to the grammar to eliminate them (for example, additional syntactic features such as case agreement, or what kinds of semantic information). Write your grammar while trying avoid clearly "impossible" (ungrammatical) parses, but don't worry if you cannot do so completely - that could be a major undertaking. Feel free to change or completely rewrite the assertions genesis_syntax.pl as necessary. Note that you do NOT need to create a logical form, only a parse tree. READING FOR CLASS ON NOV 1: R&N Chapter 13 (skip 13.7). Skim Ch 14.1 and 14.2 (we will be going over this carefully in class).