[HD] EECS4302 F26 - 2026-10-01 (Thursday) - Lecture 7
Overview
Jackie Wang reviews NFA execution and epsilon-NFA techniques in EECS4302, showing how sets of possible states and epsilon-closures determine whether strings are accepted. The lecture then develops a recursive construction from regular expressions to epsilon-NFAs (covering empty string, empty language, symbols, union, concatenation, and Kleene star) with examples relevant to Assignment 1.
Key takeaways
- An NFA processes an input by maintaining a set of possible states; a string is accepted if the final set contains at least one accepting state.
- An epsilon-NFA can join independently constructed machines with transitions that consume no input, making regular-expression union and concatenation straightforward to model.
- An epsilon-closure must include its starting state and every state reachable through zero or more epsilon transitions; for the worked Q0 graph, the closure is {Q0, Q1, Q2, Q3, Q5}.
- To process an epsilon-NFA input symbol, first take transitions for that symbol from every state in the current set, then take and union the epsilon-closures of the destinations.
- The lecture's recursive regular-expression construction maintains exactly one start and one accepting state, using epsilon links to implement union, concatenation, and Kleene star.
- The Kleene-star construction needs an epsilon route that accepts zero repetitions as well as a route through the pattern that permits repeated matches.
Chapters
- Assignment 1 is due the following week; students who have not started should begin soon.
- Jackie Wang plans to release the project and Assignment 2 before Wednesday and discuss how to approach both in Thursday's class.
- The programming test is planned for November 5, and Assignment 2 and tutorials will help students prepare.
- The example NFA recognizes binary strings ending in 01 and processes the input 00101 from left to right.
- After each input symbol, track a set of possible states rather than a single state; for example, the first 0 can lead to both Q0 and Q1.
- A branch with no transition for the next character dies, but other branches continue processing.
- After processing 00101, the example NFA can be in Q0 or Q2; because Q2 is accepting, the string is accepted.
- The acceptance test is whether the resulting state set intersects the accepting-state set in at least one state.
- Jackie Wang uses Back to the Future's alternate timelines as an analogy for NFA nondeterminism: multiple possible paths can be explored in parallel.
- An epsilon transition changes state without consuming an input symbol, making epsilon-NFAs convenient for building larger patterns.
- For concatenated patterns X followed by Y, connect the accepting states of the X machine to the initial state of the Y machine with epsilon transitions; only Y's accepting states accept the full string.
- For a language matching either pattern, introduce an initial state with epsilon transitions to the separate X and Y machines.
- The example format allows an optional plus or minus sign, decimal digits before a dot, and decimal digits after it.
- The constraint that the digit strings on both sides cannot both be empty rejects a bare dot and a sign followed only by a dot.
- The string .23 is accepted by taking epsilon for the absent sign and absent integer part, then reading the dot and digits; +46. is also accepted.
- The epsilon-closure of a state contains the state itself, even when no epsilon transitions leave it.
- Compute the closure recursively by following every reachable epsilon transition and adding the closures of those destination states.
- The traversal ends when all reachable states have been examined and no further epsilon transitions add new states.
- In the worked graph, Q0 has immediate epsilon transitions to Q1 and Q2.
- Following Q1 reaches Q3 and then Q5; Q2 and Q5 have no further epsilon transitions.
- The resulting closure is {Q0, Q1, Q2, Q3, Q5}, with Q0 included as the starting state.
- Before reading the first character, begin with the epsilon-closure of the initial state; in the 5.6 example, that starting set is {Q0, Q1}.
- For input 5, Q0 has no digit transition, while Q1 can reach Q1 and Q4, so the direct destination set is {Q1, Q4}.
- After consuming each character, take the epsilon-closure of every destination and union the results; students are asked to complete the remaining characters of 5.6.
- The recursive construction supports epsilon, the empty language, alphabet symbols, union (+), concatenation, and Kleene star (*).
- Each constructed epsilon-NFA has exactly one start state and one accepting state, with no transition entering the start or leaving the accepting state.
- The conversion is a component-building technique and is one of the transformations required for Assignment 1.
- The regular expression epsilon accepts only the empty string, so its base-case machine connects its start to its accepting state with an epsilon transition.
- The empty-language expression has start and accepting states but no connecting transition; a symbol such as 0 gets a single transition labeled 0.
- For R + S, a new start branches by epsilon into the R and S machines and their accepting paths lead to one new accepting state.
- For concatenation RS, connect R's accepting state to S's start with epsilon, reusing R's start and S's accepting state.
- The R* construction adds a new start and accepting state and makes R's former accepting state non-accepting.
- An epsilon path from the new start directly to the new accepting state allows zero repetitions.
- Epsilon transitions into R and back from R's former accepting state allow one or more repetitions; the construction follows the specific mechanism given in the course slides.
- First build separate one-transition machines for 0 and 1, then combine them with the union construction for 0 + 1.
- Apply the Kleene-star construction to the union machine by adding new start and accepting states.
- The direct epsilon path accepts zero repetitions, while the loop through the union machine permits any sequence of 0s and 1s.
- The worked expression is (0 + 1)*1(0 + 1), built from the already constructed starred machine, a single-symbol 1 machine, and a final union machine.
- Use explicit epsilon transitions between concatenated components to match the construction method specified in the lecture slides.
- For concatenation, the leftmost machine supplies the overall start state and the rightmost machine supplies the overall accepting state.
- Jackie Wang plans to cover the critical steps for converting epsilon-NFAs to DFAs in the next class.
- The upcoming course detour introduces object-oriented concepts and design patterns to support studying ANTLR 4 tutorial material.
- Topics previewed include polymorphism, dynamic binding, Composite, and Visitor.
Transcript excerpt
0:05 Okay. So, just don't forget your assignment one will be due uh next week. I'll send you maybe one more reminder on the e-class, right? And then if you got any trouble since everybody's okay, but uh if you haven't get started, please get started soon. Okay? And everything's there. So, we're going to move on with the review on the DFA, NFA conversion kind of stuff today. And then so for next week I want to interrupt the flow a little bit by talking about two design patterns because when you study the antler for tutorial videos during the reading week you will need to have some basic understanding about those two design patterns which I cannot assume that you actually learned it before because it's not really course prerequisite. So I'll talk about them very briefly uh next week and I want to take a look at the uh semester calendar
0:54 very quickly. So somehow this semester we are rather quick to move into the uh reading week only after five weeks typically should be six right. So if you look at the semester calendar here just for you guys to be aware. So we are now here October 1st right here. So next week before uh Wednesday most likely right definitely before Thursday's class I will release both your projects and also assignment number two. I think that they are closely related. I will spend about maybe the beginning 10 or 15 minutes of Thursday's class next week to really talk about how you should really uh tackle these two uh important uh milestone for the course, right? So definitely spend a good amount of time throughout the reading week.
1:41 It's going to be very worthwhile your efforts for sure. And then your programming test is not that soon. Of
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jackie Wang.