DISCRETE COMPUTATIONAL
STRUCTURES
FALL 1995 |

COT4210: Course Information
Text: Hein, Discrete Structures, Logic and Computability,
Jones and Bartlett, 1995.
Toting this book around will build strong bones and muscles.
Prerequisites: COT3100 (Discrete Structures), MAC3312
(Calc II)
Assignments: About one every week (due on Thursday of
next week). Generally short. You may work in teams of two, unless I say
otherwise. Teams turn in only one copy of assignment.
Topics: (Mostly taken from Hein 3.2; 11 - 14; 7 - 9)
Introduction to formal languages, automata theory and computability
theory.
Emphasis in formal languages is on regular and context free languages.
Regular languages and finite state automata will be related
to sequential circuits, lexical analysis, data validation, and state transitions
used to solve problems involving complex interactions.
Emphasis in automata theory is on finite state and push down automata.
Context free languages and push down automata will be related
to parsing of programming languages. In particular, we will study LL and
LR parsing.
Emphasis in computability theory is on models of computation (Turing machines,
register machines, recursive functions) and the limits of mechanical computation
(intractable and unsolvable problems.)
Computation models will be related to necessary features for
a model of computation (e.g., a programming language) to be complete. Limits
of mechanical computation will be tied to problems that arise naturally
and sometimes ubiquitously.
Evaluation:
Two Quizzes - 50 points each; Two Exams - 100 points each;
Final Exam on December 5 @ 10:00 - 150 points.
Assignments - 100 points
Available Points - 550
A - >=90% B - 80%-89% C - 70%-79% D - 60%-69% F - <60%
Day#1 - August 24:
-
Goals of course; Prerequisites; Rules of game.
-
Some challenges to get your synapse firing.
-
Overview of language construction. (Chapter 3, Section 2)
Language generation and recognition problems. Some notion of complexities.
-
Formal concept of a grammar with simple examples.
Assignment #1 (due September
5): Problems at end of Section 3.2: 1, 2c, 3c, 10, 13, 15.
Day#2 - August 29:
-
Grammars and Derivations: More examples of grammars with precise definition
of the language associated with a grammar.
-
Meaning and Ambiguity: Distinction between grammar and language or more
importantly a family of grammars and the languages its member generate.
-
Sets formed using closure under union, concatenation and star.
Day#3 - August 31:
-
Regular expressions and regular sets. (Chapter 11.1). Importance in lexical
analysis.
-
Examples of regular expressions and operations on them.
-
Regular equations -- solving recurrence equations.
-
A brief intro to Finite state automata. (Chapter 11.2)
Assignment #2 (due September
12): Problems at end of Section 11.1: 1f, 2h,i, 3, 9a, 10.
Prove that (R+S)* is contained in (R*S*)*, where R and S are regular
sets.
Day#4 - September 5:
-
Recognizers in general; Finite state automata in particular. (Chapter 11.2).
-
Deterministic FSAs -- 5 tuple definition.
-
Odd parity recognizer
-
Proper binary sum recognizer
-
All binary strings that are 1 mod 5
-
Non-deterministic FSAs (note lambda transitions allowed.)
-
All binary strings that are either 1 or 3 mod 5
-
Equivalence of regular sets and finite state languages -- constructive
techniques
-
Transforming regular expressions to finite state automata.
-
Transforming finite state automata to regular expressions.
Day#5 - September 7:
-
Deterministic versus non-deterministic automata. Next state function for
DFA; next state relation for NFA.
-
Formal proof that every regular set is accepted by a FSA.
-
Basis: Show FSAs for empty set, {empty string}, {a} where a is in alphabet.
-
Induction: Show if R and S are recognized by fsa then so are
-
R union S
-
Machine uses paired states. Accepts if either component is acceptable.
-
Prove inductively, based on length of string that this works.
-
R concatenate S
-
Machine is easiest to do using non-determinism. Accepts if any path finds
the string acceptable.
-
Prove inductively, based on length of string that this works.
-
R*
-
Show how easy this one is if we use non-determinism.
-
This motivates showing non-determinism does not increase power.
Assignment #3 (due September 19):
Problems at end of Section 11.2: 5, 6c, 9, 10.
Day#6 - September 12:
-
Present a detailed formal proof of closure of Determinstic Finite State
State Languages under union.
-
Show how easy it is to extend techniques just developed to prove closure
of finite state languages under intersection and many other binary operations.
-
Complete closue constructions and proofs based on NFAs.
-
Introduce formal proof that every FSL is regular via an example of the
Rijk construction.
Assignment #4 (due September
26): Problems at end of Section 11.3: 3, 11.
IMPORTANT DATES:
-
Quiz#1 (Thursday, September 28)
-
Exam#1 (Thursday, October 12)
-
Withdraw Deadline (Friday, October 20)
-
Quiz#2 (Thursday, November 9)
-
Exam#2 (Tuesday, November 21)
-
Final Exam (Tuesday, December 5, 10:00-12:50)
Day#7 - September 14:
-
Formal proof that every finite state language is regular. We'll assume
automata with no lambda transitions.
-
Define Rijk = { w | automaton, starting in state i with input w, ends up
in state j, after having consumed all of w, never visiting any nodes with
index higher than k }.
-
Clearly the language recognized is R1nn, where automaton has n states.
-
Show all Rijk, k<=n are regular.
-
Basis: Rii0 contains empty string, for all i.
Rij0 contains b, whenever f(i,b) contains j, where f is the transition
function.
-
Induction: Rij(k+1) = Rijk union Ri(k+1)k (R(k+1)(k+1)k)* R(k+1)jk
-
Note that regular equation result provides an alterative proof that every
finite state language is regular. Again, we must assume automata with no
lambda transitions.
-
Finite automata as output devices: Mealy and Moore Models.
-
Binary sum using Mealy model
-
Binary sum using Moore model
Day#8 - September 19:
-
Getting rid of lambda transitions in an NFA.
-
Compute lambda-closure for each state.
-
Extend to lambda-closure of a set of state
-
Allow multiple start states (lambda-closure of old start state).
-
Replace transition from p to q on b, by transitions from p to the lambda-
closure of q on b.
-
Show proof that lambda-free NFA can be converted to DFA using subsets of
the set of original states.
-
Constructing the minimum state DFA for a given finite state language. First
show constructive technique from text. This is based on notion of indistinguishable
states.
Assignment #5 (due October
3): Problems at end of Section 11.4: 1f, 2h, 3c, 5, 6, 8b (by Lemma 11.13
and 11.14).
Show L = { w w | w is a string over {0,1} } is not recognized by an
FSA by showing that its associated right invariant equivalence relation
has infinite index.
Day#9 - September 21:
-
Show matrix technique and discuss its complexity.
-
Notion of a right invariant equivalence relation and its index.
-
Myhill-Nerode Theorem (proof will be later): The following are equivalent.
-
L is accepted by some FSA.
-
L is the union of some of the classes of a right invariant equivalence
relation of finite index.
-
The right invariant equivalence relation defined by
xRy iff (for all z) xz is in L just in case yz is in L
has finite index.
-
The index of the relation from part 3 above is the number of states in
a minimum FSA. The minimum FSA is unique up to renaming of states.
-
If the index of relation 3 is not finite, then L is not regular.
Day#10 - September 26:
Review of all material to date in preparation for Quiz#1.
This quiz is based on material from Chapter 3.2 and Chapter 11.1-3.
Major Topics:
-
Grammars and Derivations: Context free and regular. Notions of derivation,
leftmost derivation, rightmost derivation, ambiguity.
-
Regular sets: Sets formed using closure under union, concatenation and
star, with empty set, set with empty string, and singleton sets as bases.
Regular expressions: Definition and associated regular sets.
-
Finite state automata. DFAs and NFAs. Closure of DFA languages under union,
intersection and complementation. Closure of NFA under union, concatenation
and *. Associating FSAs with REs. Associating a regular expression with
an FSA. Proof using Rijk sets from notes. Setting up and solving sets of
simultaneous regular equations. Proof of uniqueness of solution to R=Q+RP
(where P does not contain the empty string.)
-
Moore and Mealy models: Automata with output. Equivalence.
-
Epsilon moves: Epsilon closure of a state. Equivalence to non-det.
-
Conversion to deterministic FSAs. Formal proof of equivalence.
-
Minimization: Process of minimization. Indistinguishable states. Triangular
matrix approach. Analysis of cost of different approaches. Constructing
the minimum state DFA for a given finite state language.
-
Myhill-Nerode Theorem as basis for unique minimum state DFA: Right invariant
equivalence relations. Specific relation for a language L. Applications
for now -- proof is later.
Sample Questions (or forms of questions) for
Quiz:
-
Present two, distinct leftmost derivations of some string produced by the
grammar:
S -> XC | AY; X -> aXb | ab; Y -> bYc | bc; A -> aA | a; C -> cC |
c
-
Prove, for R, S and T regular expressions, that R + S = R + T does not
always imply that S = T.
-
Present an FSA that recognizes the regular language associated with (a+bb)*
(b+aa)*
-
Construct a regular expression from some fsa using regular equations. Show
all steps. Regular equations might be of form
A = B0 + A(0+1). B = A0. C = B1 + C0, where C is associated with final
state.
-
Construct a regular expression from some fsa using Rijk theorem. Show all
steps.
-
Construct a regular expression from some fsa using text technique. Show
all steps.
-
Prove the correctness and uniqueness of the solution R=QP*, when R = Q+RP,
and P does not contain the string of length zero.
-
Produce some FSAs and Mealy machines for specific languages, or translations.
-
Show lambda closures for the states of some NFA. Convert the NFA to an
equivalent DFA.
-
Minimize the states of some DFA. Show various techniques.
-
Show RI equivalence classes for some language. Use this to determine whether
or not language is regular.
-
Convert between regular grammars are FSAs.
-
Use Myhill-Nerode to show a language is not regular.
Day#11 - September 28:
-
QUIZ#1
Day#12 - October 3:
-
Pumping Lemma (weak and strong forms).
-
Formal proof of Pumping Lemma (strong form).
Let L be regular. There exists an N, dependent on L alone,
such that, if w is in L and |w| >= N, then w may be written in the form
xyz, where |xy| <=N, |y| >0, and for all k gt;= 0, xy^kx is in L.
-
Application of Pumping Lemma, including weak form.
-
Empahsize that the proper application of the Pumping Lemma is an adversarial
process
-
YOU choose L.
-
PL chooses N.
-
YOU choose a w in L.
-
PL chooses an xyz, such that w=xyz, where |xy| <= N, |y| > 0.
-
YOU choose a k such that xy^kx is not in L.
-
That's it. You've shown that L is not regular.
-
Challenge questions
-
Why is { x x(rev) w | x is not lambda and w is arbitrary} so hard to prove
non-regular using the Pumping Lemma, yet so easy using Myhill-Nerode?
-
Show { x w x(rev) | x is not lambda and w is arbitrary} is regular.
Day#13 - October 5:
-
Review of results from Quiz#1 in preparation for Exam#1.
-
Discussion of every problem encountered in first quiz with emphasis on
weaknesses that will be tested on exam.
Day#14 - October 10:
-
Regular Grammars
-
Examples
-
Equivalence of forms A -> wB; A -> w with A -> aB; A ->a; A -> lambda,
and even with A -> aB; A -> lambda.
-
Every FSL is generated by a regular (right linear) grammar.
-
Every regular language can be recognized by a NFA.
-
The left and right linear grammars are equivalent.
-
Three proofs of closure of regular sets under reversal.
-
Major Topics for Exam:
-
This exam is based on material from Chapter 3.2 and all of Chapter 11.
-
All topics from Quiz#1.
-
Pumping Lemma: Weak and strong forms. Proofs and applications.
-
Regular grammars: Equivalence with FSAs. Proofs and applications
-
Sample Questions (or forms of questions) for Exam:
-
Those seen in Quiz#1.
-
Prove the correctness and uniqueness of the solution R=QP*, when R = Q+RP,
and P does not contain the string of length zero.
-
Convert between regular grammars and FSAs.
-
State, prove and apply strong Pumping Lemma.
Day#15 - October 12:
-
EXAM#1
Day#16 - October 17:
-
Proof of Myhill-Nerode Theorem.
-
Significance of Myhill-Nerode for uniqueness of minimum state fsa and for
showing certain languages are not regular. Use to solve equivalence problem.
Day#17 - October 19:
-
Closure of regular languages under substitution, homomorphism and inverse
homomorphism.
-
Closures that follow from substitution, homomorphism and inverse homomorphism
(e.g., union, concatenation, Kleene *, quotient with regular languages,
INIT, LAST, MID).
Day#18 - October 24:
-
Closure of regular sets under quotient with regular sets.
-
Algorithms for reachable states and states that can reach a point.
-
Decision properties: Emptiness and finiteness.
-
Use of reachability algorithms to solve emptiness and finiteness.
-
Use of Pumping Lemma for emptiness and finiteness properties.
Assignment #6 (due November 2):
-
Use the Pumping Lemma to prove that
{ a^f | f is a member of the Fibonacci sequence} is not regular.
-
Reprove this using the Myhill-Nerode Theorem.
-
Prove that any class of languages containing the finite languages and closed
under concatenation, union, *, intersection with regular languages, substitution
and homomorphism, is also closed under EXTERIOR, where
EXTERIOR(L) = { xz | xyz is in L, for some y }.
Day#19 - October 26:
-
Context Free Grammars -- Formal Definition, Basic Concepts and Examples.
-
Parse trees, A-trees. Definition of a parse tree and proof that A =>* X
iff there exists an A-tree with X as its yield.
-
Ambiguity and leftmost (rightmost) derivations.
-
Closures under union, concatenation and Kleene *.
-
Pushdown Automata -- Formal Definition, Basic Concepts and Examples.
Assignment #7 (due November 7):
-
Problems at end of Section 12.1: 1f, 2d.
-
Problems at end of Section 12.2: 1e, 2, 4b, 7b, 8.
Day#20 - October 31:
-
Deterministic versus non-deterministic PDAs.
-
Various notions of acceptance (final state, empty stack, final state and
empty stack) and their equivalences.
-
Equivalence of different forms of acceptance.
-
Development of notions of top-down and bottom-up parsing from simulation
of CFG by PDA.
Day#21 - November 2:
-
Notion of an instantaneous description (ID)
-
Equivalence of Context Free and Push Down languages.
-
More discussion of shift-reduce bottom-up parsing and predictive top-down.
Examples of how ambiguity can cause trouble, and how poorly chosen unambiguous
grammars can also be annoying.
-
Ambiguous grammars versus inherently ambiguous languages -- the quest for
a decidable subset of the unambiguous Context Free grammars.
Day#22 - November 7:
-
Complete equivalence of PDA to CFG.
-
Reasons to avoid left recursion of top-down and right recursion on bottom
up.
-
Left and right recursive rules and how to convert from one to the other.
-
Recursive descent parsing and its aversion to left recursion.
-
Go over assignments as preparation for quiz.
Day#23 - November 9:
-
Quiz#2 on Chapter 11.4; 12.1, 12.2; some preliminaries on grammar-driven
parsing.
-
Guarantees
-
Proofs that some language is not regular -- Pumping and Myhill-Nerode.
-
Proof of one part of Myhill-Nerode.
-
A closure similar to quotient, prefix, etc.
-
Some question concerning decision procedures for regular languages (empty,
finite, membership, etc.)
-
Write a CFG for some prescribed language.
-
Construct a PDA from a CFG and/or vice versa.
-
Removal of either left or right recursion.
Day#24 - November 14:
-
Brief overview of parsing of Deterministic CFLs via LL and LR strategies.
-
Recursive Descent Parsing -- building parser from grammar. Left recursion
problem.
-
Reduced grammars (no lambda rules, no unit rules, no useless symbols)
Day#25 - November 16:
-
More on grammar reductions.
-
Chomsky Normal Form -- conversion algorithm.
-
The Pumping Lemma for CFLs (based on CNF).
-
Strong form versus weak form Pumping Lenna for CFLs.
-
Applying the Pumping Lemma -- a^n b^n c^n.
-
Cocke-Kasami-Younger (CKY): CNF and an order(N^3) parser for arbitrary
CFLs.
Day#26 - November 21:
-
More on Cocke-Kasami-Younger.
-
More applications of Pumping Lemma for CFLs.
-
Greibach Normal Formal -- relation to linear parsing algorithms.
-
Closure of CFLs under intersection with regular (can create machine with
paired states), substitution (easy using grammar), reversal (easy using
grammar).
-
Consequences of above for quotient with regular, Prefix, Suffix, Interior,
Exterior, etc.
-
Non-closure of CFLs under intersection, quotient and complement.
-
Decision problems for CFL's -- emptiness, finiteness, membership.
Assignment #9 (due November 30):
-
Use CKY to show that a+(a)-a is in L, where L is defined by:
E -> a | EY | LZ | PE ; Z -> ER ; Y -> PT; T -> a | LZ ; P -> + | -
; L -> ( ; R -> )
-
Use the Pumping Lemma for CFLs to show L is not context free:
L = { a^i b^j c^k | i,j > 0 and k = i * j }
-
Convert the following to CNF. Show all steps.
S -> A | B ; A -> 1CD | lambda ; B -> 1CE ; C -> 1C1 | 01 ; D -> 0A
; E -> 0B
Assignment #10 (OPTIONAL due December 5):
-
Prove that the grammar { S -> aS | aSbS | lambda } produces
L = { w | w is in {a,b}+, w = xy implies #a's in x >= #b's in x }
-
Prove that the Post Correspondence Problem is solvable when the base alphabet
is a single letter.
Day#27 - November 28:
-
Basic concepts underlying computability theory
-
Solved versus solvable problems.
-
Unsolved versus unsolvable problems.
-
Enumerable (semi-solvable) versus non-enumerable problems.
-
Existence of unsolvable problems based on a simple counting argument.
-
Proof of unsolvability of halting problem using "diagonalization".
-
Turing machine model of computation -- basic definition and simple examples.
-
Register machine model of computation -- basic definition and simple examples.
-
Overview of equivalence of models.
-
Church-Turing Thesis.
Day#28 - November 30:
-
Proofs of undecidability using reduction from a known unsolvable problem.
-
Examples of undecidability related to debugging software.
-
The Post Correspondence Problem.
-
Use of PCP to show undecidability of ambiguity and emptiness of intersection
problems
-
Discussion of guarantees for final exam:
-
Easy:
-
Given a context free language, present a pda or grammar.
-
Minimize an fsa, showing all work.
-
Specify some of the basic computability definitions and relations.
-
Identify the complexities of various decision problems concerning regular
and context-free languages.
-
Median:
-
Show a language is not regular (context free) using pumping lemma.
-
Show closure or non-closure of languages (regular or CFL) under some operation.
-
Convert grammar to PDA. Convert PDA to grammar.
-
Reduce grammar to CNF.
-
Create CKY recognizer from some CNF grammar.
-
Reduce PCP to ambiguity or intersection of CFGs
-
Harder:
-
Show one part of Myhill-Nerode.
-
Prove a specific language is generated by some prescribed grammar.
Day#29 - December 5 (10:00 AM):
Final Exam -- A Two Part Exam:
-
Required cummulative part. This emphasizes latter half of course, with
definite questions from last 3 weeks of classes.
-
Optional part on same material as Quiz#2. This can be used to improve grade
on second quiz.
Topics for First Half of Semester
-
Regular Sets
-
Regular expressions: Definition and associated languages.
-
Finite state automata. Associating FSAs with REs.
-
Associating REs with FSAs. Proof using Rijk sets.
-
Moore and Mealy models: Automata with output. Basic equivalence.
-
Non-determinism: Its use. Conversion to deterministic FSAs. Formal proof
of equivalence.
-
Lambda moves: Lambda closure of a state. Equivalence to non-det.
-
Myhill-Nerode Theorem: Right invariant equivalence relations. Specific
relation for a language L. Proof and applications.
-
Minimization: Why it's unique. Process of minimization. Analysis of cost
of different approaches.
-
Regular (right linear) grammars, regular languages and their equivalence
to FSA languages.
-
Pumping Lemmas: Proof and applications.
-
Closure properties: Union, concat, *, complement, reversal, intersection,
set difference, substitution, homomorphism and inverse homomorphism, INIT,
LAST, MID, EXTERIOR, quotient (with reg. set, with arb. set).
-
Algorithms for reachable states and states that can reach a point.
-
Decision properties: Emptiness, finiteness, equivalence.
Topics for Second Half of Semester
-
Context Free Grammars.
-
Leftmost versus rightmost derivations.
-
Parse trees, A-trees. Definition of a parse tree and proof that A =>* X
iff there exists an A-tree with X as its yield.
-
Ambiguity and leftmost (rightmost) derivations.
-
Pushdown automata; various notions of acceptance and their equivalences
-
Push down languages and their equivalence to CFLs.
-
Parsing Techniques: LL (top down) and LR (botom up) parsers
-
Reduced grammars
-
Keep non-terminal A iff A =>* w for some terminal string w.
-
Keep symbol X iff S =>* WXY for some strings W and Y.
-
A -> lambda removal.
-
Chain (unit) rule removal.
-
Chomsky Normal Form.
-
Left recursion removal.
-
Greibach Normal Form.
-
Pumping Lemmas for CFLs.
-
Closure of CFLs: Union, concat, *, reversal, substitution, homomorphism
and inverse homomorphism, INIT, LAST, MID, EXTERIOR, quotient with reg.
-
Decision algorithms: Empty, finite, infinite; CKY for membership.
-
Basic concepts underlying computability theory
-
Solved versus solvable problems.
-
Unsolved versus unsolvable problems.
-
Enumerable (semi-solvable) versus non-enumerable problems.
-
Existence of unsolvable problems based on a simple counting argument.
-
Proof of unsolvability of halting problem using "diagonalization".
-
Models of Computation - Basic Definitions and Simple Examples
-
Turing machines
-
Register machines
-
Recursive functions
-
Overview of equivalence of models.
-
Church-Turing Thesis.
-
Proofs of undecidability using reduction from a known unsolvable problem.
-
Examples of undecidability related to debugging software.
-
The Post Correspondence Problem.
-
Use of PCP to show undecidability of ambiguity and emptiness of intersection
problems
Charles E. Hughes, ceh@cs.ucf.edu -- Last Updated February 21, 1996