Computation Histories




CS154

Chris Pollett

May 4, 2020

Outline

Emptiness Testing for TMs

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:

  1. 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`.' '
  2. Run `R` on input `langle M' rangle`.
  3. 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}`

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}.}`

Formal Definition of a Computation History

Quiz

Which of the following is true?

  1. We showed in class that `A_{CFG}` is undecidable.
  2. We showed in class that `A_{TM}` is not recursively enumerable.
  3. 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

Strength of LBAs

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:

  1. Simulate `M` on `w` for `qng^n` steps or until it halts.
  2. 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:

  1. Construct LBA `B` from `M` on `x` .
  2. Run `R` on input `langle B rangle`.
  3. 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}`

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:

  1. It does not start with `C_1`; or that,
  2. it does not end with an accepting configuration; or that,
  3. 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:

  1. Construct the CFG `G` from `M` and `x` to recognize `bar{L}`.
  2. Run `N` (our decision procedure for `ALL_{CFG}`) on `langle G rangle`
  3. 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).