正規語言相關文章參考資料為陳穎平教授上課講義

L5 Reducibility

If problem A reduces to problem B, we can use a solution to B to solve A.

When A is reducible to B, solving A cannot be harder than solving B because a solution to B gives a solution to A. Therefore, if A is reducible to B,

  • B is decidable ⇒ A is decidable;
  • A is undecidable ⇒ B is undecidable.

Undecidable Problems from Language Theory

定義 HALTTM={M,w  M is a TM and M halts on input w}HALT_{TM} = \{ ⟨M, w⟩~|~M~is~a~TM~and~M~halts~on~input~w \}

Theorem

HALTTMHALT_{TM} is undecidable.

  • 證明: 假設 HALTTMHALT_{TM}decider RR 存在,則可以利用 RR 建立 ATMA_{TM}decider SS,產生矛盾

定義 ETM={M  M is a TM and L(M)=}E_{TM} = \{ ⟨M⟩~|~M~is~a~TM~and~L(M) = ∅ \}

Theorem

ETME_{TM} is undecidable.

  • 證明: 假設 ETME_{TM}decider RR 存在,則可以利用 RR 建立 ATMA_{TM}decider SS,產生矛盾

定義 REGULARTM={M  M is a TM and L(M) is a regular language}REGULAR_{TM} = \{ ⟨M⟩~|~M~is~a~TM~and~L(M)~is~a~regular~language \}

Theorem

REGULARTMREGULAR_{TM} is undecidable.

  • 證明: 假設 REGULARTMREGULAR_{TM}decider RR 存在,則可以利用 RR 建立 ATMA_{TM}decider SS,產生矛盾

Theorem

Rice’s theorem: Let PP be a language consisting of Turing machine descriptions where PP fulfills two conditions.
First, PP is nontrivial: it contains some, but not all, TM descriptions.
Second, PP is a property of the TM’s language: whenever L(M1)=L(M2)L(M_1) = L(M_2), we have M1P iff M2P⟨M_1⟩ ∈ P~iff~⟨M_2⟩ ∈ P . Here M1M_1 and M2M_2 are any TMs.
Prove that PP is an undecidable language.


定義 EQTM={M1,M2  M1 and M2 are TMs and L(M1)=L(M2)}EQ{TM} = \{ ⟨M_1, M_2⟩~|~M_1~and~M_2~are~TMs~and~L(M_1) = L(M_2) \}

Theorem

EQTMEQ_{TM} is undecidable.

  • 證明: 假設 EQTMEQ_{TM}decider RR 存在,則可以利用 RR 建立 ETME_{TM}decider SS,產生矛盾

Reductions via Computation Histories

The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input.

Definition

An accepting computation history for MM on ww is a sequence of configurations, C1,C2,...,ClC_1, C_2, ... , C_l, where C1C_1 is the start configuration of MM on ww, ClC_l is an accepting configuration of MM , and each CiC_i legally follows from Ci1C_{i−1} according to the rules of MM .

A rejecting computation history for MM on ww is defined similarly, except that ClC_l is a rejecting configuration.

Definition

A linear bounded automaton is a restricted type of Turing machine wherein the tape head isn’t permitted to move off the portion of the tape containing the input. (除了 input 之外不需要額外空間)


Lemma

Let MM be an LBA with qq states and gg symbols in the tape alphabet. There are exactly qngnqng^n distinct configurations of MM for a tape of length nn.

定義 ALBA={M,w  M is a LBA that accepts input string w}A_{LBA} = \{ ⟨M, w⟩~|~M~is~a~LBA~that~accepts~input~string~w \}

Theorem

ALBAA_{LBA} is decidable.

  • 證明: 因為 LBAconfigurations 是有限的,因此我們可以判斷它是否進入循環

定義 ELBA={M  M is an LBA and L(M)=}E_{LBA} = \{ ⟨M⟩~|~M~is~an~LBA~and~L(M) = ∅ \}

Theorem

ELBAE_{LBA} is undecidable.

  • 證明: 可以建立一個 LBA BB,輸入 TMcomputation history 並檢驗,如果是 accepting computation history 的話則 accept,否則 reject

