SM2220 – Class 06 Finite Automata. SM2220 – Class 06 Topic in theoretical computing. A subset of computation machines. Closely related to formal language.

Slides:



Advertisements
Similar presentations
Automata Theory Part 1: Introduction & NFA November 2002.
Advertisements

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
SM2220 – Class 10 Finite Automata. SM2220 – Class 10 Finite Automata Computation theory Formal language.
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou.
YES-NO machines Finite State Automata as language recognizers.
January 7, 2015CS21 Lecture 21 CS21 Decidability and Tractability Lecture 2 January 7, 2015.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
Advanced Topics Object-Oriented Programming Using C++ Second Edition 13.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 1 Regular Languages Contents Finite Automata (FA or DFA) definitions, examples,
1 Intro to Finite Automata Chapter 2 introduces the concept of a Finite Automata (or FA). An FA has several properties: It is theoretical. It allows computer.
Topics Automata Theory Grammars and Languages Complexities
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
CPSC 388 – Compiler Design and Construction
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.
Language Recognizer Connecting Type 3 languages and Finite State Automata Copyright © – Curt Hill.
Finite-State Machines with No Output
CMPS 3223 Theory of Computation
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
Winter 2007SEG2101 Chapter 71 Chapter 7 Introduction to Languages and Compiler.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
1 111 Computability, etc. Midterm review. Turing machines. Finite state machines. Push down automata. Homework: FSA, PDA, TM problems (can work in teams)
Theory of Computation - Lecture 3 Regular Languages What is a computer? Complicated, we need idealized computer for managing mathematical theories... Hence:
Computabilty Computability Finite State Machine. Regular Languages. Homework: Finish Craps. Next Week: On your own: videos +
1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture of a compiler PART II:
Copyright © Curt Hill Languages and Grammars This is not English Class. But there is a resemblance.
Computability Review homework. Regular Operations. Nondeterministic machines. NFSM = FSM Homework: By hand, build FSM version of specific NFSM. Try to.
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.
Mathematical Preliminaries
Overview of Previous Lesson(s) Over View  Symbol tables are data structures that are used by compilers to hold information about source-program constructs.
Finite State Machines Concepts DFA NFA.
Fundamentals of Informatics
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Chapter 3 Regular Expressions, Nondeterminism, and Kleene’s Theorem Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Finite Automata Chapter 1. Automatic Door Example Top View.
Three Basic Concepts Languages Grammars Automata.
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Finite-State Machines Fundamental Data Structures and Algorithms Peter Lee March 11, 2003.
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture 1 Ahmed Ezzat.
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:
COMBINATIONAL AND SEQUENTIAL CIRCUITS Guided By: Prof. P. B. Swadas Prepared By: BIRLA VISHVAKARMA MAHAVDYALAYA.
CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014 Design and Analysis of Algorithms.
Lecture 2 Compiler Design Lexical Analysis By lecturer Noor Dhia
Lecture 01: Theory of Automata:2013 Asif Nawaz Theory of Automata.
Theory of Computation Automata Theory Dr. Ayman Srour.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Topic 3: Automata Theory 1. OutlineOutline Finite state machine, Regular expressions, DFA, NDFA, and their equivalence, Grammars and Chomsky hierarchy.
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 Σ:
BCT 2083 DISCRETE STRUCTURE AND APPLICATIONS
Formal Methods in software development
Finite State Machines Dr K R Bond 2009
Unit 5 Lesson 6: User Input and Strings
Lecture 1 Theory of Automata
CIS Automata and Formal Languages – Pei Wang
Modeling Arithmetic, Computation, and Languages
Recognizer for a Language
Jaya Krishna, M.Tech, Assistant Professor
Lesson 6: User Input and Strings
Chapter 2 Data Representation.
Compiler Construction
CSCE 355 Foundations of Computation
Presentation transcript:

SM2220 – Class 06 Finite Automata

SM2220 – Class 06 Topic in theoretical computing. A subset of computation machines. Closely related to formal language.

SM2220 – Class 06 Finite Automata Finite State Automata Finite State Machine (FSM)

SM2220 – Class 06 Before discussing Finite Automata, we have to take care of the concepts, Symbol and coding in textual environment; Computation.

SM2220 – Class 06 We are taught in SM1001 that everything inside the computer is represented by string of 0 and 1. English text comprises of alphabets (a-z, A-Z), digits (0-9) and punctuation (,. ;, etc.) They are represented by a coding scheme, ASCII.

SM2220 – Class 06 If we count the number of symbols for a piece of typical English text, it has around 80 such characters. One unit of binary digit can represent 2 symbols, 0 and 1. It needs at least 7 digits (7 bits) to represent common English text.

SM2220 – Class 06

A basic unit of storage is 8 bits – byte. It takes 1 byte to represent an English text symbol. That is all for the symbol for the time being. If we want to manipulate the text in computer, we have to think about the computation process.

