Discrete Mathematics and Logic II. Regular Sets

Similar documents
Discrete Mathematcs and Logic II.

Computability and Complexity

CS 455/555: Finite automata

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

Computability and Complexity

Sri vidya college of engineering and technology

Discrete Mathematics and Logic II. Predicate Calculus

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs)

CS243, Logic and Computation Nondeterministic finite automata

SE 2FA3: Discrete Mathematics and Logic II. Teaching Assistants: Yasmine Sharoda,

Deterministic Finite Automata (DFAs)

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1

CS 455/555: Mathematical preliminaries

Regular Expressions. Definitions Equivalence to Finite Automata

Computability and Complexity

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

CSE 105 THEORY OF COMPUTATION

CS 321 Solutions to Homework 4 Due October 22, 5pm

CS 154, Lecture 3: DFA NFA, Regular Expressions

Computability and Complexity

2. Elements of the Theory of Computation, Lewis and Papadimitrou,

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

Inf2A: Converting from NFAs to DFAs and Closure Properties

Constructions on Finite Automata

Chapter 3. Regular grammars

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Kleene Algebra and Arden s Theorem. Anshul Kumar Inzemamul Haque

Automata Theory for Presburger Arithmetic Logic

Nondeterministic Finite Automata. Nondeterminism Subset Construction

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

3515ICT: Theory of Computation. Regular languages

Computability and Complexity

Properties of Regular Languages (2015/10/15)

Deterministic Finite Automata (DFAs)

CS 208: Automata Theory and Logic

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

Constructions on Finite Automata

Finite Automata and Regular Languages

Regular expressions and Kleene s theorem

Automata and Languages

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Closure Properties of Context-Free Languages. Foundations of Computer Science Theory

Finite Automata and Regular languages

Before we show how languages can be proven not regular, first, how would we show a language is regular?

COM364 Automata Theory Lecture Note 2 - Nondeterminism

More on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41

Finite Automata and Languages

Theory of computation: initial remarks (Chapter 11)

CPS 220 Theory of Computation REGULAR LANGUAGES

Extended transition function of a DFA

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

NOTES ON AUTOMATA. Date: April 29,

The Pumping Lemma and Closure Properties

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Closure under the Regular Operations

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

Lecture 7 Properties of regular languages

CSE 105 THEORY OF COMPUTATION

Finite Automata and Regular Languages (part III)

Proving languages to be nonregular

Computability and Complexity

CS Pushdown Automata

Finite State Automata Design

Outline. Summary. DFA -> Regex. Finish off Regex -> e-nfa -> NFA -> DFA -> Regex Minimization/equivalence (Myhill-Nerode theorem)

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Kolmogorov structure functions for automatic complexity

Applied Computer Science II Chapter 1 : Regular Languages

Properties of Context-Free Languages. Closure Properties Decision Properties

On the Myhill-Nerode Theorem for Trees. Dexter Kozen y. Cornell University

PDL and its relation to PDL

Pushdown Automata. We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata.

Formal Models in NLP

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CONCATENATION AND KLEENE STAR ON DETERMINISTIC FINITE AUTOMATA

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Subset construction. We have defined for a DFA L(A) = {x Σ ˆδ(q 0, x) F } and for A NFA. For any NFA A we can build a DFA A D such that L(A) = L(A D )

Regular Languages. Problem Characterize those Languages recognized by Finite Automata.

CS481F01 Solutions 6 PDAS

Equivalence of DFAs and NFAs

Visibly Linear Dynamic Logic

Nondeterministic Finite Automata

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

CSE 20 DISCRETE MATH WINTER

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017

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

Regular Expressions Kleene s Theorem Equation-based alternate construction. Regular Expressions. Deepak D Souza

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

Equational Theory of Kleene Algebra

CHURCH SYNTHESIS PROBLEM and GAMES

DD2371 Automata Theory

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

Computational Theory

Solutions. CS 2800 Fall 2017 Final exam Friday, December 8. NetID: 1. Modular arithmetic [9 pts]

CSE 105 THEORY OF COMPUTATION

Advanced Automata Theory 2 Finite Automata

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

CS 154 Introduction to Automata and Complexity Theory

BASIC MATHEMATICAL TECHNIQUES

