Corollary (one direction) of the Myhill-Nerode Theorem:
If a language \(L\) has an infinite number of equivalence classes with respect to \(\sim_L\),
then \(L\) is nonregular.
Proof: (Contrapositive: \(L\) regular \(\implies\) \(\sim_L\) defines a finite number of equivalence classes.)
Is this all we need?
While DFAs and CFGs can solve many useful problems, they are quite limited.
Source of these limitations: lacking access to arbitrary amounts of memory.
We now take a big leap in computational power and introduce Turing machines (TM).
TMs are a generalization of DFAs.
This is now a Turing machine!
Distinctive features of Turing machines:
list, C++ std::vector, Java java.util.List).
\[ P = \setbuild{w \in \{0, 1\}^*}{w = \reverse{w}} \]
A Turing machine (TM) is a 7-tuple: \(M = (Q, \Sigma, \Gamma, \delta, s, q_a, q_r)\) where:
\[ P = \setbuild{w \in \{0, 1\}^*}{w = \reverse{w}} \]
\(M = (Q, \Sigma, \Gamma, \delta, s, q_a, q_r)\) where:
How can we describe the “full state” that a Turing machine is in (including its tape)?
A configuration of a TM \(M = (Q, \Sigma, \Gamma, \delta, s, q_a, q_r)\) is a triple: \(C = (q, p, w)\) where:
Sipser uses a different notation “\(u\, q\, v\)” where \(w=uv\) and \(p = |u| + 1\).
Example: \(1011q_70111\).
See Optional Section 8.4 for a definition (uglier) using a finite, growable tape.
A configuration of a TM \(M = (Q, \Sigma, \Gamma, \delta, s, q_a, q_r)\) is a triple: \(C = (q, p, w)\) where:
We define computation by formally specifying how one configuration \(C = (q, p, w)\) transitions to the next configuration \(C' = (q', p', w')\).
We say \(C\) yields \(C'\) (writing \(C \to C'\)) when \(M\) can legally go from \(C\) to \(C'\) in one step: \[ \delta(q, w[p]) = (\fragment{q'}, \fragment{w'[p]}, \fragment{m}) \hspace{5em} \]
We identify moves \(m \in \{L, R, S\}\) with offsets \(\{-1, +1, 0\}\) added to \(p\).
A configuration of a TM \(M = (Q, \Sigma, \Gamma, \delta, s, q_a, q_r)\) is a triple: \(C = (q, p, w)\) where:
A configuration \((q, p, w)\) is called:
accepting if \(q = q_a\), rejecting if \(q = q_r\), halting if \(q \in \{q_a, q_r\}\).
\(M\) accepts/rejects input \(w \in \Sigma^*\) if there is a finite sequence of configurations \(C_1, C_2, \ldots, C_k\) such that:
If \(M\) neither accepts nor rejects \(w\), we say \(M\) loops (does not halt) on \(w\).