Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.

Slides:



Advertisements
Similar presentations
Finite-State Machines with No Output Ying Lu
Advertisements

Finite State Machines Finite state machines with output
4b Lexical analysis Finite Automata
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
COGN1001: Introduction to Cognitive Science Topics in Computer Science Formal Languages and Models of Computation Qiang HUO Department of Computer.
Copyright © Cengage Learning. All rights reserved. CHAPTER 1 SPEAKING MATHEMATICALLY SPEAKING MATHEMATICALLY.
Chapter Section Section Summary Set of Strings Finite-State Automata Language Recognition by Finite-State Machines Designing Finite-State.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
1 Foundations of Software Design Lecture 23: Finite Automata and Context-Free Grammars Marti Hearst Fall 2002.
Pushdown Automaton (PDA)
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Rosen 5th ed., ch. 11 Ref: Wikipedia
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
::ICS 804:: Theory of Computation - Ibrahim Otieno SCI/ICT Building Rm. G15.
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
REGULAR LANGUAGES.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Theory of Computation - Lecture 3 Regular Languages What is a computer? Complicated, we need idealized computer for managing mathematical theories... Hence:
Athasit Surarerks THEORY OF COMPUTATION 07 NON-DETERMINISTIC FINITE AUTOMATA 1.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture of a compiler PART II:
Week 14 - Wednesday.  What did we talk about last time?  Regular expressions  Introduction to finite state automata.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
Copyright © Curt Hill Finite State Machines The Simplest and Least Capable Automaton.
Complexity and Computability Theory I Lecture #2 Rina Zviel-Girshin Leah Epstein Winter
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay 2 The D FlipFlop The RS flipflop stores one bit of information.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
September1999 CMSC 203 / 0201 Fall 2002 Week #14 – 25/27 November 2002 Prof. Marie desJardins clip art courtesy of
Modeling Computation: Finite State Machines without Output
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 10 Automata, Grammars and Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2007.
1.2 Three Basic Concepts Languages start variables Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2006.
Akram Salah ISSR Basic Concepts Languages Grammar Automata (Automaton)
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
Week 14 - Wednesday.  What did we talk about last time?  Exam 3 post mortem  Finite state automata  Equivalence with regular expressions.
Week 13 - Friday.  What did we talk about last time?  Regular expressions.
Theory of Computation Automata Theory Dr. Ayman Srour.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
BCT 2083 DISCRETE STRUCTURE AND APPLICATIONS
1.3 Finite State Machines.
Finite State Machines Dr K R Bond 2009
CIS Automata and Formal Languages – Pei Wang
Copyright © Cengage Learning. All rights reserved.
Finite Automata.
4b Lexical analysis Finite Automata
Regular Expressions
4b Lexical analysis Finite Automata
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Lecture One: Automata Theory Amjad Ali
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.
Presentation transcript:

Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics for Managers using Excel by Levine (2) Computer Algorithms: Introduction to Design & Analysis by Baase and Gelder (slides by Ben Choi to accompany the Sara Baase’s text). (3) Discrete Mathematics by Richard Johnsonbaugh 1 Conceptual Foundations (MATH21001) Lecture Week 8 Reading: Textbook, Chapter 9: Automata, Grammars and Languages

2 Learning Objectives In this lecture, you will learn:  Finite-state machines  Finite-state automata  Languages and grammars  Nondeterministic finite-state automata  Relationships between languages and automata

3 Finite-state Machines  A finite-state machine is an abstract model of a machine with a primitive internal memory.  A finite-state machine M consists of (a) A finite set I of input symbols. (b) A finite set O of output symbols. (c) A finite set S of states. (d) A next-state function f from S x I into S. (e) An output function g from S x I into O (f) An initial state σ ε S.  We write M = (I, O, S, f, g, σ)

4 Example  Let I={a, b}, O={0, 1}and S={σ0, σ1}. Define the pair of functions f and g by the rules given in the table below. Table 1 fg S Ia b σ0σ1σ0σ1 σ0 σ1 σ

5 Example Then M = (I, O, S, f, g, σ0) is a finite state machine. Table 1 is interpreted as follows: f(σ0, a) = σ0 g(σ0, a) = 0 f(σ0, b) = σ1 g(σ0, b) = 1 f(σ1, a) = σ1 g(σ1, a) = 1 f(σ1, b) = σ1 g(σ1, b) = 0 The next state and output functions can also be defined by a transition diagram.

6 What is a Transition Diagram?  Let M = (I, O, S, f, g, σ) be a finite state machine. The transition diagram of M is a diagraph G whose vertices are the members of S.  Transition diagram is a digraph. The vertices are the states. The initial state is indicated by an arrow.  If we are in state σ and inputting i causes output o and moves us to state σ1, we draw a directed edge from vertex σ to vertex σ1 and level it i/o.

7 Example – Transition Diagram  Transition diagram of example on slide 4 is shown below. Table 1 shows that if we are in state σ0 and we input a, then we will output 0 and will remain in state σ0. Thus we draw a directed loop on vertex σ0 and label it a/0. By considering all such possibilities we obtain the transition diagram as follows: σ0σ0σ1σ1 a/0 a/1 b/1 b/0

8 Finite-state Automata  A finite state automaton is a special kind of finite state machine.  A finite state automaton A = (I, O, S, f, g, σ) is a finite state machine in which the set of output symbols is {0,1} and where the current state determines the last output.

9 Example fg S Ia b σ0 σ 1 σ2 σ1 σ0 σ2 σ0 1 0 Draw the transition diagram of the finite state machine A defined by the table. The initial state is σ0. Show that A is a finite state automaton.

10 Example  The transition diagram is shown below. If we are in state σ0, the last output was 0. If we are in either state σ1 or σ2, the last output was 1; thus A is a finite state automaton. Example – Transition Diagram σ0σ0σ1σ1 b/0 a/1 b/0 σ2σ2 a/1

Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics for Managers using Excel by Levine (2) Computer Algorithms: Introduction to Design & Analysis by Baase and Gelder (slides by Ben Choi to accompany the Sara Baase’s text). (3) Discrete Mathematics by Richard Johnsonbaugh 11

12 Languages & Grammars  Definition  Let A be a finite set. A formal language L over A is a subset of A*, the set of all strings over A.  One way to define a language is to give a list of rules that the language is assumed to obey.

13 Grammar A grammar G =(N, T, P, S) consists of  A finite set N of non-terminal symbols  A finite set T of terminal symbols  A finite subset P  A starting symbol S which is a non-terminal.

14 Example – A grammar for Integers  The following grammar generates all integers. ::=0|1|2|3|4|5|6|7|8|9 ::= | ::=+ |- ::= |

15 Summary  Introduced finite-state machines (FSM) and finite-state automata (FSA).  Reviewed various examples of FSM and FSA.  Discussed transition diagram.  Introduced language and grammar. In this lecture, we have