1 Assignment #1 is due on Friday. Any questions?.

Slides:



Advertisements
Similar presentations
Specifying Languages Our aim is to be able to specify languages for use in the computer. The sketch of the FSA is easy for us to understand, but difficult.
Advertisements

Formal Language, chapter 4, slide 1Copyright © 2007 by Adam Webber Chapter Four: DFA Applications.
Deterministic Finite Automata (DFA)
Finite Automata CPSC 388 Ellen Walker Hiram College.
COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou.
Formal Language, chapter 9, slide 1Copyright © 2007 by Adam Webber Chapter Nine: Advanced Topics in Regular Languages.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Languages and Finite Automata or how to talk to machines...
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
1 Regular Languages Finite Automata eg. Supermarket automatic door: exit or entrance.
Finite Automata Costas Busch - RPI.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
CPSC 388 – Compiler Design and Construction
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
1 Proof of the Day: Let P= {(b, acbb), (aac, a), (b, ca)}. 1.Prove that P has a match. 2. Find Q which is P encoded in binary. 3.What match of Q corresponds.
1 Syntax Specification Regular Expressions. 2 Phases of Compilation.
CS-5800 Theory of Computation II PROJECT PRESENTATION By Quincy Campbell & Sandeep Ravikanti.
By: Er. Sukhwinder kaur.  What is Automata Theory? What is Automata Theory?  Alphabet and Strings Alphabet and Strings  Empty String Empty String 
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Lecture # 3 Chapter #3: Lexical Analysis. Role of Lexical Analyzer It is the first phase of compiler Its main task is to read the input characters and.
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
1 For each language, give a regular expression that generates the language and a DFA that accepts it. L 1 = { w  {0, 1}* : has both 00 and 11 as substrings}
Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided by author Slides edited for.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Problem of the Day: Factor (ab) k as xyz in all ways such that y ≠ ε.
1 Prove the following languages over Σ={0,1} are regular by giving regular expressions for them: 1. {w contains two or more 0’s} 2. {|w| = 3k for some.
CSCI 2670 Introduction to Theory of Computing August 26, 2004.
CSCI 2670 Introduction to Theory of Computing August 25, 2005.
2. Regular Expressions and Automata 2007 년 3 월 31 일 인공지능 연구실 이경택 Text: Speech and Language Processing Page.33 ~ 56.
Lesson No.6 Naveen Z Quazilbash. Overview Attendance and lesson plan sharing Assignments Quiz (10 mins.). Some basic ideas about this course Regular Expressions.
1 String v is a prefix of w if w= v y for some string y. String v is a suffix of w if w= x v for some string x. String v is a substring of w if there are.
CMSC 330: Organization of Programming Languages Finite Automata NFAs  DFAs.
Specifying Languages Our aim is to be able to specify languages for use in the computer. The sketch of an FSA is easy for us to understand, but difficult.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 For each language, give a DFA that accepts it. L 1 = { w  {a, b}* : w at most 2 a’s} L 2 = { w  {0, 1}* : has both 00 and 11 as substrings} L 3 = {
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
Recap: Transformation NFA  DFA  s s1s1... snsn p1p1 p2p2... pmpm >...  p1p1  p2p2  pipi s e s1s1 e s2s2 e sisi >
Chapter 2 Scanning. Dr.Manal AbdulazizCS463 Ch22 The Scanning Process Lexical analysis or scanning has the task of reading the source program as a file.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Conversions Regular Expression to FA FA to Regular Expression.
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture 1 Ahmed Ezzat.
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
CS412/413 Introduction to Compilers Radu Rugina Lecture 3: Finite Automata 25 Jan 02.
1 Let S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 }. (a) List the elements of S for n= 1, 2, and 3. (b) Prove that the set S.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
Lecture Three: Finite Automata Finite Automata, Lecture 3, slide 1 Amjad Ali.
Finite automate.
Languages.
L1= { w  {a,b}* : w consists of all strings that begin with an even number of a's followed by an odd number of b's. } L2= { w  {a,b}* : the number of.
Deterministic Finite Automata
Finite Automata & Regular Languages
Deterministic Finite Automata
Assume that p, q, and r are in
Chapter Four: DFA Applications
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
CSE 105 theory of computation
Presentation transcript:

1 Assignment #1 is due on Friday. Any questions?

2 Regular Languages over Alphabet Σ: [Basis] 1. Φ and {σ} for each σ  Σ are regular languages. [Inductive step] If L 1 and L 2 are regular languages, then so are: 2. L 1 ۰ L 2, 3. L 1 ⋃ L 2, and 4. L 1 *.

3 Regular expressions over Σ: [Basis] 1. Φ and σ for each σ  Σ are regular expressions. [Inductive step] If α and β are regular expressions, then so are: 2. ( αβ) 3. (α ⋃ β) and 4. α * Note: Regular expressions are strings over Σ ⋃ { (, ), Φ, ⋃, * } for some alphabet Σ.

4 Precedence of Operators Exponents Multiplication Addition Kleene star Concatenation Union highest ⇩ lowest

5 Prove the following languages over Σ={0,1} are regular by giving regular expressions for them: 1. {w: w has odd length} 2. {w: w contains 0011} 3. {w: w does not contain 01} 4. {w: w starts and ends with the same symbol (|w| ≥ 1)}

6 TUTORIAL: L = { w an element of {a,b}* : w has both baa and aaba as a substring }. (a|b)*baa(a|b)*aaba(a|b)*|(a|b)*aaba(a|b)*baa(a|b)* MISSING: aabaa, baaba, … See home page for link to regular expression tutorial

7 Deterministic Finite Automata Given a language L, the language recognition problem is: Given an input string w, is w in L? Answer: yes or no. DFA’s provide linear time language recognition algorithms for regular languages (languages which can be defined by a regular expression). This class introduces DFA’s, describes how they work, and defines the mathematical notation used to talk about them.

8

9 To strip comments from a program: Picture by David Eppstein.

10 Applications of DFA’s or DFA-like code: [ ] Compilers and other language-processing systems- to divide an input program into tokens like identifiers, constants, and keywords and to remove comments and white space. Typed commands- the command language can be quite complex, almost like a little programming language. Speech-processing and other signal-processing systems- to transform an incoming signal.

11 More Applications [ ] Text processors- to search a text file for strings that match a given pattern. This includes most versions of Unix tools like awk, egrep, and Procmail, along with a number of platform-independent systems such as MySQL. Controllers- to track the current state of a wide variety of finite-state systems, from industrial processes to video games, implemented in hardware or in software.

12 A Deterministic Finite Automaton (DFA) M is defined to be a quintuple (K, Σ, δ, s, F) where K is a finite set of states, Σ is an alphabet, δ is a function from K x Σ to K, s  K is the start state, and F  K is the set of final states.

13 Some examples: 1. {w: w has odd length} 2. {w: w contains 0011} 3. {w: w does not contain 01} 4. {w: w starts and ends with the same symbol (|w| ≥ 1)}

14 M= (K, Σ, δ, s, F): A configuration of a M is an element of K x Σ *. For σ  Σ, configuration (q, σ w ) ├ (r, w) [(q, σ w ) yields in one step (r, w)] if δ(q, σ) = r. The notation ├ * means yields in zero or more steps.

15 M= (K, Σ, δ, s, F): DFA M accepts input w if and only if (s, w) ├ * (f, ε) for some f  F. L(M), the language accepted by M is { w  Σ * : (s, w) ├ * (f, ε) for some f  F}.

16 L 1 = { w  {a, b}* : w begins with aab} L 2 = { w  {0, 1}* : has both 00 and 11 as substrings} L 3 = { w  {a, b}* : w ends with abab} L 4 = { w  {0, 1}* : the number of 0’s in w is even and the number of 1’s is congruent to 1 modulo 3} L 5 = { w  {a, b}* : w contains abaab}

17 What language does this DFA accept?