Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.

Slides:



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

Properties of Regular Sets
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
YES-NO machines Finite State Automata as language recognizers.
Erik Jonsson School of Engineering and Computer Science CS 4384 – 001
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
CS21 Decidability and Tractability
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 |
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.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
1 Languages and Finite Automata or how to talk to machines...
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections: September 1, 2006.
Fall 2005 CSE 467/567 1 Formal languages regular expressions regular languages finite state machines.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Topics Automata Theory Grammars and Languages Complexities
1.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
Finite-State Machines with No Output
1 Theory of Digital Computation Course material for undergraduate students on IT Department of Computer Science University of Veszprem Veszprem, Hungary.
Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2006.
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: 
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
Regular Expressions CIS 361. Need finite descriptions of infinite sets of strings. Discover and specify “regularity”. The set of languages over a finite.
Finite Automata.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Lecture 5: Finite Automata 虞台文 大同大學資工所 智慧型多媒體研究室.
Modeling Computation: Finite State Machines without Output
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
Formal Languages Finite Automata Dr.Hamed Alrjoub 1FA1.
CS 461 – Sept. 2 Review NFA  DFA Combining FAs to create new languages –union, intersection, concatenation, star –We can basically understand how these.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Conversions Regular Expression to FA FA to Regular Expression.
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
Theory of Languages and Automata By: Mojtaba Khezrian.
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
Costas Busch - LSU1 Deterministic Finite Automata And Regular Languages.
Theory of Languages and Automata By: Mojtaba Khezrian.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
Lecture Three: Finite Automata Finite Automata, Lecture 3, slide 1 Amjad Ali.
Languages.
Lecture2 Regular Language
Closure Properties of Regular Languages
Natural Language Processing - Formal Language -
Chapter 2 Finite Automata
Theory of Computation Lecture # 9-10.
COSC 3340: Introduction to Theory of Computation
REGULAR LANGUAGES AND REGULAR GRAMMARS
CSE322 Finite Automata Lecture #2.
Closure Properties for Regular Languages
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
COSC 3340: Introduction to Theory of Computation
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
CS 350 — Fall 2018 gilray.org/classes/fall2018/cs350/
Closure Properties of Regular Languages
Chapter 1 Regular Language
What is it? The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled.
CSCE 355 Foundations of Computation
Finite Automata Part Three
Presentation transcript:

Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation (. ) and Kleene star ( * ). Example : ( { a } [ { b } ) * { a } { a } ( { a } [ { b } ) * [ ( { a } [ { b } )* { b } { b } ( { a } [ { b } ) * [Section 3.1]

Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation (. ) and Kleene star ( * ). Example : ( { a } [ { b } ) * { a } { a } ( { a } [ { b } ) * [ ( { a } [ { b } )* { b } { b } ( { a } [ { b } )^* Simplify as : [Section 3.1]

A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation (. ) and Kleene star ( * ). Recursive definition of regular languages over  : [Section 3.1] Regular Languages

Recursive definition of regular expressions over  : 1) ;, {  }, and { a } for every a 2  are regular languages represented by regular expressions __, __, __, respectively. 2) If L 1, L 2 are regular languages represented by regular Expressions r 1 and r 2, then L 1 [ L 2, L 1 L 2, and L 1 * are regular languages represented by regular expressions _____, _____, _____, respectively. 3) No other expressions are regular expressions. [Section 3.1] Regular Expressions

Comments : - For convenience, we will also use r + and r i for i 2 N. - The priority of operators in decreasing order : Kleene’s star, concatenation, union. Parenthesize : a + b * c a + bc * [Section 3.1]

Regular Expressions Simplify the following regular expressions : - a * (a+  ) - a * a * - (a * b * ) * - (a+b) * ab(a+b) * + a * b * [Section 3.1]

Regular Expressions Give a regular expression for each of the following : - the language of all strings over {a,b} of even length, - the language of all strings over {a,b,c} in which all a’s precede all b’s, - the language of all strings over {a,b} with length greater than 3, - the language of all odd-length strings over {a,b} containing the string bb, - the language of all strings over {a,b} that do not contain the string aaa. Is the language { a k b k | k 2 N } regular ? [Section 3.1]

Finite Automata Our simplest model of computation : - has a tape with input, read once from left to right - has only a single memory register with the state [Sections 3.2, 3.3]

Finite Automata Example : the language of all strings over {a,b} with an even number of a’s. [Sections 3.2, 3.3]

Finite Automata More examples : - Language of strings over {a,b} with at least 3 a’s. - Language of strings over {a,b} containing substring aaba. - Language of strings over {a,b} not containing substring aaba. - Language of strings over {a,b} with even number of a’s and odd number of b’s. [Sections 3.2, 3.3]

Finite Automata A (deterministic) finite automaton (FA, in some books also abbreviated as DFA) is a 5-tuple (Q, ,q 0,A,  ) where - Q is a finite set of states -  is a finite alphabet (input symbols) - q o 2 Q is the initial state - A µ Q is a set of accepting states -  : Q £   Q is the transition function [Sections 3.2, 3.3]

Finite Automata Comment : We saw that we can represent a finite automaton by a transition diagram. Draw the transition diagram for ( {q a,q b }, {a,b}, q a, {q b },  ) where  is given by the following table (q a,a)  q a (q a,b)  q b (q b,a)  q a (q b,b)  q b Which strings does this FA accept ? [Sections 3.2, 3.3]

Finite Automata Defining the computation of an FA M=(Q, ,q 0,A,  ). Extended transition function  * : Q £  *  Q : 1) For every q 2 Q, let  * (q,  ) = 2) For every q 2 Q, y 2  *, and  2 , let  * (q,y  ) = We say that a string x 2  * is accepted by M if __________. A string which is not accepted by M is rejected by M. The language accepted by M, denoted by L(M) is the set of all strings accepted by M. [Sections 3.2, 3.3]

Finite Automata Kleene’s Thm: A language L over  is regular iff there exists a finite automaton that accepts L. Recall L = { a k b k | k ¸ 0 }. Is it regular ? [Section 3.4]

Operations on Finite Automata Let M 1 = (Q 1, ,q 1,A 1,  1 ) and M 2 = (Q 2, ,q 2,A 2,  2 ) be two FA’s. Union: We know that L(M 1 ) [ L(M 2 ) is regular. Construct an FA M such that L(M) = L(M 1 ) [ L(M 2 ). [Section 3.5]

Operations on Finite Automata Let M 1 = (Q 1, ,q 1,A 1,  1 ) and M 2 = (Q 2, ,q 2,A 2,  2 ) be two FA’s. Intersection: Is L(M 1 ) Å L(M 2 ) is regular ? Construct an FA M such that L(M) = L(M 1 ) Å L(M 2 ). [Section 3.5]

Operations on Finite Automata Let M 1 = (Q 1, ,q 1,A 1,  1 ) be an FA. Complement: Is L(M 1 )’ regular ? Construct an FA M such that L(M) = L(M 1 )’. [Section 3.5]

Operations on Finite Automata Let M 1 = (Q 1, ,q 1,A 1,  1 ) and M 2 = (Q 2, ,q 2,A 2,  2 ) be two FA’s. Difference: Construct an FA M such that L(M) = L(M 1 ) - L(M 2 ). [Section 3.5]

Closure Properties We just saw that the class of regular languages is closed under union, intersection, complement, and difference. Let L = { x 2 {a,b} * | x has the same number of a’s and b’s }. Is L regular ? [Section 3.5]