Lecture 2 Theory of AUTOMATA

Slides:



Advertisements
Similar presentations
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
Advertisements

Strings and Languages Operations
Cohen, Chapter 61 Introduction to Computational Theory Chapter 6.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
L ECTURE 2 Chapter 3 Recursive Definitions. R ECURSIVE D EFINITION It is method of defining sets.
Second lecture REGULAR EXPRESSION. Regular Expression.
Chapter 2 Languages.
Theory Of Automata By Dr. MM Alam
Lecture # 1 (Automata Theory)
Theory of Automata.
1 Welcome to ! Theory Of Automata. 2 Text and Reference Material 1.Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991,
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 7 1.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 2 Languages.
L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS  Pre-Requisites  No Pre-Requisite  Text book  Introduction to Computer Theory by Daniel I.A. Cohen 
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Introduction to Theory of Automata
Two examples English-Words English-Sentences alphabet S ={a,b,c,d,…}
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
1 Chapter 1 Introduction to the Theory of Computation.
Lecture # 3 Regular Expressions 1. Introduction In computing, a regular expression provides a concise and flexible means to "match" (specify and recognize)
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
Lecture-2 Recap Lecture-1
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
Introduction to Theory of Automata By: Wasim Ahmad Khan.
Recursive Definitions & Regular Expressions (RE)
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.
Regular Expressions Chapter 6 1. Regular Languages Regular Language Regular Expression Finite State Machine L Accepts 2.
Lecture 02: Theory of Automata:08 Theory of Automata.
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.
Recursive Definations Regular Expressions Ch # 4 by Cohen
Lecture # Book Introduction to Theory of Computation by Anil Maheshwari Michiel Smid, 2014 “Introduction to computer theory” by Daniel I.A. Cohen.
Lecture # 4.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
1 Chapter 3 Regular Languages.  2 3.1: Regular Expressions (1)   Regular Expression (RE):   E is a regular expression over  if E is one of:
1 Strings and Languages Lecture 2-3 Ref. Handout p12-17.
Lecture 02: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
L ANGUAGE C ONCEPTS : F ORMAL M ODEL FOR L ANGUAGES Theory of Computer Akram Salah.
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
CHAPTER TWO LANGUAGES By Dr Zalmiyah Zakaria.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
By Dr.Hamed Alrjoub. 1. Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991, Second Edition 2. Introduction to Languages.
Lecture 01: Theory of Automata:2013 Asif Nawaz Theory of Automata.
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Pumping Lemma.
Theory of Computation Lecture #
Lecture # 2.
Implementation of Haskell Modules for Automata and Sticker Systems
Language Theory Module 03.1 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Regular Languages, Regular Operations, Closure
Lecture 1 Theory of Automata
Theory of Automata.
Regular Expressions (Examples)
Mathematical Notions and Terminology
LANGUAGES Prepared by: Paridah Samsuri Dept. of Software Engineering
REGULAR LANGUAGES AND REGULAR GRAMMARS
Kleene’s Theorem Muhammad Arif 12/6/2018.
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
Chapter 1 Introduction to the Theory of Computation
Recap lecture 11 Proof of Kleene’s theorem part II (method with different steps), particular examples of TGs to determine corresponding REs.
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 3 Languages-II.
Welcome to ! Theory Of Automata Irum Feroz
LECTURE # 07.
Presentation transcript:

Lecture 2 Theory of AUTOMATA

Definition: Palindrome Let us define a new language called Palindrome over the alphabet ∑ = { a, b } PALINDROME = { Λ, and all strings x such that reverse(x) = x } If we want to list the elements in PALINDROME, we find PALINDROME = { Λ, a, b, aa, bb, aaa, aba, bab, bbb, aaaa, abba, … }

Definition: Palindrome Sometimes two words in PALINDROME when concatenated will produce a word in PALINDROME abba concatenated with abbaabba gives abbaabbaabba (in PALINDROME) But more often, the concatenation is not a word in PALINDROME aa concatenated with aba gives aaaba (NOT in PALINDROME)

Kleene Closure Given an alphabet ∑, we define a language in which any string of letters from ∑ is a word, even the null string Λ. We call this language the closure of the alphabet ∑, and denote this language by ∑*. Examples: If ∑ = { x } then ∑* = { Λ, x, xx, xxx, … } If ∑ = { 0, 1 } then ∑* = { Λ, 0, 1, 00, 01, 10, 11, 000, 001, … } If ∑ = { a, b, c } then ∑* = { Λ, a, b, c, aa, ab, ac, ba, bb, bc, ca, cb, cc, aaa, … }

Lexicographic order Notice that we listed the words in a language in size order (i.e., words of shortest length first), and then listed all the words of the same length alphabetically. This ordering is called lexicographic order, which we will usually follow.

Kleene Closure Definition: If S is a set of words, then S* is the set of all finite strings formed by concatenating words from S, where any word may be used as often as we like, and where the null string Λ is also included.

Kleene Closure Example: If S = { aa, b } then S* = { Λ plus any word composed of factors of aa and b }, or S* = { Λ plus any strings of a’s and b’s in which the a’s occur in even clumps }, or S* = { Λ, b, aa, bb, aab, baa, bbb, aaaa, aabb, baab, bbaa, bbbb, aaaab, aabaa, aabbb, baaaa, baabb, bbaab, bbbaa, bbbbb, … } Note that the string aabaaab is not in S* because it has a clump of a’s of length 3.

Kleene Closure Example: Let S = { a, ab }. Then S* = { Λ plus any word composed of factors of a and ab }, or S* = { Λ plus all strings of a’s and b’s except those that start with b and those that contain a double b }, or S* = { Λ, a, aa, ab, aaa, aab, aba, aaaa, aaab, abaa, abab, aaaaa, aaaab, aaaba, aabaa, aabab, abaaa, abaab, ababa, … } Note that for each word in S*, every b must have an a immediately to its left, so the double b, that is bb, is not possible; neither any string starting with b.

Positive Closure If we wish to modify the concept of closure to refer only the concatenation of some (not zero) strings from a set S, we use the notation + instead of *. This “plus operation” is called positive closure. Example: if ∑ = { x } then ∑+ = { x, xx, xxx, … } Observe that: If S is a language that does not contain Λ, then S+ is the language S* without the null word Λ. If S is a language that does contain Λ, then S+ = S* Likewise, if ∑ is an alphabet, then ∑+ is ∑* without the word Λ.

Regular Expression The symbols that appear in the regular expressions are the letters of the alphabet Σ, the symbol for the null string Λ, parenthesis, the star operator * , and the plus sign.

Regular Expression The set of regular expressions is defined by the following rules: Rule 1: Every letter of Σ can be made in to a regular expression by writing it in bold-face; Λ itself is a regular expression. Rule 2: Assume r and s are regular expressions, then (i) (r), (ii) rs, (iii) r + s, (iv) r*

Regular Expression Rule 3: Nothing else is a regular expression. Examples: L = language (ab*) L = language (ab)* L = language (ab*a) L = language a*b* L = language (a+c)b* over the alphabet Σ {a,b,c}

Graphs Set of points with the lines connecting some of the points (also called simple graph). The points are called nodes or vertices and the lines are called edges. Numbers of edges at a particular node is the degree of that node. G = (V, E)

Graphs Continue….. Path: in a graph is a sequence of nodes connected by edges. Simple Path: is a path that does not repeat nodes. Connected Graph: if every two nodes have a path between them. Cycle: A path is a cycle if it starts and ends with same node.

Graphs Continue…. Tree: if it is connected and has no simple cycles Directed Graph: If it has arrows instead of lines Strongly Connected: if a directed path connects every two nodes.