SM2220 – Class 06 From a functional point of view, computation can be considered as a black box which takes in symbols and produces symbols. Computation Input symbolsOutput symbols

SM2220 – Class 06 Since all symbols are patterns of 0 and 1, the simplest computation takes one symbol and produce another one. Computation 11 00

SM2220 – Class 06 Or another simple one. Computation 10 01

SM2220 – Class 06 A little more complicated with 2 symbols as input. Computation

SM2220 – Class 06 Such computation can be described mathematically by Boolean Algebra. A and B 0 and 0 = 0 0 and 1 = 0 1 and 0 = 0 1 and 1 = 1 A or B 0 or 0 = 0 0 or 1 = 1 1 or 0 = 1 1 or 1 = 1

SM2220 – Class 06 The computation can become very complicated such as A and (B or (C and B) and (A or C)) and (D or B)

SM2220 – Class 06 No matter how complicated and long the expression, it always gives the same result with the same combination of A, B, C and D. A and (B or (C and B) and (A or C)) and (D or B)

SM2220 – Class 06 Once you have the combination of A, B, C and D, the result is fixed, instantly available and always be the same. A and (B or (C and B) and (A or C)) and (D or B) Combinational Logic.

SM2220 – Class 06 Imagine this strange Boolean algebra formula, ANDNOT A

SM2220 – Class 06 The feedback loop introduces the element of time and most importantly, memory. ANDNOT A

SM2220 – Class 06 The current formula is not very stable. It can perform better with in introduction of another input. ANDNOT A

SM2220 – Class 06 ANDNOT A ANDNOT B

SM2220 – Class 06 The memory gives you the state (status) of the computing device. The previous one can only remember two states (1 bit information).

SM2220 – Class 06 Finite Automata is an abstract computing device capable of remembering finite number of states.

SM2220 – Class 06 A less abstract description Nonlinear description of how an object can change its state over time, possibly in response to events in its environment. The Ultimate Guide to FSMs in Games – Dan Fu and Ryan Houlette

SM2220 – Class 06 It starts at an initial state. By accepting different inputs, it changes to different states. Eventually, it stops at an ending state.

SM2220 – Class 06 S0 S1 S2 a b b Simple example

SM2220 – Class 06 The diagram is known as a Graph in Mathematics. Each state is a node and each input symbol is a directed link. A graph is different from a tree that it can contain a loop.

SM2220 – Class 06 State transition table Current stateInputNext state S0aS1 S0bS2 S1bS2

SM2220 – Class 06 If you consider the input symbol sequence, you can notice the valid ones are, ab b All the other input symbol sequences are invalid.

SM2220 – Class 06 Essentially this simple finite automata defines a simple language which has only 2 alphabets: a, b. And the valid syntax for the language are the 2 sentences: ab and b.

SM2220 – Class 06 Such language is known as, Regular language Regular grammar Regular expression

SM2220 – Class 06 A regular language can also be described by other means. If the language has only two alphabets: a, b, they can be written down like, ab – concatenation of symbol a and b. a+b – either a or b. a* - zero or more occurrences of a.

SM2220 – Class 06 Exercise time aa* (a+b)* (aa+ab+ba+bb)* ((a+b)(a+b))*

SM2220 – Class 06 If a regular language and a finite automata are equivalent, can we draw a finite automata which is the same as aa*

SM2220 – Class 06 S0 S1 a a

SM2220 – Class 06 State transition table Current stateInputNext state S0aS1 a

SM2220 – Class 06 S0 S1 S3 S2 a a b b a b a, b More complicated example

SM2220 – Class 06 Exercise time Try to draw the transition table for the finite automata. Try to identify the regular language pattern.

SM2220 – Class 06 More exercise Try to use regular language or finite automata to describe a pattern which starts with a number of a’s and ends with the same number of b’s afterwards. E.g. ab, aabb, aaaaabbbbb, etc.

SM2220 – Class 06 Applications of Finite Automata

SM2220 – Class 06 If you start replacing the a, b symbols with sentences, plots, etc., you can end up with a piece of text like the Oulipo experiments.

SM2220 – Class 06 Gather Treasure Flee Fight Monster in sight Monster dead Simple application in game Cornered Monster away

SM2220 – Class 06 If you start replacing the states: S0, S1, etc. with scenes, movie clips or frames, you will end up with an interactive movie. The symbols: a, b will become your participants’ input, such as sensor values or keyboard inputs. Remember the previous workshop.

SM2220 – Class 06 Let’s get back to this transition table. Current stateInputNext state S0aS1 S0bS2 S1bS2

SM2220 – Class 06 From the state transition table, the next state is a function of both the current state and input symbol. Current stateInputNext state S0aS1 S0bS2 S1bS2

SM2220 – Class 06 (S0, a) -> S1 (S0, b) -> S2 (S1, b) -> S2 It is a mapping from a 2D array to the set of states, which has been shown in your previous workshop.

SM2220 – Class 06 Q & A