Computability, etc. - PowerPoint PPT Presentation

About This Presentation
Title:

Computability, etc.

Description:

Computability, etc. Recap. Present homework. Grammar and machine equivalences. Turing history Homework: Equivalence assignments. Presentation proposals, preparation. – PowerPoint PPT presentation

Number of Views:110
Avg rating:3.0/5.0
Slides: 31
Provided by: Jeani238
Category:

less

Transcript and Presenter's Notes

Title: Computability, etc.


1
Computability, etc.
  • Recap. Present homework. Grammar and machine
    equivalences. Turing history
  • Homework Equivalence assignments. Presentation
    proposals, preparation. Keep up on postings.

2
Recap
  • Define different types of machines.
  • abstract machines
  • Machines are fed (my term) strings in a specified
    alphabet.
  • Machines scan the strings and say yes or no
    (accept or reject)
  • Each machine accepts strings in a certain
    pattern. We call the set of strings in that
    pattern a language.

3
Recap
  • Repeat a language is a SET of strings.
  • This set may be finite or infinite.
  • the empty set is a language, with no actual
    memberselements
  • This set may or may not include the empty string

4
Homework
  • Define a FSA, alphabet A,blank, that accepts
    strings with even number of As. Define a second
    FSA that accepts strings with an odd number of
    As.
  • Define a PDA, alphabet A, blank,(, ), that
    accepts A, AA, (AA), (A(AA)) etc. NOT A ,
    not unbalanced ( and ). HOLD OFF ON THIS ONE
    SEE HOMEWORK!
  • Define TM that subtracts 1. If input is zero,
    then tape is cleared.
  • Define Turing machine to subtract two numbers a
    and b, represented by a1 1s followed by a blank
    followed by b1 1s
  • if (agtb), put (a-b) 1 1s on the tape
  • if altb, leave zero 1s in the tape OR return
    something else if altb ???

5
Turing machine
  • can perform a function or
  • define same type of machine plus accepting and
    rejecting states and say a TM defines a language
    L if strings in the language L make the machine
    stop in an accepting state and strings NOT in L
    stop in a rejecting state.

6
Decidability
  • A TM that always halts is called a decider.
  • TM can keep going, that is, loop
  • A language is Turing-decidable if a decider TM
    recognizes it.

7
Univeral Turing Machine
  • Consider the input ltM,wgt where M is some
    encoding for a Turing Machine and w is a string.
  • Claim it is possible to define a TM U such that
    U simulates M on w! This is analogous to a
    general purpose computer.
  • may have contributed to idea of stored program
    computing

8
Halting problem
  • Consider a universal Turing machine U.
  • Now, if a M loops on a w, so would U.
  • U is not a decider!
  • Put another way the setATM ltM,wgt M is a TM
    and M accepts w is undecidable. It can be
    proven that there does not exist a TM that always
    halts, that says yes or no on all inputs ltM,wgt.

9
Recap
  • There are different definitions/constructions/conc
    epts that define the same set of functions or
    languages.
  • So-called recursive functions (more next)
    correspond to computable (TM) functions.
  • Languages defined by a Regular Expression (look
    it up) are languages recognized by a FSA.
  • Languages defined by a Context Free Grammar (look
    it up) are languages recognized by a PDA.
  • Some proofs of equivalence are easy and some more
    substantial.
  • Will not focus on proofs, BUT these are possible
    topics for presentations.

10
Recursive functions
  • Define a set of functions by specifying a starter
    set and then ways of adding new functions.
    Functions can be on vectors. Stick to integers.
  • Starter set
  • identify function and projection I(x) x and
    Pi(x1,x2,xn) xi
  • Add 1 A(x) x1
  • Constant Ck(x) k

