40
ها ن ی ش و ما ها ان ب ه ز ی ر ظ ن ها ن ی ش و ما ها ان ب ه ز ی ر ظ ن م ج ن پ ل ص ف م ج ن پ ل ص فReducibility Reducibility ِ ِ ف ی ر ش ی* ت ع ن ص گاه ش ن دا ف ی ر ش ی* ت ع ن ص گاه ش ن دا هاز ب هاز ب88 88

نظریه زبان ها و ماشین ها

  • Upload
    hamal

  • View
    78

  • Download
    17

Embed Size (px)

DESCRIPTION

نظریه زبان ها و ماشین ها. فصل پنجم Reducibility ِ. دانشگاه صنعتی شریف بهار 88. Reducibility. A reduction is a way of converting one problem to another problem in such a way that a solution to the second problem can be used to solve the first problem. - PowerPoint PPT Presentation

Citation preview

Page 1: نظریه زبان ها و ماشین ها

نظریه زبان ها و نظریه زبان ها و ماشین هاماشین ها

پنجم پنجم فصل فصلReducibilityReducibilityِِ

شریف صنعتی شریف دانشگاه صنعتی دانشگاه8888بهار بهار

Page 2: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

ReducibilityReducibility• A reduction is a way of converting one

problem to another problem in such a way that a solution to the second problem can be used to solve the first problem.

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

Page 3: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Undecidable ProblemsUndecidable Problems• Let

• Then we have

Page 4: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Proof: by ContradictionProof: by Contradiction

• Assume machine R decides HALTTM.• Then we can construct S as a decider for ATM as

follows:

• Thus contradicting the fact of ATM ‘s undecidability.

Page 5: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Undecidable Problems Undecidable Problems (continued)(continued)

• Let

• Then we have

Page 6: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

• Let

• Assuming R is a decider for ETM, we construct S as a decider for ATM as follows:

Proof: by ContradictionProof: by Contradiction

Page 7: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Undecidable Problems Undecidable Problems (continued)(continued)

• Let

• Then we have

Page 8: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

• Assuming R is a decider for REGULARTM, we construct S as a decider for ATM as follows:

Proof: by ContradictionProof: by Contradiction

Page 9: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Undecidable Problems Undecidable Problems (continued)(continued)

• Let

• Then we have

Page 10: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

• Assuming R is a decider for EQTM, we construct S as a decider for ETM as follows:

Proof: by ContradictionProof: by Contradiction

Page 11: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Reduction via Computation Reduction via Computation HistoriesHistories

Page 12: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Linear Bounded AutomataLinear Bounded Automata

Page 13: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Decidable Problems about Decidable Problems about LBALBA

• Let

• Then we have

Page 14: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

ProofProof• Each configuration consists of

– State (q)– The head position (n)– The tape content (gn)

• Thus proving the lemma.

Page 15: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Decidable Problems about Decidable Problems about LBALBA

• Remember that

• Finally, we have

Page 16: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

ProofProof

Page 17: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Undecidable Problems Undecidable Problems about LBAabout LBA

• Let

• Then, we have

Page 18: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

ProofProof• We can determine whether a TM M accepts

input w by constructing a certain LBA B and then testing whether L(B) is empty.

• B recognizes all accepting computation histories for M on w.

• M accepts w iff B’s language is nonempty.

Page 19: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Proof (cont.)Proof (cont.)• An accepting computation history must

satisfy three properties:

Page 20: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Proof (cont.)Proof (cont.)• This is how LBA B works:

– On input x, break up x into C1, C2, …, Cl.

– Determine whether Ci satisfy the three conditions of accepting computation histories.

Page 21: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Reduction of ATM to ELBA

• Construct TM S that decides ATM as follows:

Page 22: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Undecidable Problems Undecidable Problems about CFGabout CFG

• Let

• Then, we have

Page 23: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Proof: Proof: Reduction of ATM to ALLCFG

• For a TM M and an input w we construct a CFG G (or PDA D) that generates all strings if and only if M does not accept w.

• G (or PDA D) generates all strings that1. do not start with C1,2. do not end with an accepting configuration, or3. where some Ci does not properly yield Ci+1 under the rule of

M.

Page 24: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Proof: Proof: Reduction of ATM to ALLCFG

• The PDA has three branches corresponding to each of the three cases.

• The 3rd branch non-deterministically finds where Ci does not yield Ci+1 properly.

• Ci and Ci+1 are supposed to match except around the head position where the difference is dictated by the transition function of M.

Page 25: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Proof: Proof: Reduction of ATM to ALLCFG

• To be able to recognize mismatch with a PDA, we assume that configurations are arranged as follows:

Page 26: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Post Correspondence Problem Post Correspondence Problem (PCP)(PCP)

• Consider a Collection of dominos each containing two strings, one on each side.

Page 27: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

MatchMatch

• We want the string we get by reading the top strings to be the same as the bottom string.

Page 28: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Formalizing PCP as a LanguageFormalizing PCP as a Language

Page 29: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

PCP is UndecidablePCP is Undecidable

Page 30: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Modified PCPModified PCP

• Let’s instead focus on the following problem:

• We now prove that MPCP is undecidable.

Page 31: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Reduction of AReduction of ATMTM to PCP to PCP

• Letting R decide PCP, we construct S as a decider for ATM .

• We begin with constructing an instance for MPCP.

Page 32: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Reduction of AReduction of ATMTM to PCP to PCP•

Page 33: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Reduction of AReduction of ATMTM to PCP to PCP

Page 34: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

MPCP is not harder than PCPMPCP is not harder than PCP• Suppose

• Solving MPCP with

is equivalent to solving PCP with

Page 35: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Mapping ReducibilityMapping Reducibility

Page 36: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Mapping ReducibilityMapping Reducibility• This mapping provides a way to convert questions about

membership testing in A to membership testing in B.

• If a problem is mapping reducible to a previously solved problem, this gives a way of solving the original problem.

Page 37: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Mapping ReducibilityMapping Reducibility

Page 38: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Mapping ReducibilityMapping Reducibility

Page 39: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Mapping ReducibilityMapping Reducibility

Page 40: نظریه زبان ها و ماشین ها

ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه

Proof (cont.)Proof (cont.)