Transcription:

Discrete Mathematics and Logic II. Regular Sets SFWR ENG 2FA3 Ryszard Janicki Winter 24 Acknowledgments: Material based on Automata and Computability by Dexter C. Kozen (Chapter 4). Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets / 2

Induction to prove that an automaton accepts a set Regular sets: A = {x {, } x represents a multiple of three in binary} r r r2 Does this automaton accept exactly the above set A? Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 2 / 2

Induction to prove that an automaton accepts a set Preliminaries for answering the question: #x denote the number represented by string x in binary The question can be formalised as follows: Show that for any string x in {, }, we have δ (r, x) = r i #x mod 3 δ (r, x) = r i #x mod 3 δ (r, x) = r 2 i #x 2 mod 3 Shortly δ (r, x) = r (#x mod 3) Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 3 / 2

Induction to prove that an automaton accepts a set Preliminaries for answering the question (continued): r r r2 We have #(xb) = 2(#x) + b for b a bit (i.e., or ) we see that for any state r q {r, r, r 2 } (i.e., q {,, 2}) and input symbol b {, }, we have δ (r q, b) = r ((2q+b) mod 3) Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 4 / 2

Induction to prove that an automaton accepts a set Answering the question: Use the inductive denition of δ to show δ (r, x) = r (#x mod 3) by induction on x Base case: δ (r, ɛ) = r (#ɛ mod 3) Induction step : δ (r, xb) = r (#xb mod 3) Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 5 / 2

Some Closure Properties of Regular Sets Motivation: Let A, B Σ such that A and B regular sets. are A B, A B, and A regular sets? Are AB and A also regular? Let f be an n-ary operation on S and T S. T is closed under f, if (t, t 2,, t n t, t 2,, t n T : f (t, t 2,, t n ) T ) Idea: From the automata that accept A and B, can we built automata that accept the above sets?!!!! We need to devise a way to combine automata Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 6 / 2

Some Closure Properties of Regular Sets (The Product Construction) If we assume that A and B are regular M = (Q, Σ, δ, s, F ) M 2 = (Q 2, Σ, δ 2, s 2, F 2 ) with A = L(M ) and B = L(M 2 ) To show that A B is regular, we will build an automaton M 3 such that L(M 3 ) = A B How does M 3 work (Intuitively)? Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 7 / 2

Some Closure Properties of Regular Sets (The Product Construction) Let M 3 = (Q 3, Σ, δ 3, s 3, F 3 ) where Q 3 = Q Q 2 = {(p, q) p Q q Q 2 } F 3 = F F 2 s 3 = (s, s 2 ) δ 3 : Q 3 Σ Q 3 dened by δ 3 ((p, q), a) = (δ (p, a), δ 2 (q, a)) The automaton M 3 is called the product of M and M 2 Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 8 / 2

Some Closure Properties of Regular Sets (The Product Construction) Lemma ( ( ) ) x x Σ : δ3 ((p, q), x) = δ (p, x), δ2 (q, x) Proof. By induction on x Base case: For x ( = ɛ, do we have ) δ 3 ((p, q), ɛ) = δ (p, ɛ), δ2 (q, ɛ)??? Induction step: Assuming the lemma holds for x Σ, can we show that it holds for xa, where a Σ??? Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 9 / 2

Some Closure Properties of Regular Sets (Closure under intersection) Theorem L(M 3 ) = L(M ) L(M 2 ) Proof. For all x Σ x L(M 3 ) Denition of acceptance δ 3 (s 3, x) F 3 Denition of s 3 and F 3 Lemma x L(M ) L(M 2 ) Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets / 2

Some Closure Properties of Regular Sets (Closure under complement) Regular sets: A = {x {, } x represents a multiple of three in binary} r r r2 A = {x {, } x DOES NOT represent a multiple of three in binary} r r r2 Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets / 2

Some Closure Properties of Regular Sets (Closure under union) We have showed that regular sets are closed under intersection and complement We have A B = ( A B ) Then regular sets are closed under We get an automaton for A B that looks exactly like the product automaton for A B, except that the accept states are F 3 = (F Q 2 ) (Q F 2 ) instead of F F 2 Ryszard Janicki Discrete Mathematics and Logic II. Regular Sets 2 / 2