Closure Properties for Regular Languages

Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION Closure Properties of Regular Languages
Advertisements

CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
Properties of Regular Languages
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Mount Holyoke College 2 Building languages If L is a language, then its complement is L’ = {w |
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
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.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
NFA Closure Properties. NFAs also have closure properties We have given constructions for showing that DFAs are closed under 1.Complement 2.Intersection.
NFA Closure Properties Sipser pages pages NFAs also have closure properties We have given constructions for showing that DFAs are closed under.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
CSCI 2670 Introduction to Theory of Computing August 26, 2004.
CSCI 2670 Introduction to Theory of Computing August 25, 2005.
Regular Expressions CIS 361. Need finite descriptions of infinite sets of strings. Discover and specify “regularity”. The set of languages over a finite.
CSCI 2670 Introduction to Theory of Computing September 1, 2005.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
An Introduction to Rabin Automata Presented By: Tamar Aizikowitz Spring 2007 Automata Seminar.
Recap: Transformation NFA  DFA  s s1s1... snsn p1p1 p2p2... pmpm >...  p1p1  p2p2  pipi s e s1s1 e s2s2 e sisi >
Conversions Regular Expression to FA FA to Regular Expression.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
CIS Automata and Formal Languages – Pei Wang
Foundations of Computing Science
Languages.
Properties of Regular Languages
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
PROPERTIES OF REGULAR LANGUAGES
FORMAL LANGUAGES AND AUTOMATA THEORY
CSE 105 theory of computation
Formal Language & Automata Theory
Formal Language & Automata Theory
Single Final State for NFA
Intro to Theory of Computation
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
CS 154, Lecture 3: DFANFA, Regular Expressions.
COSC 3340: Introduction to Theory of Computation
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
Non Deterministic Automata
Closure Properties of Regular Languages
Properties of Context-Free languages
Closure Properties of Regular Languages
Instructor: Aaron Roth
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
Chapter 1 Regular Language
CSC 4170 Theory of Computation Finite Automata Section 1.1.
CSCI 2670 Introduction to Theory of Computing
NFAs accept the Regular Languages
COSC 3340: Introduction to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

Closure Properties for Regular Languages

Preliminaries So far, we have stated languages in plain English. For example: “all words starting and ending with the character b” The description in plain English can be cumbersome and ambiguous “Regular Expressions” is a formal way to describe languages accepted by finite automata

Regular Expressions Regular Expressions are built upon a subset of the following operations on sets: Union Complementation Intersection Difference Concatenation Kleene star

Union Let L and M two languages, then their union is defined by: L  M = { w : w  L or w  M} Let AL and AM two finite automata accepting L and M respectively: AL: AM: s > s’ > … … Is there a finite automata accepting L  M ?

Union (2) Is there a finite automata accepting L  M ? Yes! AL s e … q > e s’ AM …

Complement Let L be a language over an alphabet , then the complement of L is defined as: LC = { w : w  * and w  L} Let AL be a finite automaton accepting L. Is there a finite automaton accepting LC? b b a a f s q b b P a a

Complement (2) a r r s q q > b b b s q r b > a

Complement (3) Given a language accepted by a finite automaton AL, to find a finite automaton accepting LC we have to do the following steps: 1. Transform AL into an equivalent DFA AL’ 2. Construct a new automaton ALC by taking AL’ and: 2.1 Removing the favorable marks of all favorable states 2.2 Marking as favorable those states that initially had no favorable mark The resulting ALC is a DFA accepting LC

Intersection Let L and be M two languages, then their intersection is defined by: L  M = { w : w  L and w  M} Using DeMorgan’s Laws: (L  M) = (LC  MC)C Thus, there must be a finite automaton accepting (L  M)

Difference Let L and M be two languages, then their difference is defined by: L  M = { w : w  L and w  M} Using DeMorgan’s Laws: (L  M) = L  MC Thus, there must be a finite automaton for (L  M)

Concatenation Let L and M be two languages, then their concatenation is defined by: LM = { wv : w  L and v  M} b b A: B: a a s f a s f b a b b P a How to extend these automata such that the resulting one accepts the concatenation language?

Concatenation (2) AL e s > s’ e AM … e … Steps to obtain a finite automation accepting LM: 1. Make an e-transition from all favorable states in AL to the initial state in AM 2. Unmark all favorable states in AL 3. Remove the mark of the initial state in AM

Kleene Star Let L be a language over an alphabet an alphabet , then we define: L0 = {e} L1 = L L2 = LL L3 = L2L = LLL … Ln = Ln-1L Kleene star of L is defined as: L* = L0  L1  L2  …

Kleene Star (2) An equivalent definition: L* = {w1 w2 … wk : w1, w2, …, wk  L} b A: a s > f a b b P a Obtain a finite automaton accepting L(A)*

Kleene Star (3) e e s AL > s’ e e … e This finite automaton accepts L*

Closure under Set Operations Theorem Theorem. Let L and M two regular languages, then the following languages are also regular: L  M LC L  M L – M LM L* One says that the regular languages are “closed” under these 6 operations