CS 139 // 2020-02-18
$R$ is a regular expression if it is in the form:
$R$
$a$
$a\in\Sigma$
$\epsilon$
$\emptyset$
$(R_1\cup R_2)$
$R_1$
$R_2$
$(R_1\circ R_2)$
$(R_1)^\ast$
Write the corresponding language that each of the following regular expressions express
$0\cup 1$
$\{0, 1\}$
$01$
$\{01\}$
$01\cup\epsilon$
$\{01,\epsilon\}$
$\texttt{ab}\cup\emptyset$
$\{ab\}$
$(0\cup 1)^\ast$
$\{0,1\}^\ast = \{\epsilon, 0, 1, 00, \ldots\}$
$0^\ast\cup 1$
$\{\epsilon, 0, 00, 000, \ldots\}\cup\{1\}$
$0(0\cup 1)^\ast \cup (0\cup 1)^\ast 1$
$\{0w, w1\mid w\in\{0,1\}^\ast\}$
Let $\Sigma = \{\texttt{a}, \ldots, \texttt{z}\}\cup \{\texttt{/}, \texttt{N}, \texttt{*}\}$ be an alphabet
$\Sigma = \{\texttt{a}, \ldots, \texttt{z}\}\cup \{\texttt{/}, \texttt{N}, \texttt{*}\}$
$\texttt{//}\ldots \texttt{N}$
$A = (\texttt{a}\cup\cdots\cup\texttt{z}\cup\texttt{*})$
R = $\texttt{//}\circ A^\ast\circ\texttt{N}$
$\texttt{/*}\ldots \texttt{*/}$
$\texttt{/*abc*/def*/}$
$\texttt{*/}$
$R = \texttt{/*}\circ B^\ast\circ\texttt{*/}$
$B$
$X = (A\cup\texttt{N})$
$Y = (X\cup\texttt{/})$
$B = (Y\cup(\texttt{*})^\ast X)$
$L$
$L$ is regular $\iff$ there is a regex with $L(R) = L$
$\iff$
$L(R) = L$
$\Longleftarrow$
$M$
$L(M) = L(R)$
$\implies$
$\cap$
$\cup$
$\setminus$
$A$
$$A\circ B = \{x\circ y \mid x\in A, y\in B\}$$
$\{000,1\}\circ\{\texttt{a}, \texttt{b}\texttt{c}\}$
$ = \{000\texttt{a}, 000\texttt{bc}, 1\texttt{a}, 1\texttt{bc}\}$
$A\subseteq\Sigma^\ast$
$\overline{A} = \Sigma^\ast\setminus A$
$\overline{A}$
$A,B\subseteq\Sigma^\ast$
$A\cap B$
$A\cup B$
$A\circ B$
$$A^\ast = \bigcup_{n\in\mathbb{Z}_{\ge 0}} A^n$$
$A^0 = \{\epsilon\}$
$A^1 = A$
$A^k = A\circ A^{k-1}$