Please note that only content with BLUE titles is exam-related. Other content is basic/background info. Half of the content is based on the course MIT 18.404J Theory Of Computation. The other half(especially exam-related parts) is based on the course Automaten und Sprache.

Regular Language - basic info

1. Definition of Regular language

A language L(A) is called regular if there is a DFA that accepts it. Regular languages are context-free! L(A) = {w∈Σ* | A accepts w} = {w∈Σ* | δ (q0, w)∈F}

2. Regular expressions

— Built from $\Sigma$, members $\Sigma, \phi , \varepsilon$ [Atomic] (no stars)

— By using Operations [Composite]

Symbol Meaning
. Any character
\d Any digit
\s Whitespace
\w Alphanumeric character [a-zA-Z_0-9]
\ Escape character, the following character is treated literally (e.g., \“ means the character “ follows)
\b Word boundary
^ Start of a line / beginning of the text
$ End of a line / end of the text
() Group
? Occurs 0 or 1 time
+ Occurs 1 or more times
* Occurs 0 or more times
{n} Occurs n times
{n,m} Occurs n to m times
X Y
r{,3} r
r{2,3} rr
r{3,} rrr*
[0-9] A digit from 0 to 9
[a-z] A letter from a to z
[a-z]{0,3} Zero to three letters from a to z
[a-zA-Z] A letter from a to z or from A to Z
[12] A character from the list [12] (i.e., 1 or 2)
[^abc] Any character except a, b, or c

Untitled

3. Closure under regular operations ($\cup$ , $\circ$  ,$\ast$ )

closure under $\cup$ (Union)

Theorem: if A1, A2 are regular languages, so is $A_{1}\cup A_{2}$

Proof: let

$$ M_{1} = (Q_1,\Sigma_1,\delta_1,q_{1},F_1)\ recognize\ A_1\\ M_{2} = (Q_2,\Sigma_2,\delta_2,q_{2},F_2)\ recognize\ A_2 $$

Construct $M = (Q,\Sigma,\delta,q_0,F)\ recognize\ A_1 \cup A_2$

M should accept input w if either $M_1$ or $M_2$ accept w.

Screenshot 2024-03-28 at 12.30.47.png

Screenshot 2024-03-07 at 15.56.39.png

Closure under $\circ$ (concatenation) Theorem: if A1, A2 are regular languages, so is $A_{1} A_{2}$

Screenshot 2024-03-07 at 16.05.08.png

Closure under $\ast$ (star) Theorem: If $A$ is a regular language, so is $A^\ast$

Screenshot 2024-03-28 at 12.49.11.png

4. Regular Expressions → NFA

Theorem: If R is a regular expression and A = L(R) then A is a regular language Proof: Convert R to equivalent NFA M