Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.54 KB | None | 0 0
  1. \exercise{}{0}
  2. \solution
  3. \textcolor{blue}{
  4.    The syntax of regular expressions given by Definition 3.13 is the following:
  5.    \begin{enumerate}
  6.        \item The constants $\epsilon$ and $\varnothing$ are regular expressions, with L($\epsilon$) = {$\epsilon$} and L($\varnothing$) = $\varnothing$.
  7.        \item For each $a\in\Sigma$, \textbf{a} is a regular expression, with $L(a)=\{a\}$.
  8.        \item If E and F are regular expressions, then (E+F) is a regular expression with $L((E+F))=L(E)\cup L(F)$.
  9.        \item If E and F are regular expressions, then (EF) is a regular expression with $L((EF))=L(E)L(F)$.
  10.        \item If E is a regular expression, then $(E^*)$ is a regular expression, with $L((E^*))=(L(E))^*$.
  11.    \end{enumerate}
  12.    So let us denote a grammar $G=(V,T,P,S)$, where $V={S}$ and T is T from the problem statement, we have the following P:\\ \\
  13.    \begin{center}
  14.        $\text{S}\rightarrow\varnothing|\epsilon\leftarrow$for rule 1\\
  15.        $\text{S}\rightarrow \text{a}|\text{b}\leftarrow$for rule 2\\
  16.        $\text{S}\rightarrow\text{S}+\text{S}\leftarrow$for rule 3\\
  17.        $\text{S}\rightarrow\text{SS}\leftarrow$for rule 4\\
  18.        $\text{S}\rightarrow\text{S}^*\leftarrow$for rule 5\\
  19.    \end{center}
  20. }
  21.  
  22. \exercise{}{0}
  23. \solution
  24. \textcolor{blue}{
  25.    Let us denote the grammar $G=(V,T,P,A)$ where:
  26.    \begin{align*}
  27.        V&=\{A,B\}\\
  28.        T&=\{1,0,\epsilon\}
  29.    \end{align*}
  30.    \begin{align*}
  31.        P: &A\rightarrow 0A|1B|\epsilon\\
  32.        &B\rightarrow 0A|\epsilon\\
  33.    \end{align*}
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement