111 Computability, etc. Recap. Present homework. Grammar and machine equivalences. Turing history Homework: Equivalence assignments. Presentation proposals,

Slides:



Advertisements
Similar presentations
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Advertisements

Chapter 5 Pushdown Automata
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
The Recursion Theorem Sipser – pages Self replication Living things are machines Living things can self-reproduce Machines cannot self reproduce.
The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Introduction to Computability Theory
Decidable languages Sipser 4.1 (pages ). CS 311 Mount Holyoke College 2 Hierarchy of languages All languages Turing-recognizable Turing-decidable.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
1 Reverse of a Regular Language. 2 Theorem: The reverse of a regular language is a regular language Proof idea: Construct NFA that accepts : invert the.
Homework #9 Solutions.
1 Foundations of Software Design Lecture 23: Finite Automata and Context-Free Grammars Marti Hearst Fall 2002.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Regular Expressions and Automata Chapter 2. Regular Expressions Standard notation for characterizing text sequences Used in all kinds of text processing.
February 4, 2015CS21 Lecture 131 CS21 Decidability and Tractability Lecture 13 February 4, 2015.
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
Problem of the DAY Create a regular context-free grammar that generates L= {w  {a,b}* : the number of a’s in w is not divisible by 3} Hint: start by designing.
Turing Machines A more powerful computation model than a PDA ?
1 111 Computability Computability Administration Brief introduction to course Homework: Obtain book. Sign on to Moodle: introduce.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Computability Turing machines for functions. Recursive functions. Homework: Modify class example for addition to produce contiguous 1s. Construct TM for.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Decidability A decision problem is a problem with a YES/NO answer. We have seen decision problems for - regular languages: - context free languages: [Sections.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
111 Discrete Mathematics Computability Brief introduction to computable functions, recursive functions, etc. Jeanine Meyer.
1 111 Computability, etc. Midterm review. Turing machines. Finite state machines. Push down automata. Homework: FSA, PDA, TM problems (can work in teams)
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
A sentence (S) is composed of a noun phrase (NP) and a verb phrase (VP). A noun phrase may be composed of a determiner (D/DET) and a noun (N). A noun phrase.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
Computabilty Computability Finite State Machine. Regular Languages. Homework: Finish Craps. Next Week: On your own: videos +
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Computability Review homework. Regular Operations. Nondeterministic machines. NFSM = FSM Homework: By hand, build FSM version of specific NFSM. Try to.
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Computability Go over homework problems. Godel numbering. Homework: prepare for midterm.
Computability Review homework. Video. Variations. Definitions. Enumerators. Hilbert's Problem. Algorithms. Summary Homework: Give formal definition of.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Theory of Languages and Automata By: Mojtaba Khezrian.
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
CS 154 Formal Languages and Computability May 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
CSE 105 theory of computation
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
Turing Machines Acceptors; Enumerators
Jaya Krishna, M.Tech, Assistant Professor
Decidable Languages Costas Busch - LSU.
CS21 Decidability and Tractability
Decidability and Tractability
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
CSE 105 theory of computation
Automata, Grammars and Languages
Presentation transcript:

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

111 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.

111 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 members==elements This set may or may not include the empty string

111 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, A+A, (A+A), (A+(A+A)) 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 a+1 1s followed by a blank followed by b+1 1s –if (a>=b), put (a-b) + 1 1s on the tape –if a<b, leave zero 1s in the tape OR return something else if a<b ???

111 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.

111 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.

111 Univeral Turing Machine Consider the input 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

111 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 set ATM = { | 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.

111 Recap There are different definitions/constructions/concepts 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.

111 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 P i (x1,x2,…xn) = xi Add 1: A(x) = x+1 Constant: C k (x) = k

111 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 H H(0,x1, x2, …, xn) = F(x1, x2, … xn) and H(y+1, 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.

111 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.

111 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 => string of symbols final symbols have no production rules of the form f => … 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

111 Example Think of auxiliaries as parts of speech and final symbols as (whole) words Let s be sentence vp be verb phrase np be noun phrase n be noun v be verb do be direct object adj be adjective adv be adverb

111 Example Think of parts of speech s => np vp np => adj n | n vp => v | v adv | v do | v do adv do => n n => boy | girl | dog | cheese v => walks | runs | jumps | eats adj => short | tall | spotted adv => fast | slowly

111 Try To construct the parse tree for tall girl walks short boy eats cheese slowly

111 Context free grammar Production rules are of the form auxiliary symbol => string of symbols

111 So what isn't CFG? There also can be rules of the form aPb => …. 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.

111 Example CFG S => T T => a T => a + T T => (T) What language does this produce (list the terms)?

111 Regular grammar All rules are of the form: auxiliary symbol => final symbol or auxiliary symbol => single final symbol followed by an auxiliary symbol

111 So a regular grammar is CFG!

111 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.

111 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 P=>aQ, 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 P=>a, make an edge going from P to F with label a.

111 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 P=>aQ for all edges from P to Q. Change all production rules P=>aF to P=>a.

111 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 s m s n where s n where s m is in M and s n is in N. Then MN also is regular.

111 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.

111 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

111 CFG and PDA Same equivalence here.

111 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

111 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