Outline
- Reductions to other undecidable
- Computation Histories
- Quiz
- Linear Bounded Automata
Emptiness Testing for TMs
- So far we have shown that both `A_{TM}` and `HALT_{TM}` are Turing-complete for r.e. and are not decidable.
- We have also shown that the `A_{mbox{clocked TM}}`, a polynomial clocked version of `A_{TM}`, is NP-complete.
- Knowing computationally hard problems for a class of languages, such as the decidable languages or the polynomial time languages,
is one of the crucial first steps toward developing cryptographic primitives guaranteed to be secure for that class.
- Although we showed `A_{TM}` was undecidable using diagonalization, the technique we used for `HALT_{TM}`, using reducibility, is the most common way to show a language is undecidable or to show it is Karp-hard for NP.
- For this reason we are going to look at some more examples of these kinds of arguments.
- Consider the language:
`E_{TM}={ langle M rangle | \mbox{M is a TM and }L(M)=emptyset}`.
Theorem. `E_{TM}` is Turing complete for co-r.e.
Proof. Notice we can make a Turing machine `M'` that given an encoding of `langle M rangle` cycles over
lengths `k= 1, 2, \ldots` and for each `k` checks for each string `w`
of length `leq k` whether `M` accepts `w` in `k` step. If it does, it halts accepting; otherwise it continues. This machine
recognizes whether `M`'s language is non-empty, thus showing `E_{TM}` is in co-r.e. Now suppose `L` is co-r.e. That means
its complement, `bar{L}` is recognized by some TM `M`. So `w` is in `L` iff `M` does not accept `w`.
So for any such `M` which is derived from a co-r.e. language and for any input `w`, consider the following machine:
"`M_1 =` "On input `x`:
- If `x ne w`, reject.
- If `x = w`, run `M` on input `w` and accept if `M` does."
This machine is a modification of `M` and it accepts at most one input `w`,
and it only accepts this if `M` does. For a fixed machine `M`, the map `w -> \langle M_1 rangle` is computable by a TM.
Also, we have `w in L` iff `M` does not accept `w` iff `M_1`'s language is empty iff `langle M_1 rangle` is in `E_{TM}`.
So we have shown how to reduce any language in co-r.e. to `E_{TM}`. Therefore, `E_{TM}` is Turing-complete for co-r.e.
Corollary. `E_{TM}` is undecidable.
Proof. If `E_{TM}` were decidable. Then every co-r.e. language would be decidable; and hence, also r.e. So the complement
of `A_{TM}` would be r.e., which would mean that `A_{TM}` is both r.e. and co-r.e. and hence decidable, giving a contradiction.
A Problem about Regular Languages
Even problems about regular languages can sometimes be hard...
Let `\mbox{REGULAR}_{TM} = { \langle M \rangle | mbox {M is a TM and L(M) is a regular language}}`.
Theorem. `\mbox{REGULAR}_{TM}` is undecidable.
Proof. Suppose `R` decides `\mbox{REGULAR}_{TM}`. Then the following machine decides `A_{TM}`:
"`S =`On input `langle M,w rangle`, where `M` is a TM and `w` is a string:
- Construct the following machine `M'`:
`M' = ''`On input `x`:
If `x` has the form `0^n1^n`, accept.
If `x` does not have this form, run `M` on input `w` and accept if `M` accepts `w`.
// So if `M` accepts `w`, then `M'` accepts all strings; otherwise, `M'` only accepts strings of the form `0^n1^n`.' '
- Run `R` on input `langle M' rangle`.
- If `R` accepts, accept; otherwise, if `R` rejects, reject."
In the above, the map `langle M,w rangle -> langle M' rangle` can be viewed as a reduction from `A_{TM}` to
`\mbox{REGULAR}_{TM}`.
Using reducibility from languages other than `A_{TM}`
- We can use languages other than `A_{TM}` to show a language is undecidable.
- For instance, if `E_{TM}` reduces to some language `A`, then `A` will be undecidable.
- For example, let `EQ_{TM} = { langle M_1, M_2 rangle | M_1\mbox{ and }M_2\mbox{ are TMs and }L(M_1) = L(M_2) }`.
Theorem. `EQ_{TM}` is undecidable.
Proof. Suppose `R` decides `EQ_{TM}`, then we can build an `S` solving `E_{TM}` as
follows (hence, giving a contradiction):
"`S = `On input `langle M rangle`, where `M` is a TM:
- Run `R` on `langle M, M_2 rangle`, where `M_2` is the machine that rejects all inputs.
- If `R` accepts, accept; otherwise if `R` rejects, reject."
- Since every problem in co-r.e. is Turing reducible to `E_{TM}`, the fact that Turing computable functions are closed under composition and
the Turing computable map `langle M rangle -> \langle M, M_2 rangle` shows `EQ_{TM}` is Turing-hard for co-r.e.
- We can show `A_{TM}` is Turing reducible to `EQ_{TM}` using the map `\langle M, w rangle -> langle M_1, M_2 rangle` where
`M_1` is the machine from Slide 3. Thus, `EQ_{TM}` is Turing-hard for r.e. Hence, we have:
Theorem. `EQ_{TM}` is neither r.e. or co-r.e.
Reductions via Computation Histories
Consider the following language:
`R := { langle w, M, x rangle | \mbox{ w is the code of a sequence of configurations,}`
`mbox{ each configuration yielding the next according to}`
`mbox{ the transition table of TM M on input x.}`
`mbox{ Further, the last configuration is accepting}.}`
- This language is decidable.
- Notice `A_{TM} := { langle M,x rangle| exists w langle w,M,x rangle in R}`.
- The string `w` in the above can be viewed as a computation history.
- Such histories are often useful in doing reductions from one problem to another.
Formal Definition of a Computation History
- Let `M` be a TM and `x` an input string.
- An accepting computation history for `M` on `x` is a sequence of configurations `C_1, ldots, C_k`,
where `C_1` is the start configuration of `M` on `x`, `C_k` is an accepting configuration of `M`,
and each `C_i` legally follows from `C_{i-1}` according to the rules of `M`.
- A rejecting computation history for `M` is defined similarly, except that `C_k` is a rejecting configuration.
Quiz
Which of the following is true?
- We showed in class that `A_{CFG}` is undecidable.
- We showed in class that `A_{TM}` is not recursively enumerable.
- For a proper function `f`, the language `A_f` is in `\mbox{TIME}((f(n))^3 ))` but not in `\mbox{TIME}( f( lfloor n/2 rfloor ))`.
Linear Bounded Automata
- We will next work towards using computation histories to give undecidability proofs.
- Our first example will involve a new machine model which has strength between a PDA and a TM.
- The classes of languages: Regular, Context-Free, Context-sensitive (recognized by LBAs), and Turing-recognizable form the so-called Chomsky
Hierarchy.
- A linear bounded automata (LBA) is a restricted type of TM whose tape head isn't permitted to move off the portion of the tape containing the input.
- If an LBA tries to move off this part of the tape to the right, the tape head stays where it is.
Strength of LBAs
- One can verify that each of the TMs we gave for the languages `A_{DFA}`, `A_{CFG}`, `E_{DFA}`, and `E_{CFG}` are either LBAs or easily modified into LBAs.
- For example, `E_{CFG}` involved marking each terminal,
then marking a variable `A` if it appear in a `A -> B_1 ldots B_n` and the `B_i`'s had already been marked.
Finally, one checks if the start variable has been marked.
- This marking can be done without using anymore tape squares so the above can be done by an LBA.
A Useful Lemma about LBAs
Lemma. Let `M` be an LBA with `q` states and `g` symbols in the tape alphabet.
There are exactly `qng^n` distinct configurations of M for a tape of length `n`.
Proof. A configuration consists of the state of the control of the LBA,
the position of the tape head, and the contents of the tape.
So there are `q` possibilities for the state,
the head can be in one of at most `n` positions,
each of the `n` tapes squares could have one of `g` symbols written in it (so `g^n` possibilities).
All together this gives, `qng^n`.
Decidability and LBAs
Theorem. `A_{LBA}` is decidable.
Proof. The algorithm that decides `A_{LBA}` is as follows:
"`D =`On input `langle M, w rangle`, where `M` is an LBA and `w` is a string:
- Simulate `M` on `w` for `qng^n` steps or until it halts.
- If `M` has halted, accept if it accepted; and reject if it rejected. If it has not halted reject."
LBAs and Undecidability
In contrast to the last theorem above, not all problems about LBAs are decidable:
Theorem. `E_{LBA}` is undecidable.
Proof. The reduction is from `A_{TM}`. We show if `E_{LBA}` is decidable then `A_{TM}` also would be decidable. Suppose `R` is decision procedure for `E_{LBA}`.
Let
`L={w | w mbox{ is a string of the form }C_1#C_2 cdots #C_k`
`\mbox{ giving a legal accepting computation history of M on input x}}`.
One can show that `L` can be recognized by an LBA; let's call it `B`. Further, if
`L` is empty, `langle M, x rangle` is not in `A_{TM}`. So if `E_{LBA}` were decidable the
following would be a decision procedure for
`A_{TM}`:
`S =` "On input `langle M,x rangle`, where `M` is a TM and `x` is a string:
- Construct LBA `B` from `M` on `x` .
- Run `R` on input `langle B rangle`.
- If `R` rejects, accept; if `R` accepts, reject." Q.E.D.
In fact, `E_{LBA}` is Turing-complete for co-r.e. for essentially the same reasons as `E_{TM}` was.
`mbox{ALL}_{CFG}`
- Computation histories can be used to show some problems about CFGs are undecidable.
- Let `mbox{ALL}_{CFG}` be the language `{langle G rangle | G mbox{ is a CFG and } L(G) = Sigma^star}`.
Theorem. `mbox{ALL}_{CFG}` is undecidable.
Proof. Assume `mbox{ALL}_{CFG}` is decidable by machine `N`, we will show how you could use this along with computation histories to decide `A_{TM}`. Recall for the `E_{LBA}` reduction we showed that an LBA can recognize the language:
`L = {w | w = C_1#C_2 ldots #C_k mbox( is an accepting computation history )`
`quad mbox{of Turing Machine } M mbox{ on input } x }`.
This language is not context-free (can prove this using the Pumping lemma). The basic is we'd like to verify pairs of configurations to see one follows the next, but if we were using a PDA and tried to push the characters of `C_i` onto the stack then when we pop them off they'd be in the wrong order to do the verification. Let `u^R` denote the string consisting of the characters of `u` in reverse order. To solve our problem we redefine a computation history so it has the format `w = C_1#C_2^R#C_3 ldots #C_k`. Let `L` now mean the language before but with this definition...
More on `mbox{ALL}_{CFG}`
(Proof cont'd) of computation history, one can show there is a PDA that when
given a string `w` can check:
- It does not start with `C_1`; or that,
- it does not end with an accepting configuration; or that,
- there is an `i` such that `C_i` does not properly yield `C_{i+1}`.
i.e., there is a PDA that can recognize the complement of `L`. We can convert this PDA to some CFG `G`. Now we can give a Turing Machine for `A_{TM}` as follows:
S="On input `langle M, x rangle` where `M` is a TM and `x` a string:
- Construct the CFG `G` from `M` and `x` to recognize `bar{L}`.
- Run `N` (our decision procedure for `ALL_{CFG}`) on `langle G rangle`
- If `N` rejects, accept; if `N` accepts, reject."
Remark. One can scale down the reduction via computation history technique to show that SAT = `{langle F rangle| mbox{F is a boolean formula which has an input setting that makes F true}}` is NP-complete (Cook 1970, Levin 1973).