Computation, Computers, and Programs Cook's Theorem - PowerPoint PPT Presentation

1 / 82
About This Presentation
Title:

Computation, Computers, and Programs Cook's Theorem

Description:

Computation, Computers, and Programs Cook's Theorem. http://www.cs.caltech.edu/courses/cs20/a ... Computers, and Programs Cook's Theorem. http://www.cs. ... – PowerPoint PPT presentation

Number of Views:76
Avg rating:3.0/5.0
Slides: 83
Provided by: csCal
Category:

less

Transcript and Presenter's Notes

Title: Computation, Computers, and Programs Cook's Theorem


1
Term summary
  • Finite automata
  • Deterministice FA
  • Nondeterministic FA, with e-transitions
  • Regular expressions
  • Equivalence of Regex, eNFA, NFA, DFA
  • Pumping Lemma

2
Determistic Finite Automata
3
Transition diagrams
4
A finite automaton
5
Regex-gteNFA
  • Prove by structural induction induction on the
    size of the regular expression
  • Base cases
  • Show the empty RE has an e-NFA
  • Show the e RE has an e-NFA
  • Show the a (symbol) RE has an e-NFA
  • Induction
  • Show (xy) has an e-NFA
  • Show (x y) has an e-NFA
  • Show x has an e-NFA

6
Choice
7
Equivalence classes of RM
8
Myhill-Nerode
9
Regular languages
  • Intuition if a FA accepts a string that is long
    enough, it must repeat a state
  • But it cant remember that the state was repeated
  • So it can be forced to repeat the state over and
    over

10
Pumping lemma
11
Term summary
  • Context-free languages
  • Context-free grammars
  • Grammar simplification
  • Pushdown automata
  • Equivalence of CFGs and PDAs

12
Sentence diagramming derivation trees
13
CFG formal definition
14
Ambiguity
15
Ambiguity
  • A leftmost-derivation is a derivation in which a
    production is always applied to the leftmost
    symbol
  • A rightmost derivation applies to the rightmost
    symbol
  • In general, a string may have multiple left and
    rightmost derivations
  • A grammar in which some word has two parse trees
    is said to be ambiguous

16
Simplification
  • A nonterminal A isuseless iff
  • S ? xAy ? xzy
  • Otherwise, it is useless

17
Eliminating epsilon-productions
18
PDA machine
19
PDA formal definition
20
Balanced parentheses
21
Empty stack vs final state
  • Final state PDA -gt empty stack PDA
  • Simulate whenever the PDA reaches a final state,
    empty the stack
  • Empty stack PDA -gt final state PDA
  • Add a special marker at the bottom of the stack
  • Add transitions delta(q, epsilon, S) ? qf for
    some new state qf in F

22
Compiling a CFG to a PDA
23
Building the PDA from the GNF
24
Building a CFG from a PDA
25
Pumping lemma for CFL
26
Pumping
27
Ogdens lemma
28
Building the path
29
Term summary Turing Machines
  • Turing Machines
  • Executions
  • Diagonalization
  • The halting problem
  • Rices theorem

30
Turing machines
31
Turing machine formal definition
32
Instantaneous descriptions
33
Universal Turing Machines
34
Another diagonalization argument
35
Halting problem
  • Problem determine entries in the matrix
  • Find a recursive machine K, given Mx
  • K halts and accepts if M accepts x
  • K halts and rejects if M does not terminate
  • Is there such a machine?
  • Suppose so, then build a new machine N, that,
    given x, runs K on Mxx and
  • Accepts if K rejects
  • Loops forever of K accepts
  • If K exists, then N does too let N My
  • Ny halts and accepts if Ny does not halt
  • Ny loops forever if Ny halts

36
Halting problem
37
Rices theorem
  • A property P is a set of r.e. languages (so it is
    a set containing sets of strings)
  • For any r.e. language L, we say P(L) is true iff
    L is a member of P
  • Theorem Any nontrivial property of the r.e.
    languages is undecidable
  • Nontrivial means the property is neither always
    true nor always false

38
Proof of Rices theorem
  • Consider a property P
  • Assume P() false, otherwise invert P
  • Since P is nontrivial, there is a language L in P
  • Let ML be a TM accepting L
  • To determine if M halts on input w, build M
  • Ignore the input, and simulate M on w
  • If M halts, then start ML on the input string
  • So P(M) iff M halts on w

39
Term summary alternate models
  • Primitive and partial recursive programs
  • For-programs
  • While-programs
  • Godel numbering
  • The recursion theorem
  • Rices theorem

40
Primitive recursion
41
For-programs
42
For programs and primitive recursion
43
Partial recursive functions (Godel)
  • To capture r.e. computations, we need more
  • A partial recursive computation includes the
    prim-rec computations, plus unbounded minimization

44
Unbounded minimization
45
While-programs
46
Godel numbering
47
Recursion theorem
48
Rices theorem
49
Term summary lambda calculus
  • Syntax
  • Substitution
  • Reduction

50
Lambda calculus
  • A starting point for reasoning about functions
  • The foundation of most functional programming
    languages, including the Lisp and ML languages

51
Single-step evaluation
  • A single-step reduction is just a substitution
  • Called beta-reduction

52
Term summary logic
  • Propositional logic
  • Predicate calculus
  • Godels incompleteness theorem (Rices theorem in
    disguise)

53
Defining the syntax
54
Standard syntax definition
55
Rule table
56
Pierces law
57
Formalizing arithmetic
58
Indexing the arithmetic formulas
59
Fixpoint theorem for arithmetic
60
Godels Incompleteness Theorem
61
Term summary complexity
  • Time space bounded machines
  • NP computations
  • SAT

62
Space-bounded TMs
  • Input tape is read-only
  • The number of storage tapes is an arbitrary
    constant k
  • M is DSPACE(T(n)) if
  • M is deterministic
  • For any input of length n, M scans at most T(n)
    cells on any storage tape
  • NSPACE(T(n)) is the nondeterministic bound

63
Time-bounded TMs
  • All tapes are 2-way infinite
  • M is DTIME(T(n)) if
  • M is deterministic
  • For any input of length n, M takes at most T(n)
    steps
  • M is NTIME(T(n))
  • Nondeterministic case

64
Asymptotic complexity big-Oh notation
65
CNF satisfiability
66
Satisfiability phase transition (Selman)
  • Using modern algorithms, plot how long it takes
    to solve a SAT formula as ratio of
    clauses/literals

67
Term summary
  • Graph theory
  • Undirected, directed graphs
  • Storngly-connected components
  • Solving 2SAT in linear time

68
Formal definition of graphs
69
Path example
70
Graph components
71
DFS Finalize
72
DFS backedges
73
Compute low values
74
Term summary
  • Reductions
  • 3SAT ? Clique
  • 3SAT ? Coloring
  • Cooks theorem
  • NP ? SAT

75
Conflict graph for 3SAT
76
SAT/clique example
77
More NP problems graph coloring
78
Unsatisfiable clause
79
Satisfiable clause
80
Cooks theorem
81
Boolean variables
82
Boolean variables
Write a Comment
User Comments (0)
About PowerShow.com