hws/hw05.tex
changeset 962 2ecd511e62fa
parent 952 f09d9db4e922
child 963 4e3f7b3574a9
equal deleted inserted replaced
961:4543807efe9d 962:2ecd511e62fa
    54 %\end{center}
    54 %\end{center}
    55 %
    55 %
    56 %where the three dots stand for arbitrary characters, but not
    56 %where the three dots stand for arbitrary characters, but not
    57 %comment delimiters.
    57 %comment delimiters.
    58 
    58 
       
    59 \item The \emph{not}-regular expression is definitely useful for recognising
       
    60   comments for example, but can
       
    61   sometimes be quite unintuitive when it comes to deciding which strings are
       
    62   matched or not. Consider
       
    63 
       
    64   \[
       
    65   (\sim{}a)^*  \quad\text{and}\quad \sim{}(a^*)\;.  
       
    66   \]  
       
    67 
       
    68   What is the language of each regular expression?
       
    69 
       
    70   \solution{
       
    71     The first one is ``all strings, except $[a]$''; the second
       
    72     ``all strings except strings of the form $a^*$''.
       
    73   }
       
    74   
    59 \item Define the following regular expressions 
    75 \item Define the following regular expressions 
    60 
    76 
    61 \begin{center}
    77 \begin{center}
    62 \begin{tabular}{ll}
    78 \begin{tabular}{ll}
    63 $r^+$ & (one or more matches)\\
    79 $r^+$ & (one or more matches)\\