decidability human-aware roboticsyzhan442/teaching/cse355/... · abstract machines •...
TRANSCRIPT
Human-awareRobotics
1
Decidability
• 2017/10/31
• Chapter 4.1 in Sipser
Ø Announcement:q Slides for this lecture are here:
http://www.public.asu.edu/~yzhan442/teaching/CSE355/Lectures/decidability.pdf
q Happy Hollaween!
q Delayed grading for
o HW4 group part
o Project #1
Human-awareRobotics
2
Performance analysis• Overall average: 78.5% out of a total of 26.5 graded
• Midterm 1 average: 59.3%
• HW average: 86.2%
• Quiz average: 96.0%
78.5% x 108 = 84.8
Human-awareRobotics
3
Performance analysis
>81 >92 >102
28
15
6
13
6
22
>71>61
Human-awareRobotics
4
Last chapter
FA (DFA & NFA) expressRegular Expressions (RE)CFL
Recursively enumerable
• The church-turing thesiso Turing machines
q Definition of TM
q Computation of TM
q Design of TM
o Variants of TMs
o Multitape TM
o Nondeterminstic TM
o Enumerators
Human-awareRobotics
5
Theory of computation
• Automata Theoryabstract machines
• Computability Theoryfundamental capabilities
and limitations of abstract
machines
• Complexity Theorywhy certain problems are
harder than others
Computation
Human-awareRobotics
6
What are algorithms?Ø A process that can be determined in finite number of operations. Why
finite?
• Alonzo Church’s lambda-calculus
• Alan Turing’s machines (Turing machine)
MAccept
Reject
lambda-calculus
decider
Human-awareRobotics
7
What are algorithms?Ø A process that can be determined in finite number of operations. Why
finite?
• Alonzo Church’s lambda-calculus
• Alan Turing’s machines (Turing machine)
MAccept
Reject
lambda-calculus
These two
representations
are equivalent!
decider
Human-awareRobotics
8
Theory of computation
• Automata Theoryabstract machines
• Computability Theoryfundamental capabilities
and limitations of abstract
machines
• Complexity Theorywhy certain problems are
harder than others
Computation
decider
Human-awareRobotics
9
Theory of computation
• Automata Theoryabstract machines
• Computability Theoryfundamental capabilities
and limitations of abstract
machines
• Complexity Theorywhy certain problems are
harder than others
Computation
decider
Hilbert’s tenth problem
Human-awareRobotics
10
Why do we care?
Computation
decider
Hilbert’s tenth problem
Ø Identify problems that are too hardo change the problem
Ø Understand limitations of computers
D
D1
Human-awareRobotics
11
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems about RLs
Human-awareRobotics
12
Acceptance of DFA• Does a DFA accept a given string (the acceptance problem)?
•
• problem is solvable algorithmically == the corresponding language is decidable
MAccept
Reject
Human-awareRobotics
13
• Does a DFA accept a given string (the acceptance problem)?
Acceptance of DFA
Human-awareRobotics
14
• Does a DFA accept a given string (the acceptance problem)?
Implementationlevel?
MAccept
Reject
Acceptance of DFA
(Q,⌃, �, q0, F )
Human-awareRobotics
15
• Does a DFA accept a given string (the acceptance problem)?
Encoding of B is • Check whether input string is a valid finite automaton
Simulate B on w• TM keeps track of the current state of B and current position on w. • Updates are done through δ• When having processed the last input symbol, check whether the state is
accepting.
Acceptance of DFA
(Q,⌃, �, q0, F )
Human-awareRobotics
16
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems about RLs
Human-awareRobotics
17
• Does a NFA accept a given string?
•
• M on input <B, w>:
• Simulate B nondeterminstically using NTM
• If the simulation accepts, accept; else, reject.
Acceptance of NFA
Incorrect since the machine may not stop
Human-awareRobotics
18
• Does a NFA accept a given string?
•
•
Acceptance of NFA
Human-awareRobotics
19
• Does a NFA accept a given string?
•
• <B,w>
MAccept
Reject
N
Acceptance of NFA
<C,w>ConvertNFAtoDFA
ConvertingNFAtoDFAmustbedoneinfinitestepsalways!
Human-awareRobotics
20
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems about RLs
Human-awareRobotics
21
Generation of RE• Does an RE generate a string w?
•
• M on input <R, w>:
1. Try a possible instantiation of the regular operations so that the
strings are in shortlex order (how do we do this?)
2. Compare with w. If match, accept; else, continue to 1.
3. If the length of string generated is longer than w, reject
Works but clumsy
Human-awareRobotics
22
• Does an RE generate a string w?
•
• M on input <B, w>:
• Simulate B nondeterminstically
• If the simulation accepts, accept; else, reject.
Generation of RE
Human-awareRobotics
23
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems about RLs
• Reading assignment for the
next class:
o Sipser Sec. 4.1 - Quiz
link will be sent out;
due date is before the
beginning of the next
class
Human-awareRobotics
24
Last time• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems about RLs
MAccept
Reject
lambda-calculus
decider
solvability == decider
Human-awareRobotics
25
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems
Human-awareRobotics
26
Test emptiness of RL• Is the language of a DFA empty?
•
• M on input <A>:
• For each w in Σ* in shorlex order:
• Simulate A with w as the input
• If the simulation accepts, reject
• Accept
Incorrect since the machine would not stop
Human-awareRobotics
27
• Is the language of a DFA empty?
•
• M on input <A>:
• For each w order in shorlex order:
• Simulate A with w in
• If the simulation accepts, reject
• Accept.
Test emptiness of RL
Human-awareRobotics
28
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems
Human-awareRobotics
29
• Are the languages of DFA A and B the same?
•
• M on input <A, B>:
• Keep track of the current states of A and B
• For each state in the possible current states for A (unchecked), collect all
possible next states from the state
• If there is no a matched state (unchecked) in B’s current states (based
on its transition structure), reject; otherwise, mark the state in A and
the matched state in B as checked and continue
• Accept if no more states can be checked
Test equivalence of RLs
Incorrect since A and B can have different structures!
Human-awareRobotics
30
• Are the languages of DFA A and B the same?
•
•
L(A) = L(B) if and only if L(C) is empty
Test equivalence of RLs
Human-awareRobotics
31
• Are the languages of DFA A and B the same?
•
Test equivalence of RLs
Human-awareRobotics
32
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems
Human-awareRobotics
33
• Can a string w be generated by a CFG?
•
• How to contruct a Turing machine to decide ACFG?
Acceptance of CFG
Human-awareRobotics
34
• Can a string w be generated by a CFG?
•
Acceptance of CFG
What about APDA?
Human-awareRobotics
35
• Can a string w be generated by a CFG?
•
Acceptance of CFG
What about APDA?
Human-awareRobotics
36
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
Ø Goals:
o Learn about several solvable problems
Human-awareRobotics
37
• Is the language generated by a CFG empty?
•
• How to construct a Turing machine for ECFG
Acceptance of CFG
Human-awareRobotics
38
• Is the language generated by a CFG empty?
•
Acceptance of CFG
What about EQCFG?
Human-awareRobotics
39
Put RL and CFL in scope
Human-awareRobotics
40
Undecidability
• 2017/11/2
• Chapter 4.2 in Sipser
Human-awareRobotics
41
Undecidability
Computation
decider
Hilbert’s tenth problem
Recognizable but undecidable languages
Computation
Human-awareRobotics
42
Undecidability
Computation
decider
Hilbert’s tenth problem
Unrecognizable languages?
Computation
Human-awareRobotics
43
Undecidability
Computation
decider
Hilbert’s tenth problem
Unrecognizable languages? complement of D
Computation
Human-awareRobotics
44
Undecidability
Hilbert’s tenth problem
Unrecognizable languages? complement of D
Computation
Ø A language is co-Turing-recognizable if it is the complement of a Turing-recognizable language.
Human-awareRobotics
45
Non Turing-recognizable
Claim: There are an infinite number of languages that are not Turing recognizable
Human-awareRobotics
46
Countably infinite• {1, 2, 3, …} and {2, 4, 6, …}, which one has a bigger size?
one-to-one
onto
Human-awareRobotics
47
Diagonalization• {1, 2, 3, …} and {2, 4, 6, …}, which one has a bigger size?
• Rational numbers is also countable (countably infinite) m/n
Human-awareRobotics
48
Diagonalization• {1, 2, 3, …} and {2, 4, 6, …}, which one has a bigger size?
• Rational numbers is also countable (countably infinite) m/n
Is every infinite setcountable?
Human-awareRobotics
49
Uncountable
Ø If such a mapping exists,For any x in R, there must exist a n such that f(n) = x
Human-awareRobotics
50
Uncountable
Ø If such a mapping exists,For any x in R, there must exist a n such that f(n) = x
Human-awareRobotics
51
Uncountable
x != f(n) for all n
Ø If such a mapping exists,For any x in R, there must exist a n such that f(n) = x
Human-awareRobotics
52
Uncountable
x != f(n) for all n
Ø If such a mapping exists,For any x in R, there must exist a n such that f(n) = x
why doesn’t this work for rational numbers?
Human-awareRobotics
53
Ø Σ* is countable – so is the number of Turing machines!
Ø The set (power set) of languages for Σ* is uncountable
Claim: There are an infinite number of languages that are not Turing recognizable
why?
Non Turing-recognizable
In fact, it is uncountable!
Claim: There are an infinite number of languages that are not Turing recognizable
Human-awareRobotics
54
Ø Σ* is countable – so is the number of Turing machines!
Ø The set (power set) of languages for Σ* is uncountable
Claim: There are an infinite number of languages that are not Turing recognizable
why?
Non Turing-recognizable
In fact, it is uncountable!
Claim: There are an infinite number of languages that are not Turing recognizable
Ø Way more problems cannot be solved (or even recognized) by TMs than those that can!
Human-awareRobotics
55
Hilbert’s tenth problem
any other problems?
Undecidable languages
Let us now return to reality
Ø Findingthemcanhelpusdetermineotherproblems
Human-awareRobotics
56
Undecidable languages
?
Human-awareRobotics
57
is undecidable!
<M>M
Accept
Reject|Loop
D
<M,w>H Accept
Reject
wReject
Accept
Undecidable languages
Human-awareRobotics
58
<M>M
Accept
Reject|Loop
D
<M,<M>>H Accept
Reject
<M>Reject
Accept
Undecidable languagesis undecidable!
Human-awareRobotics
59
<D>D
Accept
Reject|Loop
D
<D,<D>>H Accept
Reject
<D>Reject
Accept
Undecidable languagesis undecidable!
Human-awareRobotics
60
<D>D
Accept
Reject|Loop
D
<D,<D>>H Accept
Reject
<D>Reject
Accept
Undecidable languagesis undecidable!
Noticeanyissues?Checkouttherecursiontheorem6.1
Human-awareRobotics
61
M on w where w = <Mi> H on <Mi, w> where w = <Mj>
D on <M>
Undecidable languages
Human-awareRobotics
62
Outline for today• Decidability
o Regular languages
q Acceptance of DFA
q Acceptance of NFA
q Generation of RE
q Test emptiness of RL
q Test equivalence of DFAs
o Context-free languages
q Acceptance of CFG
q Test emptiness of CFG
• UndecidabilityØ Goals:
o Learn about several solvable problems
o Learn about undecidability and non turing recognizable languages
• Reading assignment for the
next class:
o Sipser Sec. 6.1 - Quiz
link will be sent out;
due date is before the
beginning of the next
class
o Second (and last
project) based on this
o HW6