Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \exercise{}{0}
- \solution
- \textcolor{blue}{
- The syntax of regular expressions given by Definition 3.13 is the following:
- \begin{enumerate}
- \item The constants $\epsilon$ and $\varnothing$ are regular expressions, with L($\epsilon$) = {$\epsilon$} and L($\varnothing$) = $\varnothing$.
- \item For each $a\in\Sigma$, \textbf{a} is a regular expression, with $L(a)=\{a\}$.
- \item If E and F are regular expressions, then (E+F) is a regular expression with $L((E+F))=L(E)\cup L(F)$.
- \item If E and F are regular expressions, then (EF) is a regular expression with $L((EF))=L(E)L(F)$.
- \item If E is a regular expression, then $(E^*)$ is a regular expression, with $L((E^*))=(L(E))^*$.
- \end{enumerate}
- 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:\\ \\
- \begin{center}
- $\text{S}\rightarrow\varnothing|\epsilon\leftarrow$for rule 1\\
- $\text{S}\rightarrow \text{a}|\text{b}\leftarrow$for rule 2\\
- $\text{S}\rightarrow\text{S}+\text{S}\leftarrow$for rule 3\\
- $\text{S}\rightarrow\text{SS}\leftarrow$for rule 4\\
- $\text{S}\rightarrow\text{S}^*\leftarrow$for rule 5\\
- \end{center}
- }
- \exercise{}{0}
- \solution
- \textcolor{blue}{
- Let us denote the grammar $G=(V,T,P,A)$ where:
- \begin{align*}
- V&=\{A,B\}\\
- T&=\{1,0,\epsilon\}
- \end{align*}
- \begin{align*}
- P: &A\rightarrow 0A|1B|\epsilon\\
- &B\rightarrow 0A|\epsilon\\
- \end{align*}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement