CSC 350 Exam 2 Page 1 of 5 Name___ KEY ____ points _____ MULTIPLE CHOICE/SHORT ANSWER. 3 points each. Choose the ONE best answer. 1. Tagsets are used to a) define the meaning of words b) define the meaning of sentences C c) show parts of speech of words d) label the antecedents of pronouns 2. What is true of a type 0 (unrestricted grammar) language? a) It takes the power of a Turing machine to recognize some of the languages in this set. b) It takes the power of a Turing machine to recognize any language in this set. c) A finite automaton has enough power to recognize any language in this set. d) A finite automaton lacks the power to recognize A any language in this set. e) b and d 3. It appears clear that type 2 (context-free) languages a) are powerful enough to generate any human language. b) require additional mechanisms, such as transformations, to generate a human language. c) are more powerful than type 1 languages. B d) can be implemented using a finite automaton. 4. Bottom-up parsing a) is the method of choice for human-created parsers. b) is used by Prolog when interpreting a definite clause grammar. c) uses a shift/reduce procedure to generate a parse tree by starting at the root. d) looks at the top items in the processed stack to see if they D look like the right hand side of a production. 5. Top down parsing a) begins at the leaves and combines a "forest" into a single tree. b) begins at start symbol and adds nodes to build a tree. c) passes attributes down the parse tree. B d) passes attributes up the parse tree. Consider the following grammar for NLP of e-purchases. sent --> verb, obj, vcomp, ['.']. verb --> [remove] ; [add]. obj --> [X]. vcomp --> prep, [my], [cart] ; []. prep --> [to] ; [from]. 6. Which sentence is not recognized by the grammar? a) add motherboard to my cart. b) add to my cart dvd-rw. c) remove cpu to my cart. B d) remove pci-e-card from my cart. CSC 350 Exam 2 Page 2 of 5 Name___ KEY ____ points _____ 7. Which set of rules completes the modification to correctly match 'verb' with the appropriate 'prep'? sent --> verb(V), obj, vcomp(V), ['.']. verb(V) --> [V]. vcomp(X) --> prep(X), [my], [cart] ; []. a) prep(X) --> [to], {X = to} ; [from], {X = from}. b) prep(X) --> [to], {X == to} ; [from], {X == from}. c) prep(X) --> [to], {X == add} ; [from], {X == remove}. C d) prep(X) --> [add], {X == add} ; [remove], {X == remove}. 8. We add a shoppingcart/1 predicate to the code. And assume a user starts with it preloaded with some basics: shoppingcart([bread, milk, skittles]). Which rule correctly updates the shopping cart? a) sent --> [add], obj(X), vcomp, ['.'], {shopping_cart(X)}. b) sent --> [add], obj(X), vcomp, ['.'], {shopping_cart([X])}. c) sent --> [add], obj(X), vcomp, ['.'], {shopping_cart(Y), append([X],Y,Z), assert(shopping_cart(Z))}. d) sent --> [add], obj(X), vcomp, ['.'], C {assert(shopping_cart([X]))}. 9. The grammar above was stated using a) Backus Naur Form (BNF) b) Extended Backus Naur Form (EBNF) C c) a Prolog definite clause grammar d) a Prolog difference list 10. Pattern matching is matching a given input against a set of existing patterns. This makes Prolog especially useful in a rapidly prototyped template system. Which patterns will be matched by the given query? | ?- translate([a,b],X). A. translate([X,Y,Z | Rest],Z) :- translate(Rest,_). B. translate([X,Y | Rest],[X]) :- translate(Y). C. translate([X],Y) :- translate(Y). D. translate(X,X). D a) A only b) B only c) B and C d) B and D 11. Unification: Respond as Prolog would: ?- record(city(X),contaminants( [benzene(A),toluene(B)|Rest])) = record(city(oswego),contaminants( [benzene(1),toluene(1000),styrene(100)])). a) X = oswego A = 1 B = 1000 Rest = 100 b) X = oswego A = 1 B = 1000 Rest = styrene(100) c) X = oswego A = 1 B = 1000 Rest = [styrene(100)] C d) X = city(oswego) A = benzene(1) B = toluene(1000) Rest = styrene(100) 12. The X-Bar hypothesis a) has been shown to be the mechanism the brain uses to decode sentences. b) is provably better than any programmable alternatives. c) places specifiers to the right of nouns in all languages. D d) organizes linguistic elements as binary trees. CSC 350 Exam 2 Page 3 of 5 Name___ KEY ____ points _____ 13. If A and B are true statements and X and Y are false statements, which one of the following compound statements is true? A a. ~(B * Y) b. A * (X + (B * Y)) c. ~A * (X + ~B) d. ~X * (X + ~B) 14. Representational ambiguity a) is automatically solved by using predicate logic as the representation. b) can be resolved by using canonical forms for knowledge representation. c) is caused by vagueness in natural language. B d) is caused by using an ambiguous grammar for the language. 15. A semantic attachment specifies a) how to compute the meaning representation of an entity from the meanings of its constituents. b) whether to use denotational, axiomatic, or operational semantics. c) how a unification grammar attaches features to on element of the parse tree. A d) the set of tags attached to a corpus. 16. A sentential form is any string of a) productions. b) terminals. c) terminals and nonterminals. D d) terminals and nonterminals derivable from the start symbol. 17. Template-based approaches to sentence recognition a) require visual methods to match patterns in the templates. b) compare input sentences to stored units. c) analyze input sentences statistically to match patterns. B d) have had no success in the translation process. 18. Garden path sentences arise because a) a sentence has more than one meaning. b) the meaning representation of a sentence is ambiguous. c) an incorrect parse tree is initially constructed. C d) the speaker intends to mislead. 19. Semantics a) can be captured as the sum of all component parts of a sentence b) can be captured in a grammar c) depends on constituent elements and their positions within a sentence C d) is the mapping between surface and lexical level elements of a sentence 20. When performing translation using templates, simplification rules help to a) remove inconsistencies from the meanings of statements. b) make the source language smaller. c) make the source language larger. d) map source language statements with the same semantics D to the same target language statement. CSC 350 Exam 2 Page 4 of 5 Name___ KEY ____ points _____ 21. That a meaning representation scheme should possess verifiability means a) a sentence should have only one representation. b) there should be only one way to model the world at any one time. c) predicate logic can be used to prove that the representation models the world correctly. d) there must be a defined relationship between the representation and D the real world. 22. Semantic ambiguity a) is an unavoidable consequence of natural language. b) is caused by representational ambiguity. c) can be resolved by using canonical forms for knowledge representation. A d) can be resolved by using an unambiguous grammar for the language. 23. A bottom-up parse of the sentence "a dog barks" is shown. What rule can you infer is part of the underlying grammar based on the line labeled Z? _ - a dog barks a - dog barks D - dog barks D dog - barks D N - barks <-----Z NP - barks NP barks - NP V - NP VP - S - a) NP --> D N b) N --> dog c) D --> a B d) D N --> NP 24. In part-of-speech tagging, an open class a) contains words that can be used in any class. b) consists of nouns and verbs only. c) allows new words to be added to the class. C d) allows words of other classes in place of words in the class. 25. A unification-based grammar a) is another name for context-free grammar. b) uses unification to encode and exchange values during parsing. c) is the only way to pass attributes up and down the parse tree. B d) can not capture the notion of noun/verb number agreement. 26. What can be said about the "Chomsky Hierarchy" of 4 types of languages? a) The languages don't intersect. b) There exist theoretical machines with finite state and finite memory to recognize all these types of languages. c) There exist theoretical machines with finite state to recognize all these types of languages, but some require unlimited memory. C d) Some of the languages can't be recognized by any known type of machine. CSC 350 Exam 2 Page 5 of 5 Name___ KEY ____ points _____ Assume a knowledge base like the following. (The entire export/3 fact base is not necessarily shown - this is just a sample.) % export(Country,Product,Specific_Type). export('Great Britain',cheese,'Penbryn'). export('Greece',cheese,'Kaseri'). export('Denmark',cheese,'Saga'). export('United States',oil,corn). export('Greece',oil,olive). export('Spain',oil,soybean). export('Canada',oil,canola). 27. Write a Prolog grammar rule to recognize the following sentence, Who exports Specific_Type ? where Specific_Type is any word at all. For example, Who exports Penbryn ? sentence --> ['Who'], [exports], [Product], ['?']. 28. Add a Prolog action to the rule you created in the previous problem to respond appropriately. Be sure to handle the case where Specific_Type isn't in your database. Assume at most 1 country exports the specific type of product. your-lhs --> your-rhs, { ACTION }. Answer: sentence --> ['Who'], [exports], [Type], ['?'], { export(Who,_,Type), write_ln(Who); write_ln('I don''t know.') }.