Skip to content

Commit f524231

Browse files
authoredSep 19, 2023
fix typos
1 parent d4cad9e commit f524231

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎lec_05_infinite.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,10 @@ Similarly, for every formal language $L \subseteq \Sigma^*$, we say that $L$ is
525525
::: {.example title="A regular function" #regularexpmatching}
526526
Let $\Sigma=\{ a,b,c,d,0,1,2,3,4,5,6,7,8,9 \}$ and $F:\Sigma^* \rightarrow \{0,1\}$ be the function such that $F(x)$ outputs $1$ iff $x$ consists of one or more of the letters $a$-$d$ followed by a sequence of one or more digits (without a leading zero).
527527
Then $F$ is a regular function, since $F=\Phi_e$ where
528-
$$e = (a|b|c|d)(a|b|c|d)^*(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)^*$$
528+
$$e = (a|b|c|d)(a|b|c|d)^*(1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)^*$$
529529
is the expression we saw in [regexpeq](){.eqref}.
530530

531-
If we wanted to verify, for example, that $\Phi_e(abc12078)=1$, we can do so by noticing that the expression $(a|b|c|d)$ matches the string $a$, $(a|b|c|d)^*$ matches $bc$, $(0|1|2|3|4|5|6|7|8|9)$ matches the string $1$, and the expression $(0|1|2|3|4|5|6|7|8|9)^*$ matches the string $2078$. Each one of those boils down to a simpler expression. For example, the expression $(a|b|c|d)^*$ matches the string $bc$ because both of the one-character strings $b$ and $c$ are matched by the expression $a|b|c|d$.
531+
If we wanted to verify, for example, that $\Phi_e(abc12078)=1$, we can do so by noticing that the expression $(a|b|c|d)$ matches the string $a$, $(a|b|c|d)^*$ matches $bc$, $(1|2|3|4|5|6|7|8|9)$ matches the string $1$, and the expression $(0|1|2|3|4|5|6|7|8|9)^*$ matches the string $2078$. Each one of those boils down to a simpler expression. For example, the expression $(a|b|c|d)^*$ matches the string $bc$ because both of the one-character strings $b$ and $c$ are matched by the expression $a|b|c|d$.
532532
:::
533533

534534
Regular expression can be defined over any finite alphabet $\Sigma$, but as usual, we will mostly focus our attention on the _binary case_, where $\Sigma = \{0,1\}$.
@@ -684,7 +684,7 @@ INPUT: Regular expression $e$ over $\Sigma^*$, $x\in \Sigma^n$ where $n\in\N$
684684
OUTPUT: $\Phi_e(x)$
685685
686686
procedure{FMatch}{$e$,$x$}
687-
lIf {$x=""$} return $\CALL{MatchEmpty}(e)$ lendif
687+
lIf {$x=""$} return $\CALL{MatchEmpty}{e}$ lendif
688688
Let $e' \leftarrow \CALL{Restrict}{e,x_{n-1}}$
689689
return $FMatch(e',x_0 \cdots x_{n-2})$
690690
endprocedure

0 commit comments

Comments
 (0)