Formal Language & Automata Theory

Slides:



Advertisements
Similar presentations
Properties of Regular Sets
Advertisements

LING/C SC/PSYC 438/538 Lecture 11 Sandiway Fong. Administrivia Homework 3 graded.
Lecture 9,10 Theory of AUTOMATA
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Module 21 Closure Properties for LFSA using NFA’s –From now on, when I say NFA, I mean any NFA including an NFA- unless I add a specific restriction.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Regular expressions Sipser 1.3 (pages 63-76). CS 311 Fall Looks familiar…
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
1 Module 31 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union, concatenation.
1 Lecture 19 Closure Properties for LFSA using NFA’s –union second proof –concatenation –Kleene closure.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
CMSC 330 Exercise: Write a Ruby function that takes an array of names in “Last, First Middle” format and returns the same list in “First Middle Last” format.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CSC312 Automata Theory Lecture # 2 Languages.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Introduction to Theory of Automata
Compiler Phases: Source program Lexical analyzer Syntax analyzer Semantic analyzer Machine-independent code improvement Target code generation Machine-specific.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided by author Slides edited for.
1 Chapter 1 Introduction to the Theory of Computation.
Grammars CPSC 5135.
What is a language? An alphabet is a well defined set of characters. The character ∑ is typically used to represent an alphabet. A string : a finite.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
1 Module 31 Closure Properties for CFL’s –Kleene Closure –Union –Concatenation CFL’s versus regular languages –regular languages subset of CFL.
Review: Compiler Phases: Source program Lexical analyzer Syntax analyzer Semantic analyzer Intermediate code generator Code optimizer Code generator Symbol.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
CHAPTER 1 Regular Languages
Strings and Languages CS 130: Theory of Computation HMU textbook, Chapter 1 (Sec 1.5)
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.
CSC312 Automata Theory Lecture # 3 Languages-II. Formal Language A formal language is a set of words—that is, strings of symbols drawn from a common alphabet.
Regular Expressions Chapter 6. Regular Languages Regular Language Regular Expression Finite State Machine L Accepts.
CS 203: Introduction to Formal Languages and Automata
Recursive Definations Regular Expressions Ch # 4 by Cohen
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
1 Section 11.1 Regular Languages Problem: Suppose the input strings to a program must be strings over the alphabet {a, b} that contain exactly one substring.
1 Chapter Regular Languages. 2 Section 11.1 Regular Languages Problem: Suppose the input strings to a program must be strings over the alphabet.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1 Introduction to the Theory of Computation Regular Expressions.
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.
Dept. of Computer Science & IT, FUUAST Automata Theory 2 Automata Theory III Properties of Regular Languages 1.Closure 2.Union 3.Concatenation 4.Complement(Negation)
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
CSE 105 theory of computation
Formal Language & Automata Theory
Formal Language & Automata Theory
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
CSE 105 theory of computation
Formal Language & Automata Theory
Formal Language & Automata Theory
Lecture 9 Theory of AUTOMATA
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Review: Compiler Phases:
Instructor: Aaron Roth
Chapter 1 Introduction to the Theory of Computation
CSE 105 theory of computation
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
CSC312 Automata Theory Lecture # 2 Languages.
CSCE 355 Foundations of Computation
CSE 105 theory of computation
Presentation transcript:

Formal Language & Automata Theory Shyamanta M Hazarika Computer Sc. & Engineering Tezpur University http://www.tezu.ernet.in/~smh

Inductive Definition of Regular Languages Base case definition Let S denote the alphabet {} is a regular language {} is a regular language {a} is a regular language for any character a in S Inductive case definition If L1 and L2 are regular languages, then L1 union L2 is a regular language L1 concatenate L2 is a regular language L1* is a regular language Completeness Only languages generated using above rules are regular languages

Proving a language is regular Prove that {aa, bb} is a regular language {a} and {b} are regular languages base case of definition {aa} = {a}{a} is a regular language concatenation rule {bb} = {b}{b} is a regular language {aa, bb} = {aa} union {bb} is a regular language union rule Typically, we will not go through this process to prove a language is regular. Use Pumping Lemma!

Regular Language using regex How do we describe a regular language? Use set notation {aa, bb, ab, ba}* {a}{a,b}*{b} Use regular expressions R Inductive def of regular languages and regular expressions (aa+bb+ab+ba)* a(a+b)*b

R and L(R) How we interpret a regular expression What does a regular expression R mean to us? aaba represents the regular language {aaba} f represents the regular language {} aa+bb represents the regular language {aa, bb} We use L(R) to denote the regular language represented by regular expression R.

Precedence rules What is L(ab+c*)? Possible answers: {a}({b} union {c}*} ({a}{b,c})* ({ab} union {c})* {ab} union {c}* Must know precedence rules * first, then concatenation, then +

Precedence rules continued Precedence rules similar to those for arithmetic expressions ab+c2 (a times b) + (c times c) exponentiation first, then multiplication, then addition Think of Kleene closure as exponentiation, concatenation as multiplication, and union as addition and the precedence rules are identical

Regular expressions are strings Let L be a regular language over the alphabet S A regular expression R for L is just a string over the alphabet S union {(, ), +, *, f,} which follows certain syntactic rules That is, the set of legal regular expressions is itself a language over the alphabet S union {(, ), +, *} f, a*aba are strings in the language of legal reg. exp. )(, *a* are strings NOT in the language of legal reg. exp.

Semantics We give a regular expression R meaning when we interpret it to represent L(R). aaba is just a string we interpret it to represent the language {aaba}. We do similar things with arithmetic expressions 10+72 is just a string We interpret this string to represent the number 59

Key fact A language L is a regular language iff there exists a Reg. Exp. R such that L(R) = L For a proof that a language L is regular, rather than going through the inductive proof we saw earlier, give a regular expression R s.t. L(R) = L

Summary Regular expressions are strings syntax for legal regular expressions semantics for interpreting regular expressions Regular languages are a new language class A language L is regular iff there exists a regular expression R s.t. L(R) = L