updated
authorChristian Urban <christian.urban@kcl.ac.uk>
Sun, 01 Oct 2023 10:57:32 +0100
changeset 932 5678414a3898
parent 931 14a6adca16b8
child 933 62c38f4b1dae
updated
handouts/ho01.pdf
handouts/ho02.pdf
handouts/ho02.tex
handouts/ho03.pdf
handouts/ho03.tex
handouts/ho04.pdf
handouts/ho05.pdf
handouts/ho06.pdf
handouts/ho07.pdf
handouts/ho08.pdf
handouts/ho09.pdf
handouts/ho10.pdf
progs/automata/thompson.sc
Binary file handouts/ho01.pdf has changed
Binary file handouts/ho02.pdf has changed
--- a/handouts/ho02.tex	Sun Oct 01 09:46:44 2023 +0100
+++ b/handouts/ho02.tex	Sun Oct 01 10:57:32 2023 +0100
@@ -44,7 +44,7 @@
 expressions of the form $a^?{}^{\{n\}}\cdot a^{\{n\}}$ and corresponding
 strings composed of $n$ \pcode{a}s (this time the regular expressions
 match the strings).  To see the substantial differences in the left and
-right plots below, note the different scales of the $x$-axes.
+right plots below, note the different scales of the $x$-axis.
 
   
 \begin{center}
Binary file handouts/ho03.pdf has changed
--- a/handouts/ho03.tex	Sun Oct 01 09:46:44 2023 +0100
+++ b/handouts/ho03.tex	Sun Oct 01 10:57:32 2023 +0100
@@ -538,7 +538,7 @@
 \noindent
 I let you think whether the NFAs can match exactly those strings the
 regular expressions can match. To do this translation in code we need
-a way to construct states ``programatically''...and as an additional
+a way to construct states ``programmatically''...and as an additional
 constraint Scala needs to recognise that these states are being distinct.
 For this I implemented in Figure~\ref{thompson1} a class
 \texttt{TState} that includes a counter and a companion object that
@@ -1302,7 +1302,7 @@
 $\epsilon$NFA, then translate it into a NFA by removing all
 $\epsilon$-transitions, and then via the subset construction obtain a
 DFA. In all steps we made sure the language, or which strings can be
-recognised, stays the same. Of cause we should have proved this in
+recognised, stays the same. Of couse we should have proved this in
 each step, but let us cut corners here.  After the last section, we
 can even minimise the DFA (maybe not in code). But again we made sure
 the same language is recognised. You might be wondering: Can we go
@@ -1449,7 +1449,7 @@
 \]
 
 \noindent You can somewhat crosscheck your solution by taking a string
-the regular expression can match and and see whether it can be matched
+the regular expression can match and see whether it can be matched
 by the DFA.  One string for example is $aaa$ and \emph{voila} this
 string is also matched by the automaton.
 
Binary file handouts/ho04.pdf has changed
Binary file handouts/ho05.pdf has changed
Binary file handouts/ho06.pdf has changed
Binary file handouts/ho07.pdf has changed
Binary file handouts/ho08.pdf has changed
Binary file handouts/ho09.pdf has changed
Binary file handouts/ho10.pdf has changed
--- a/progs/automata/thompson.sc	Sun Oct 01 09:46:44 2023 +0100
+++ b/progs/automata/thompson.sc	Sun Oct 01 10:57:32 2023 +0100
@@ -47,7 +47,7 @@
 
 // for composing an eNFA transition with an NFA transition
 // | is for set union
-implicit def nfaOps(f: eNFAtrans) = new {
+extension (f: eNFAtrans) {
   def +++(g: NFAtrans) : eNFAtrans = 
   { case (q, None) =>  applyOrElse(f, (q, None)) 
     case (q, Some(c)) => applyOrElse(f, (q, Some(c))) | applyOrElse(g, (q, c))  }