CS 133 : Automata Theory and Computability

Similar documents
CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

Theory of Computation

COSE212: Programming Languages. Lecture 1 Inductive Definitions (1)

Theory of Computation (I) Yijia Chen Fudan University

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

COM364 Automata Theory Lecture Note 2 - Nondeterminism

Theory of Computation

Automata: a short introduction

2017/08/31 Chapter 1.2 & 1.3 in Sipser Ø Announcement:

FABER Formal Languages, Automata. Lecture 2. Mälardalen University

Theory of Computer Science

Closure Properties of Regular Languages

Nondeterministic Finite Automata and Regular Expressions

Closure under the Regular Operations

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS Automata, Computability and Formal Languages

CS 121, Section 2. Week of September 16, 2013

Formal Languages, Automata and Models of Computation

Finite Automata and Regular Languages

CMSC 330: Organization of Programming Languages. Regular Expressions and Finite Automata

CMSC 330: Organization of Programming Languages

C1.1 Introduction. Theory of Computer Science. Theory of Computer Science. C1.1 Introduction. C1.2 Alphabets and Formal Languages. C1.

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

Exam 1 CSU 390 Theory of Computation Fall 2007

Nondeterministic Finite Automata

Intro to Theory of Computation

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Recap from Last Time

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

Author: Vivek Kulkarni ( )

TDDD65 Introduction to the Theory of Computation

Two-Way Automata and Descriptional Complexity

Equivalence of DFAs and NFAs

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Le rning Regular. A Languages via Alt rn ting. A E Autom ta

CS 154. Finite Automata, Nondeterminism, Regular Expressions

Lecture 3: Nondeterministic Finite Automata

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Automata Theory Final Exam Solution 08:10-10:00 am Friday, June 13, 2008

EXAMPLE CFG. L = {a 2n : n 1 } L = {a 2n : n 0 } S asa aa. L = {a n b : n 0 } L = {a n b : n 1 } S asb ab S 1S00 S 1S00 100

CSCI 2670 Introduction to Theory of Computing

Section 1.3 Ordered Structures

Topics in Timed Automata

CSCI 340: Computational Models. Regular Expressions. Department of Computer Science

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

CS 154, Lecture 3: DFA NFA, Regular Expressions

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Chapter 4. Regular Expressions. 4.1 Some Definitions

1 Alphabets and Languages

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

In English, there are at least three different types of entities: letters, words, sentences.

CFG Simplification. (simplify) 1. Eliminate useless symbols 2. Eliminate -productions 3. Eliminate unit productions

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

CS 455/555: Finite automata

Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties

How do regular expressions work? CMSC 330: Organization of Programming Languages

The Probability of Winning a Series. Gregory Quenell

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

COMP4141 Theory of Computation

CSEP 590 Data Compression Autumn Arithmetic Coding

Lecture 7 Properties of regular languages

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Regular Expressions [1] Regular Expressions. Regular expressions can be seen as a system of notations for denoting ɛ-nfa

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

UNIT-I. Strings, Alphabets, Language and Operations

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

Chapter Five: Nondeterministic Finite Automata

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

CS311 Computational Structures Regular Languages and Regular Expressions. Lecture 4. Andrew P. Black Andrew Tolmach

Theory of Computation (II) Yijia Chen Fudan University

Context Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages

Introduction to Formal Languages, Automata and Computability p.1/51

download instant at Assume that (w R ) R = w for all strings w Σ of length n or less.

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro Diniz

More Properties of Regular Languages

2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a

CS375 Midterm Exam Solution Set (Fall 2017)

Intro to Theory of Computation

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

Critical CS Questions

Figure 1: NFA N. Figure 2: Equivalent DFA N obtained through function nfa2dfa

CS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)

Theory of Computation Lecture 1. Dr. Nahla Belal

Semigroup presentations via boundaries in Cayley graphs 1

Finite-State Machines (Automata) lecture 12

TAFL 1 (ECS-403) Unit- III. 3.1 Definition of CFG (Context Free Grammar) and problems. 3.2 Derivation. 3.3 Ambiguity in Grammar

Algebraic Approach to Automata Theory

