TWiki
>
CS301 Web
>
Syllabus
>
Homeworks
>
ProblemSet6
(2012-02-24, Main.sloan)
(raw view)
E
dit
A
ttach
---++ Problem Set 6, CS 301, Spring 2012 1 Below is a modest extension of the context-free grammar for English from Sipser, p. 101, using the variable S for Sentence, NP for Noun Phrase, VP for Verb Phrase, PP for Prepoositional Phrase, N for Noun, and V for Verb. For each of the following two sentences, please give _two different_ parse trees, and circle the one that is almost certainly the intended meaning of the sentence. 1 The boy shot Fido with the gun. 1 Fido likes the girl with the chocolate. 1 For the simple ambiguous grammar S --> (S) | S + S | S * S | id over the terminals (, ), *, +, id that we discussed in lecture, show at least three different parse trees for the string id+id*id*id 1 Construct PDAs for the following languages in JFLAP. Be aware that JFLAP uses the convention that the PDA's initial state has the special bottom-of-stack symbol Z on the stack at the start of time. You can take advantage of that if you want. 1 The language of balanced delimiters over the six characters (,),[,],{,} 1 The set of all strings of the form <latex> a^* b^* </latex> that have exactly 3 b's for each a. 1 The set of all strings of the form <latex> a^* b^* </latex> where the number of b's is 1 more than 1.5 times the number of a's. (Notice that this means the number of a's<em> must be even.</em>) 1 The set of all palindromes over a,b. 1 <latex> \{0^i 1^j 0^i : i,j \geq 0 \mbox{ and } j \mbox{ is even} \} </latex> 1 Argue that if L1 is context free and L2 is context free, then so is L1 L2. (concatenation). Grammar for subset of English: S -> NP VP NP -> <CMPLX-NOUN> | <CMPLX-NOUN> PP VP -> <CMPLX-VERB> | <CMPLX-VERB> PP PP -> <PREP> <CMPLX-NOUN> <CMPLX-NOUN> -> <ARTICLE> N | <PROPER-NOUN> <CMPLX-VERB> -> V | V NP <ARTICLE> -> a | the N -> boy | girl | flower | cat | dog | bear | chocolate | sushi | gun | camera <PROPER-NOUN> -> Fido | Tom | Dick | Harry V -> touches | likes | sees | smells | shot <PREP> -> with -- Main.sloan - 2012-02-18
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2012-02-24 - 03:35:54 - Main.sloan
CS301
Syllabus
Homeworks
Reading Assignments
Discussion Board
Additional Material
[edit this menu
]
Log In
CS301 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
ABOUT US
Our Department
Recent News
Contact Us
ACADEMICS
Prospective Students
Undergraduate
CS Minor
Graduate
Courses
RESEARCH
Overview
By Faculty
Labs
PEOPLE
Faculty
Adjuncts
Staff
Students
Alumni
Copyright 2016 The Board of Trustees
of the University of Illinois.
webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF