Quotient of CFL and Regular Language
March 12 2014
Theorem 1. If L is a CFL, and R is regular, then L/R is a CFL.
Proof. There are a number of ways to approach this. For example, you can construct a PDA-based
proof along the lines of the proof of Theorem
University of Waterloo
CS 462 Formal Languages and Parsing
Winter 2014
Problem Set 4
Distributed Tuesday, February 4 2014. Due Tuesday, February 11 2014, in class.
All answers should be accompanied by proofs.
1. [10 marks]
(a) [5 marks] Draw a nite-state
Notes for CS 462, January 17 2013
Today we proved Theorem 2.5.1 using a proof dierent from that in the text. Here it is:
We dene 0 = 1 and 1 = 0.
Lemma 1. Let be the morphism dened by (0) = 01 and (1) = 10. Then (tn ) =
t2n t2n+1 .
Proof. By induction on
University of Waterloo
CS 462 Formal Languages and Parsing
Winter 2014
Problem Set 7
Distributed Tuesday, March 4 2014. Due Tuesday, March 11 2014, in class.
All answers should be accompanied by proofs.
1. [10 marks] Using any method, nd a minimal DFA equ
Revised proof of Theorem 3.10.2
February 27 2014
Theorem 1 (3.10.2). Algorithm NAIVE-MINIMIZE terminates and correctly returns an array
1,
0,
U (cfw_p, q) =
if p q;
if p q.
Furthermore, the pair cfw_p, q is marked at the nth iteration of the while loop if
Revised proof of Theorem 4.2.1
March 11 2014
Theorem 1 (4.2.1). A unary language is context-free if and only if it is regular.
Proof. One direction is easy.
For the other direction, suppose L 0 is context-free, and let n be the constant in the pumping
lem
University of Waterloo
CS 462 Formal Languages and Parsing
Winter 2014
Problem Set 5
Distributed Tuesday, February 11 2014. Due Tuesday, February 25 2014, in class.
All answers should be accompanied by proofs.
1. [10 marks]
Give an ecient algorithm that,
University of Waterloo
CS 462 Formal Languages and Parsing
Winter 2014
Problem Set 3
Distributed Tuesday, January 28 2014.
Due Tuesday, February 4 2014, in class.
All answers should be accompanied by proofs.
1. [10 marks] Which of the following are true f
CS 462 Problem-Solving Session
Week 1: Version C
January 8, 2014
Recall that a word x is a palindrome if x = xR , where xR denotes the reversal of x.
For a word x cfw_0, 1 , let x denote the word obtained by changing each 0 to 1 and
vice versa. Call a wor
CS 462 Problem-Solving Session
Week 1: Version B
January 8, 2014
Recall that a word x is a palindrome if x = xR , where xR denotes the reversal of x.
For a word x cfw_0, 1 , let x denote the word obtained by changing each 0 to 1 and
vice versa. Call a wor
University of Waterloo
CS 462 Formal Languages and Parsing
Winter 2014
Problem Set 1
Distributed Tuesday, January 14 2014.
Due Tuesday, January 21 2014, in class.
All answers should be accompanied by proofs. In all problems the underlying alphabet
is ass
University of Waterloo
CS 462 Formal Languages and Parsing
Winter 2014
Problem Set 9
Distributed Tuesday, March 18 2014. Due Tuesday, March 25 2014, in class.
All answers should be accompanied by proofs.
1. [10 marks] Let = cfw_0, 1, 2, . . . , k for some