نظریه زبان ها و ماشین ها
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 PresentationTRANSCRIPT
نظریه زبان ها و نظریه زبان ها و ماشین هاماشین ها
پنجم پنجم فصل فصلReducibilityReducibilityِِ
شریف صنعتی شریف دانشگاه صنعتی دانشگاه8888بهار بهار
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Undecidable ProblemsUndecidable Problems• Let
• Then we have
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Undecidable Problems Undecidable Problems (continued)(continued)
• Let
• Then we have
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
• Let
• Assuming R is a decider for ETM, we construct S as a decider for ATM as follows:
Proof: by ContradictionProof: by Contradiction
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Undecidable Problems Undecidable Problems (continued)(continued)
• Let
• Then we have
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
• Assuming R is a decider for REGULARTM, we construct S as a decider for ATM as follows:
Proof: by ContradictionProof: by Contradiction
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Undecidable Problems Undecidable Problems (continued)(continued)
• Let
• Then we have
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
• Assuming R is a decider for EQTM, we construct S as a decider for ETM as follows:
Proof: by ContradictionProof: by Contradiction
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Reduction via Computation Reduction via Computation HistoriesHistories
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Linear Bounded AutomataLinear Bounded Automata
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Decidable Problems about Decidable Problems about LBALBA
• Let
• Then we have
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
ProofProof• Each configuration consists of
– State (q)– The head position (n)– The tape content (gn)
• Thus proving the lemma.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Decidable Problems about Decidable Problems about LBALBA
• Remember that
• Finally, we have
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
ProofProof
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Undecidable Problems Undecidable Problems about LBAabout LBA
• Let
• Then, we have
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Proof (cont.)Proof (cont.)• An accepting computation history must
satisfy three properties:
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Reduction of ATM to ELBA
• Construct TM S that decides ATM as follows:
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Undecidable Problems Undecidable Problems about CFGabout CFG
• Let
• Then, we have
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 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:
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Post Correspondence Problem Post Correspondence Problem (PCP)(PCP)
• Consider a Collection of dominos each containing two strings, one on each side.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
MatchMatch
• We want the string we get by reading the top strings to be the same as the bottom string.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Formalizing PCP as a LanguageFormalizing PCP as a Language
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
PCP is UndecidablePCP is Undecidable
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Modified PCPModified PCP
• Let’s instead focus on the following problem:
• We now prove that MPCP is undecidable.
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Reduction of AReduction of ATMTM to PCP to PCP•
•
•
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Reduction of AReduction of ATMTM to PCP to PCP
•
•
•
•
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
MPCP is not harder than PCPMPCP is not harder than PCP• Suppose
• Solving MPCP with
is equivalent to solving PCP with
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Mapping ReducibilityMapping Reducibility
ها ماشین و ها زبان شریف نظریه صنعتی 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.
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Mapping ReducibilityMapping Reducibility
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Mapping ReducibilityMapping Reducibility
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Mapping ReducibilityMapping Reducibility
ها ماشین و ها زبان شریف نظریه صنعتی 88بهار دانشگاه
Proof (cont.)Proof (cont.)