1 Languages: Finite State Machines Chapter 6 problemsstrings (languages) machines answers.

Slides:



Advertisements
Similar presentations
Example: Binary Adder We want to construct a finite state machine that will add two numbers. The input is two binary numbers, (xn…x1x0)2 and (yn…y1y0)2.
Advertisements

Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Languages: Finite State Machines Chapter 6 problemsstrings (languages) machines answers.
Modeling Computation Chapter 13.
Chapter 6 Languages: finite state machines
Finite-State Machines with No Output Ying Lu
CMPS 3223 Theory of Computation
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Pushdown Automata CPSC 388 Ellen Walker Hiram College.
Finite Automata CPSC 388 Ellen Walker Hiram College.
YES-NO machines Finite State Automata as language recognizers.
Finite Automata with Output
Chapter Two: Finite Automata
Chapter Section Section Summary Set of Strings Finite-State Automata Language Recognition by Finite-State Machines Designing Finite-State.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
CS5371 Theory of Computation
Transparency No. 2-1 Formal Language and Automata Theory Chapter 2 Deterministic Finite Automata (DFA) (include Lecture 3 and 4)
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.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
Rosen 5th ed., ch. 11 Ref: Wikipedia
CPSC 388 – Compiler Design and Construction Scanners – Finite State Automata.
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
Finite-State Machines with Output
CMPS 3223 Theory of Computation
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
REGULAR LANGUAGES.
AUTOMATA THEORY Reference Introduction to Automata Theory Languages and Computation Hopcraft, Ullman and Motwani.
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:
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Copyright © Curt Hill Finite State Machines The Simplest and Least Capable Automaton.
Copyright © Curt Hill Finite State Automata Again This Time No Output.
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.
Computing Machinery Chapter 4: Finite State Machines.
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.2 Three Basic Concepts Languages start variables Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
using Deterministic Finite Automata & Nondeterministic Finite Automata
Language Translation Part 2: Finite State Machines.
Lecture 22: Finite State Machines with Output. Moore Machine - A Moore machine is a 6-tuple (Q, , , , q 0,  ) where, (1) Q is a finite set of states.
Deterministic Finite Automata Nondeterministic Finite Automata.
June 13, 2016 Prof. Abdelaziz Khamis 1 Chapter 2 Scanning – Part 2.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
Lecture 14: Theory of Automata:2014 Finite Automata with Output.
Mealy and Moore Machines Lecture 8 Overview Moore Machines Mealy Machines Sequential Circuits.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Theory of Computation Automata Theory Dr. Ayman Srour.
Finite-State Machines (FSM) Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth Rosen.
Topic 3: Automata Theory 1. OutlineOutline Finite state machine, Regular expressions, DFA, NDFA, and their equivalence, Grammars and Chomsky hierarchy.
Finite-State Machines (FSMs)
CSE 105 theory of computation
Finite Automata & Regular Languages
Chapter 2 FINITE AUTOMATA.
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Deterministic Finite Automaton (DFA)
CSC312 Automata Theory Transition Graphs Lecture # 9
Finite-State Machines with No Output
NFAs and Transition Graphs
Chapter # 5 by Cohen (Cont…)
CSE 105 theory of computation
Non Deterministic Automata
Part Two : Nondeterministic Finite Automata
CSE 105 theory of computation
Presentation transcript:

1 Languages: Finite State Machines Chapter 6 problemsstrings (languages) machines answers

2 6.1 Language: The Set Theory of Strings : a nonempty finite set of symbols, collectively called an alphabet. {0,1,2,11} or {a,b bb} is not considered as an alphabet. That is, juxtaposition of symbols is not included in an alphabet.

3 6.1 Language: The Set Theory of Strings

4 L={x n |x=01,n in N} y recognizer of L yes, y in L no

5 6.1 Language: The Set Theory of Strings

6

7

8

9

Language: The Set Theory of Strings

Language: The Set Theory of Strings Which languages in the above examples are harder to recognize? recursively defined sets