定義 ALLCFG={G  G is a CFG and L(G)=Σ}ALL_{CFG} = \{ ⟨G⟩~|~G~is~a~CFG~and~L(G) = Σ^∗ \}

Theorem

ALLCFGALL_{CFG} is undecidable.

  • 證明:
    • 給定 TM MM 以及 input ww,可以建立一個 PDA DDDD 會 accept 除了 wwMMaccepting computation histories 之外的所有 strings
    • PDA DD 對應的 CFG GG 會產生 ΣΣ^∗ iff MM not accept ww
    • 可以利用 ALLCFGALL_{CFG} 去判斷 L(G)L(G) 是否為 ΣΣ^∗ 去得出 MM 是否 accept ww

GG generates all strings

A Simple Undecidable Problem

Post correspondence problem (PCP)
To determine whether a collection of dominos has a match.

A collection of dominos:
{[bca],[aab],[caa],[abcc]}\{[\frac{b}{ca}],[\frac{a}{ab}],[\frac{ca}{a}],[\frac{abc}{c}]\}

A match (abcaaabc):
[aab],[bca],[caa],[aab],[abcc][\frac{a}{ab}],[\frac{b}{ca}],[\frac{ca}{a}],[\frac{a}{ab}],[\frac{abc}{c}]

Formally, an instance of PCP is a collection PP of dominos:
{[t1b1],[t2b2],...,[tkbk]}\{[\frac{t_1}{b_1}],[\frac{t_2}{b_2}],...,[\frac{t_k}{b_k}]\}
and a match is a sequence i1,i2,...,ili_1, i_2, ... , i_l, where ti1ti2til=bi1bi2bilt_{i_1}t_{i_2} ··· t_{i_l} = b_{i_1}b_{i_2} ··· b_{i_l}. The problem is to determine whether PP has a match.

定義 PCP={P  P is an instance of PCP with a match}PCP = \{ ⟨P⟩~|~P~is~an~instance~of~PCP~with~a~match \}

Theorem

PCPPCP is undecidable.

  • 證明: 略

Mapping Reducibility

Being able to reduce problem AA to problem BB by using a mapping reducibility means that a computable function, called a reduction, exists that converts instances of problem AA to instances of problem BB.

Computable Functions

A Turing machine computes a function by starting with the input to the function to the tape and halting with the output of the function on the tape.

Definition

A function f:ΣΣf: Σ^∗ → Σ^∗ is a computable function if some Turing machine MM, on every input ww, halts with just f(w)f(w) on its tape.

Formal Definition of Mapping Reducibility

Definition

Language AA is mapping reducible to language BB, written AmBA ≤_m B, if there is a computable function f:ΣΣf: Σ^∗ → Σ^∗, where for every ww, wAf(w)Bw ∈ A ⇔ f(w) ∈ B .
The function ff is called the reduction of AA to BB.

Theorem

If AmBA ≤_m B and BB is decidable, then AA is decidable.

  • 證明: 假設 BBdecider MM 存在,則可以利用 MM 以及 computable function ff 建立 AAdecider NN
Corollary

If AmBA ≤_m B and AA is undecidable, then BB is undecidable.

ex:


Theorem

If AmBA ≤_m B and BB is Turing-recognizable, then AA is Turing-recognizable.

  • 證明: 類似 decidable 的證明
Corollary

If AmBA ≤_m B and AA is not Turing-recognizable, then BB is not Turing-recognizable.

Theorem

EQTMEQ_{TM} is neither Turing-recognizable nor co-Turing-recognizable.


There are only the following situations are possible for a language AA and its complement A\overline A

  • AA and A\overline A are both decidable.
  • Neither AA nor A\overline A is Turing-recognizable.
  • AA is Turing-recognizable but undecidable, and A\overline A is not Turing-recognizable.

統整

  • decidable or not:

    DFA CFG LBA TM
    A O O O X
    E O O X X
    EQ O X X X
  • HALTTM,REGULARTM,ALLCFG,MPCP,PCPHALT_{TM}, REGULAR_{TM}, ALL_{CFG}, MPCP, PCP is undecidable.

  • ATM,Ld\overline {A_{TM}}, L_d is not Turing-recognizable.