Language and Automata Theory

Slides:



Advertisements
Similar presentations
Language and Automata Theory
Advertisements

4b Lexical analysis Finite Automata
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Theory Of Automata By Dr. MM Alam
YES-NO machines Finite State Automata as language recognizers.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
1 Languages and Finite Automata or how to talk to machines...
Fall 2005 CSE 467/567 1 Formal languages regular expressions regular languages finite state machines.
CS 3240 – Chuck Allison.  A model of computation  A very simple, manual computer (we draw pictures!)  Our machines: automata  1) Finite automata (“finite-state.
Topics Automata Theory Grammars and Languages Complexities
Finite State Machines Data Structures and Algorithms for Information Processing 1.
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.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Languages & Strings String Operations Language Definitions.
Finite-State Machines with No Output Longin Jan Latecki Temple University Based on Slides by Elsa L Gunter, NJIT, and by Costas Busch Costas Busch.
Finite-State Machines with No Output
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
Grammars CPSC 5135.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Modeling Computation: Finite State Machines without Output
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
Finite Automata & Regular Languages Sipser, Chapter 1.
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
using Deterministic Finite Automata & Nondeterministic Finite Automata
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
BİL711 Natural Language Processing1 Regular Expressions & FSAs Any regular expression can be realized as a finite state automaton (FSA) There are two kinds.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
1 Introduction to the Theory of Computation Regular Expressions.
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
Deterministic Finite Automata Nondeterministic Finite Automata.
Chapter 2. Formal Languages Dept. of Computer Engineering, Hansung University, Sung-Dong Kim.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
1 Chapter 2 Finite Automata (part a) Hokkaido, Japan.
Theory of Computation Automata Theory Dr. Ayman Srour.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
Language Recognition MSU CSE 260.
Transition Graphs.
Language Theory Module 03.1 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Languages.
Lexical analysis Finite Automata
Formal Language & Automata Theory
Lecture 9 Theory of AUTOMATA
Chapter 2 FINITE AUTOMATA.
Language Recognition (12.4)
COP4620 – Programming Language Translators Dr. Manuel E. Bermudez
Solution Prove by induction the following statement:
REGULAR LANGUAGES AND REGULAR GRAMMARS
Some slides by Elsa L Gunter, NJIT, and by Costas Busch
Closure Properties for Regular Languages
4. Properties of Regular Languages
Non-Deterministic Finite Automata
Intro to Data Structures
4b Lexical analysis Finite Automata
Language Recognition (12.4)
Chapter 1 Regular Language
Finite-State Machines with No Output
CSC 4170 Theory of Computation Finite Automata Section 1.1.
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.
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
Presentation transcript:

Language and Automata Theory Chapter 2 Language and Automata Theory Learning objectives : Introduce finite state automata Able to capture state, events and dynamic behavior of “man-made systems” Present logical properties Textbook : C. Cassandras and S. Lafortune, Introduction to Discrete Event Systems, Springer, 2007 1

Plan Languages Finite state automata 2

Languages 3

Definitions Definition: A language L, defined over an alphabet E, is a set of strings formed by letters in E. Language vs DES : E = set of events string = sequence of events L = set of all possible event sequences Example : E = {a,b,g} L1 = {e, a, abb}, L2 = {all strings of length 3} L3 = {all strings of finite length ending with a} L4 = {all possible sequences of a queue} 4

The language of the single server queue Events : a = arrival, d = departure The language of the initially empty queue L = { e, 0 event a, 1 event aa, ad, 2 events aaa, aad, ada, 3 events aaaa, aaad, aada, aadd, adaa, adaa, 4events … } 5

Regular expressions Operations E : alphabet, A, B : languages e = empty string, u, v, w: strings Concatenation : AB = {w : w = uv, uA, vB} Union : A+B = {w : wA, or vB} Kleene closure : where A0 = {e}, An = AAn-1 6

Regular expressions Example : E = {a,b,g} L1 = {e, a, abb}, L2 = {g} L1L2 = {g, ag, abbg} L2* = {e, g, gg, ggg, ...} L1* = {e, a, abb, aa, aabb, abba, abbabb, ...} L1+ L2 ={e, a, abb, g} 7

Regular expressions Definition: A regular expression is a representation defined recursively as follows : F is a regular expression denoting the empty set, e is a regular expression denoting the set {e}, e is a regular expression denoting the set {e} for any e  E. If r and s are regular expressions, then rs, (r+s), r* and s* are regular expressions. There are no regular expressions other than those constructed by applying rules 1 and 2 a finite number of times Definition: Any language that can be denoted by a regular expression is a regular language. 8

L = (a+b)g* = {???} L = (ab)*+g = {???} L = ((a+b)g*)* Regular expressions Examples: L = (a+b)g* = {???} L = (ab)*+g = {???} L = ((a+b)g*)* 9

Language of a machine subject to failures Events : f = failure, r = repair Language of an initially UP machine : L = (fr)*(e + f) Language of an initially DOWN machine : L = (rf)*(e + r) Language of a machine starting and finishing in UP : L = (fr)* 10

Finite-state automata 11

Definition Definition: A finite-state automaton (FSA) is a five-tuple (E, X, f, x0, F) where E a finite alphabet X a finite state set f a state transition function f: X×E → X where f is a partial function and f(x, e) is sometime undefined. x0 an initial state, x0  X F a set of final states, F  X

Definition Transition function f can be extended to strings u : f(x, u) An automaton is a device that generates a language according to some rules. An automaton is nondeterministic if there are two possible transitions with the same event and starting from the same state. Nondeterministic automaton can always be transformed into deterministic FSA by taking all possible subsets reached by events as states. Nondeterministic automaton will not be considered.

Example Definition: State transition diagram a b g x a y g b a g z b Consider an automaton (E, X, f, x0, F) E = {a, b, g} X = {x, y, z} f(x, a) = x, f(x, b) = f(x, g) = z f(y, a) = x, f(y, b) = f(y, g) = y f(z, b) = z, f(z, a) = f(z, g) = y initial state x0 = x Final states : F = {x, z} Sample paths: ??? State transition diagram a b g x a y g b a g z b 14

Automata as language recognizers Definition: A string u is recognized by a finite automaton (E, X, f, x0, F) if f(x0, u) = x where x  F. Definition: The language recognized by a finite-state automaton A = (E, X, f, x0, F) is a set of strings {u: f(x0, u) x  F}. L(A) = language recognized by A. Example: aab L(A) = ??? x y z g b a 15

Equivalence of FSA and regular expressions Theorem: If a language is regular, then it can be generated by some finite-state automaton; and if it is generated by a finite-state automaton, then it is a regular language. Deriving the language of an FSA define the language Ls terminating at state s; write one-step equations for all Ls; Solve the equations. Arden’s rule : If A does not contain the empty string, X = AX + B → X = A*B X = XA + B → X = BA* x y z g b a 16

Properties of a FSA model Reachability: A state s is reachable from the initial state x0 if there exists a sequence u such that f(x0, u) = s. Blocking-free: For any reachable state, there exists a sequence of transitions leading to a final state. Deadlock: a state s is called a deadlock state if there is no feasible event from it. Livelock: a subset of states not containing a final state that are mutually reachable but with no event going out of the set. Example : FSA = (0, a, 1), (1, g, 5), (1, a, 3), (1, b, 2), (2, g, 0), (3, b, 4), (4, a, 3), (4, g, 4), x0 = 0, F = {2}. 17

Automata models of queueing systems B a a a I 1 2 b d d d m l Queueing perspective D Server perspective I = idle, B = busy D = down 18