Language: The Set Theory of Strings Which one is harder, xx or xx R ? If x=x R, x is called a palindrome. (noon, madam, did,...) 6.16

Finite State Machines: A First Encounter c A vending machine: 20c for cola (C), root beer(RB) and accepting 5c, 10c, and 25c, and returning the necessary changes Purchase root beer (white button) Purchase cola (black button)

Finite State Machines: A First Encounter The major features of such a machine: (1) in only one of finitely many states at a given time (state set S) (2) accept as input only a finite number of symbols (input alphabet set I) (3) state transition function depending on input and current state ( is the next state function) (4) finite set of output alphabet set O (optional) ( is the output function) (5) deterministic (vs. nondeterministic)

Finite State Machines: A First Encounter (or use final states set F instead of O) Ex state transition table s0s0 s1s1 s2s2 start 0,0 1,0 0,0 1,1 0,0 state transition diagram

Finite State Machines: A First Encounter language A={x|x in {0,1}* and has at least 1 0's} s0s0 s1s1 1,0 start 0,1 1,1 x x is in A if the output contains 1's. s0s0 s1s x start x is in A if the machine stays at s 1 when the input is consumed. final state

Finite State Machines: A First Encounter Ex Design a 1-bit binary adder. s0s0 s1s1 start 00,0 01,1 10,1 01,0 10,0 11,1 11,0 00,1 state to remember a carry

Finite State Machines: A Second Encounter sequence recognizer Ex Construct a machine that recognizes each occurrence of the sequence 111 as it is encountered in any input string of {0,1}*. For example, input , the output should be s0s0 s1s1 s2s2 start 0,0 1,0 1,1 0,0 s3s3 1,1 a minimal machine (3 states)

Finite State Machines: A Second Encounter Ex recognize the occurrences of 111 that end in a position that is a multiple of three. (input , output ) s0s0 s1s1 s2s2 s3s3 s4s4 start 1,0 1,1 0,0 1,0 0,0 1,0 used to consume extra symbols before counting

Finite State Machines: A Second Encounter Ex Languages that cannot be recognized by a finite state machine. A={0 i 1 i | i is a positive integer} Assume there is a FSM that recognizes A with n states. s 0 s 1 s 2... s i... s j... s n-1 start transition for x= 0 n 1 n by the pigeonhole principle, this cycle must exist If x is recognized, then 0 n-(j-i+1) 1 n would also be recognized. Therefore, such FSM cannot exist.

Finite State Machines: A Second Encounter k-unit delay machines Ex unit delay machine s0s0 s1s1 s2s2 start 0,0 1,0 0,1 1,0 0,0 1,1 remembering 0 remembering 1

Finite State Machines: A Second Encounter Ex unit delay machine s3s3 s4s4 s5s5 s6s6 s1s1 s2s2 s0s0 start 0,0 1,0 0,0 1,0 0,0 1,0 1,1 1,0 0,1 0,0 1,1 1,0 0,0

Finite State Machines: A Second Encounter Def (a) reachable v(s i,x)=s j (b) transient state v(s,x)=s implies x=, s 2 is the only transient state. s0s0 s2s2 s1s1 s3s3 s4s4 s5s5 s7s7 s6s6 0,0 0,1 1,0 1,1 0,1 1,0 0,0 1,1 0,1 1,1 0,0 1,0 1,1 0,0 0,1 (c) sink state v(s,x)=s for all x s 3 is the only sink (d) submachine (e) strongly connected for any s i,s j, s i is reachable from s j a strongly connected submachine

Finite State Machines: A Second Encounter Ex. 6.26v w 0 1 s 0 s 6 s s 1 s 5 s s 2 s 1 s s 3 s 4 s s 4 s 2 s s 5 s 3 s s 6 s 3 s Find a transfer sequence from s 0 to s 2. s0s0 s1s1 s6s6 s6s6 s5s5 s5s5 s3s3 s3s3 s0s0 s0s0 s1s1 s2s2 s4s

25 Chapter 6 Languages: Finite State Machines Exercise: P318:8,21 P324: 3,5,8 P332: 5 P334: 6,8