11
Ways to add
  • Composition if F and G are recursive (and F
    produces the right size vector, then the
    composition G F (first you do F and then G to the
    result) is recursive.
  • Primitive recursion Given functions F and G,
    define HH(0,x1, x2, , xn) F(x1, x2, xn)
    andH(y1, x1, x2, xn) G(y,x1, ,xn,
    H(x1,x2,,xn))
  • Minimal inverse Given a function F, then the
    function H defined by H(x) y such that F(y) x
    and y is the smallest integer such that that is
    true.

12
Equivalence!
  • If there exists a TM for a function F, then F is
    recursive.
  • If a function F is recursive (that is, in this
    set), then you can define a TM that performs F.

13
Grammars
  • A grammar G is a
  • set of symbols, divided in final symbols and
    auxiliary symbols
  • (finite) set of production rules of the form
    string of symbols gt string of symbols
  • final symbols have no production rules of the
    formf gt
  • In this exposition, we view certain strings of
    letters as single symbols.
  • one auxiliary is called the started symbol s
  • The language generated (defined by) G is all the
    strings of final symbols generated by a sequence
    starting with s

14
Example
  • Think of auxiliaries as parts of speech and final
    symbols as (whole) words
  • Let s be sentencevp be verb phrasenp be noun
    phrasen be nounv be verbdo be direct
    objectadj be adjectiveadv be adverb

15
Example
  • Think of parts of speechs gt np vpnp gt adj n
    nvp gt v v adv v do v do advdo gt nn gt
    boy girl dog cheesev gt walks runs
    jumps eatsadj gt short tall spottedadv gt
    fast slowly

16
Try
  • To construct the parse tree fortall girl
    walksshort boy eats cheese slowly

17
Context free grammar
  • Production rules are of the formauxiliary
    symbol gt string of symbols

18
So what isn't CFG?
  • There also can be rules of the formaPb gt .
  • where P is an auxiliary symbol. Think of it as P
    in the context of a and b produces something. So
    this is NOT context-free.

19
Example CFG
  • S gt TT gt aT gt a TT gt (T)
  • What language does this produce (list the terms)?

20
Regular grammar
  • All rules are of the form
  • auxiliary symbol gt final symbol or
  • auxiliary symbol gt single final symbol followed
    by an auxiliary symbol

21
  • So a regular grammar is CFG!

22
Regular grammars FSA
  • Any language accepted by a regular grammar is
    accepted by a FSA and
  • Any language accepted by a FSA is accepted by a
    regular grammar.
  • Said a different way
  • If a language L is accepted by a regular grammar
    G, we can define a FSA that accepts it AND if a
    language L is accepted by a FSA, we can define a
    regular grammar that accepts it.

23
Informal proof
  • Have a Grammar G with production rules of the
    accepted form.
  • Define a FSA with one state for each auxiliary
    symbol, plus one more state. Make the initial
    state the one corresponding to the initial
    symbol. Add one more state, F and let it be the
    final state.
  • If PgtaQ, where P and Q are auxiliaries and a is
    a symbol in the final alphabet, make an edge from
    P to Q, with label a.
  • If Pgta, make an edge going from P to F with
    label a.

24
Cont.
  • Given a FSA, define a grammar with auxiliary
    symbols corresponding to the states. The initial
    symbol is the one corresponding to the initial
    state.
  • Add production rules PgtaQ for all edges from P
    to Q.
  • Change all production rules PgtaF to Pgta.

25
Closure
  • Regular languages are closed with respect to
    various operations, including concatenation.
  • If M is a regular language and N is a regular
    language, then we can define MN is the language
    made up of all the strings of the form sm sn
    where sn where sm is in M and sn is in N. Then MN
    also is regular.

26
Closure
  • If M and N are regular languages then so is the
    union of M and N.
  • This is defined as the set of strings that are in
    M or are in N (or both).
  • This also is a regular language.

27
Regular expressions
  • Yet another equivalent definition!
  • A regular expression over an alphabet is a
    pattern defined using letters from the alphabet
    combined using notation for union, concatenation,
    wild card, counts.
  • The regular expession defines a set of strings,
    that is, a language

28
CFG andPDA
  • Same equivalence here.

29
Turing history
  • Invented what came to be called Turing
    machines. Proved various things about
    them, including Halting problem
  • Worked in Bletchley Park during WWII built a
    machine to help decode German codes (codes
    changed). Given medal (in secret)
  • Worked in general area, including spending time
    at Princeton with Van Neumann, others. Wrote
    papers on computer chess, notion of Turing test
  • Arrested convicted for homosexual acts. Made to
    take hormone drugs. Appeared to be okay
  • Committed suicide

30
Homework
  • Pick 1 Please think about it first instead of or
    before trying to look it up. Informal proofs are
    okay.
  • CFG and PDA equivalence
  • If you believe this, then there does exist a PDA
    for the homework problem.
  • Regular expression and (either) FSA or Regular
    grammar equivalence
  • Possibilities for presentation topics in Turing
    work, history
  • Keep up postings
  • Shai videos
Write a Comment
User Comments (0)
About PowerShow.com