CDM Closure Properties

CSE 105 THEORY OF COMPUTATION

CS21 Decidability and Tractability

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

Computability Theory

Computer Sciences Department

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Transcription:

CS 133 : Automata Theory and Computability Lecture Slides 1 Regular Languages and Finite Automata Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University of the Philippines, Diliman nshernandez@dcs.upd.edu.ph Day 3 1 Reference: Intro to the Theory of Computation (2nd Ed), Sipser

Regular Languages and Finite Automata Minimization of DFA

Regular Languages and Finite Automata Minimization of DFA

Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state.

Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state. If two states are not equivalent, then we say they are distinguishable.

Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state. If two states are not equivalent, then we say they are distinguishable. That is, state p is distinguishable from state q if there is at least one string ω such that one of ˆδ(p, ω) and ˆδ(q, ω) is accepting, and the other is not accepting.

Equivalence of States We say that states p and q are equivalent if for all input strings ω, ˆδ(p, ω) is an accepting state if and only if ˆδ(q, ω) is an accepting state. If two states are not equivalent, then we say they are distinguishable. That is, state p is distinguishable from state q if there is at least one string ω such that one of ˆδ(p, ω) and ˆδ(q, ω) is accepting, and the other is not accepting.

Table of state inequivalences

Minimum-state DFA

3. for all q, q, r, r Q M and a alphabet(m ), if (q, r) X, (q, a, q) T M and (r, a, r) T M, then (q, r ) X. Another Example APTER Minimize 3. REGULAR the ff DFA: LANGUAGES 17 Start A 0 B 1 E 0, 1 1 F 0 1 0 0 1 C 0, 1 D n M = M. Next, we let X be the least subset of Q M Q M 1. A M (Q M A M ) X; 2. (Q M A M ) A M X; such that:

Since {B, D} Z and [δ M (B, 1)] = [E] = {E, F}, we have Another Example ( B, D, 1, E, F ) T N. APTER Minimize 3. REGULAR the ff DFA: LANGUAGES 17 Since {E, F} Z and [δ M (E, 0)] = [F] = {E, F}, we have ( E, F, 0, E, F ) T 0 1 0, 1 Start A N. B E F 0 1 Since {E, F} Z and [δ M (E, 1)] = [F] = {E, F}, we have 1 0 0 1 ( E, F, 1, E, F ) T N. hus our DFA N Cis: 0, 1 D n M = M. Next, we let X be the least subset of Q M Q M such that: Start A 1. A M (Q M A M ) X; 2. (Q M A M ) A M X; 1 C 0 1 B, D 0, 1 0 E, F 0, 1 3. for all q, q, r, r Q M and a alphabet(m ), if (q, r) X, (q, a, q) T M and (r, a, r) T M, then (q, r ) X.

Regular Languages and Finite Automata Minimization of DFA

A language is called a regular language if some finite automaton recognizes it.

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages.

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}.

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}.

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}.

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3})

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B =

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3}

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B =

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B = {a1, a2, a3, b1, b2, b3}

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B = {a1, a2, a3, b1, b2, b3} A =

A language is called a regular language if some finite automaton recognizes it. Regular Operations Let A and B be languages. Union: A B = {x x A or x B}. Concatenation: A B = {xy x A and y B}. Star: A = {x 1 x 2 x k k 0 and each x i A}. Example (A = {a, b} and B = {1, 2, 3}) A B = {a, b, 1, 2, 3} A B = {a1, a2, a3, b1, b2, b3} A = {ε, a, b, aa, ab, ba, bb, aaa, aab, aba, abb, baa, bab, bba, bbb, }

A collection of objects is closed under some operation if applying that operation to members of the collection returns an object still in the collection.

A collection of objects is closed under some operation if applying that operation to members of the collection returns an object still in the collection. Theorem The class of regular languages is closed under the union operation. Proof.

A collection of objects is closed under some operation if applying that operation to members of the collection returns an object still in the collection. Theorem The class of regular languages is closed under the union operation. Proof. Theorem The class of regular languages is closed under the concatenation operation. Theorem The class of regular languages is closed under the star operation.

Questions? See you next meeting!