CSCI 301 L26 Notes

Lecture 26 - Notes

Goals

Announcements

Closure of Regular Languages under Regular Operations

We’re finally ready to do the (actually quite straightforward, now!) proof of the closure of regular operations.

Theorem: The set of regular languages is closed under the regular operations.

Regular Operations

Proof:

Case: \(A \cup B\) - proof by construction:

Let \(M_A = (Q_A, \Sigma, \delta_A, q_A, F_A)\) be a DFA accepting \(A\) and \(M_B = (Q_B, \Sigma, \delta_B, q_B, F_B)\) be a DFA accepting \(B\).

Construct an NFA \(N = (Q, \Sigma', \delta, q, F)\) as follows:

  1. Let \(Q_B'\) be a set containing \(Q_B\)’s elements, but renamed to ensure that \(Q_A \cap Q_B = \varnothing\); also let \(s\) be a new state that is not a member of \(Q_A\) or \(Q_B\).
  2. The NFA’s alphabet is \(\Sigma' = \Sigma \cup \{\epsilon\}\).
  3. The NFA’s transition function \(\delta = \delta \cup \{((s, \epsilon), q_A), ((s, \epsilon), q_B)\}\).
  4. The NFA’s start state is \(q = s\).
  5. The NFA’s accept states are \(F = F_A \cup F_B\).

This machine accepts \(A \cup B\) because at the start of processing, it may nondeterministically decide to make an \(\epsilon\)-transition to either \(A\)’s start state or \(B\)’s start state, then proceed to process the string exactly as \(M_A\) or \(M_B\) would. Therefore, if the string is in \(A\) or \(B\), then there is a way that \(N\) can process the string and end in an accept state.

Regular Expressions

Regular expressions are a meta-language for describing regular languages. They are defined based on the properties of regular languages that we’ve now explored thoroughly, so a lot of what follows will probably be unsurprising.

Definition: A regular expression over an alphabet \(\Sigma\) is defined as follows:

Examples:

What language does \((0 \cup 1)01^*\) describe?

\(\{00, 001, 0011, \ldots, 10, 101, 1011, \ldots\}\)

What regular expression describes \(\{w: w \text{ has $1011$ as a substring}\}\)?

\((0 \cup 1)^*1011(0 \cup 1)^*\)