CSC 350 Exam 2 Page 1 of 4 Name _____ KEY __ 72 points __ Multiple Choice/Short Answer. 3 points each. 1. In part-of-speech tagging, an open class a) allows new words to be added to the class. b) allows words in other classes to be used in place of words in the class. c) consists of nouns and verbs only. A d) consists of adverbs and adjectives only. 2. A corpus a) always contains mappings to the morphemes of its words. b) is another name for an ontology. c) is a collection of words from several languages. D d) is a collection of words from one language. 3. A unification-based grammar a) tries to model a grammar to recognize all languages. b) uses unification to encode and exchange values during parsing. c) must be implemented in Prolog. B d) can not capture the notion of noun/verb number agreement. 4. A web-based template system gets its parameters a) positionally from the web form, so that the first INPUT element of the form will be parameter #1, for example. b) by the name assigned to the INPUT element in the web form. c) by the URL the user types in or clicks on to reach the form. d) from regular expression parsing of the information sent back B from the browser on form submittal. 5. 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 infinite memory. C d) Some of the languages can't be recognized by any known type of machine. 6. Top-down parsing a) is used by Prolog when you write a definite clause grammar. b) is the method of choice for machine created parsers. c) always constructs a real parse tree as a data structure so it can be rearranged by the compiler to generate optimal code. d) uses a shift/reduce procedure to generate a tree by starting A at the leaves. 7. 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) organizes linguistic elements as binary trees. C d) can only be used on verb phrases, not noun phrases. 8. Semantic ambiguity a) can be resolved by using canonical forms for knowledge representation. b) can be resolved by using an unambiguous grammar for the language. c) is caused by representational ambiguity. D d) is inherent in natural language. CSC 350 Exam 2 Page 2 of 4 Name _____ KEY __ 72 points __ 9. 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. 10. Lexical semantics a) ascribes much of the meaning of a sentence to individual words. b) relies entirely on a grammar to ascribe meaning to a sentence. c) specifies how to create a parse tree. A d) can only be done using Wordnet. 11. Rode is a hyponym of A a) traveled b) bicycled c) road d) walked 12. Given: all_but_last(X,Y) :- reverse(X,[_|Zs]), reverse(Zs,Y). How would Prolog respond to: ?- all_but_last( [[code_name, 'James Bond'], [id, '007'], [covert_cover, 'Pierce Brosnan']], X). a) X = [[code_name, 'James Bond'], [id, '007'], [covert_cover]] b) X = [[code_name, 'James Bond'], [id, '007']] c) X = [[code_name], [id], [covert_cover]] B d) X = [[code_name, 'James Bond']] Assume the following axioms and theorems. good_thing(salmon). bad_thing(rain). has(oswego,salmon). has(oswego,rain). has(alamosa,salmon). tourist_attraction(X) :- good_thing(Y), has(X,Y), write(X), write(' is a tourist attraction because it has '), write(Y), nl. tourist_attraction(X) :- bad_thing(Y), not(has(X,Y)), write(X), write(' is a tourist attraction because it does not have '), write(Y), nl. 13. How would Prolog respond to: ?- tourist_attraction(oswego), fail. a) oswego is a tourist attraction because it has salmon b) oswego is a tourist attraction because it does not have rain c) oswego is a tourist attraction because it has salmon oswego is a tourist attraction because it does not have rain d) Yes A e) No 14. And how would Prolog respond to: ?- tourist_attraction(alamosa), fail. a) alamosa is a tourist attraction because it has salmon b) alamosa is a tourist attraction because it does not have rain c) alamosa is a tourist attraction because it has salmon alamosa is a tourist attraction because it does not have rain d) Yes C e) No CSC 350 Exam 2 Page 3 of 4 Name _____ KEY __ 72 points __ 15. Consider this Prolog code which defines the predicate 'phanatic/1'. (The letters on the left are for reference only.) A. phanatic([X,Y,Z | Rest]) :- phish(Z), likes(X,Y), likes(Y,Z). B. phanatic([X,Y | Rest]) :- phish(Y), likes(X,Y). C. phanatic([X,Y]) :- phish(Y), likes(X,Y). Which of the rules will be tested (i.e., its body will be executed) given the query: ?- phanatic([a,b]). a) rule 1 only. b) rule 1 and 2. c) rule 2 only. d) rule 2 and 3. D e) rule 1, 2 and 3. 16. What would be a reasonable translation into Prolog of -- "If something produces income, then it should be actively supported." a) produces(X,income) :- support(income). b) produces(X,income) :- support(X). c) support(income) :- produces(X,income). D d) support(X) :- produces(X,income). Consider the following Prolog definite clause grammar, G. start --> [0]. start --> [1]. start --> [0], start. start --> [1], start. 17. When G is viewed as a context free grammar, what is the set of terminals? Terminals = { _ 0, 1 ______________________} 18. What is the set of nonterminals? Nonterminals = { __ start ____________________} 19. Write down the 6 shortest elements of L(G), the language generated by G. 0, 1, 00, 01, 10, 11 20. Is L context-sensitive language? a) No, because G is a context-free grammar. b) No, because G is not a context-free grammar. c) Yes, because context-free languages are a subset of context-sensitive languages. d) Yes, because context-free languages are a C superset of context-sensitive languages. 21. When given the query: ?- phrase(start, X, []). will prolog ever generate all of these 6 shortest elements? (Explain.) CSC 350 Exam 2 Page 4 of 4 Name _____ KEY __ 72 points __ 22. Derive "1 0 0 1" from the start symbol. Use left-most derivation and label the arrows in your derivation with the number of the production used for each substitution. start => 1 start 4 => 1 0 start 3 => 1 0 0 start 3 => 1 0 0 1 2 23. Consider the Prolog definite clause grammar, G, shown. sent --> ['It''s'], adverb(Adv), [out], [here], [for], determiner(_Det, Number), noun(Noun, Number), { write('Hey '), write(Noun), write(' I toldya it was '), write(Adv), nl }. adverb(Adv) --> [Adv], { Adv = hard; Adv = easy ; Adv = okay}. determiner(Det, Number) --> [Det], { Det = the, Number = singular ; Det = the, Number = plural ; Det = a, Number = singular ; Det = some, Number = plural }. noun(Noun, Number) --> [Noun], { singularPlural(Noun,_), Number = singular; singularPlural(_,Noun), Number = plural }. singularPlural('geek','geeks'). singularPlural('nerd','nerds'). Which are legal sentences in the language of G? a) It's hard out here for a geek. b) It's hard out here for the geek. c) It's hard out here for the geeks. d) Both a) and b). e) Both a) and c). f) Both b) and c). G g) All of a), b) and c). 24. The 'singularPlural' predicate a) serves as a lexicon of legal nouns. b) provides the number attribute for nouns. c) is a nonterminal in the grammar. d) Both a) and b). e) Both a) and c). f) Both b) and c). D g) All of a), b) and c).