Workman Notes - a start 1 a 5 1 start a 30 2 1 5 1 bS 10 0...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Recognizer (R) for L, a subset of Σ * x in Σ * “accept” (x is in L) “reject” (x not in L) 2 start 3 l 4 e all other e e n d all other all other all symbols start 5 3 1 4 2 a b b a a b Λ Λ Λ δ (p 1 ,a) p 1 p 2 . . p n Λ * δ (p 2 ,a) δ M (q,x) q δ (p n ,a) start 5 3 1 4 2 a b b a a b Λ Λ Λ Symbol Table Lexical Analyzer Source File Syntax Analyzer semantic information tokens source lines Operator Tree YACC LEX BNF Grammar Token Specs a a,b 2 M' M 1' b 1 a, b a a a b a a a 5 4 b a a b b a Λ Λ start start NFA, M Λ S Z 21 Y X Z 31 Z 51 Z 32 0 0 0 1 λ 1 1 0 1 1 a q p Λ y Λ start A a Copy of M a 1” 2” 3” 1 0 0 0 ,1 R b 1 1’ 2’ 3’ 0 1 0 1 0 ,1 R a 1 2 3 a b b a a ,b M 1’ 2’ 0 1 R a 1 2 a b M 1” 2” 1 0 R b 1 1 1’ 2’ 0 1 1” 2” 1 0 1 M’ Λ Λ Λ Λ 3 E 1 E 3 E 4 + T T 6 9 9 6 F T * F T 9 11 6 9 10 F X F X 10 12 X v X n n ) ( E * n + v n * + n + n * n v n v COT 4210 Finite State Automata © D.A. Workman F inite State Automata Our next series of definitions and results characterize the family of Regular Languages . Specifically, this family is exactly the set of languages that can be recognized or accepted by Deterministic Finite Automata (DFAs) and Non-deterministic Finite Automata (NFAs). DFAs and NFAs are examples of a more general class of formal language specifications called recognizers. A model of a typical Recognizer is illustrated in the figure below. A Recognizer takes as its only input some string x over its input alphabet, Σ . If x L(R), the language recognized by R, then R must eventually halt and output accept . If x L(R), then R will have one of two behaviors, (a) it will halt and output reject , or (b) it will never halt. For example, message decoding devices (e.g. communication protocols) and programming language compilers are examples of recognizers. In the former case, messages are symbol strings over some natural language alphabet, while inputs to compilers are strings (programs) over the alphabet of some programming language. Example 9 . To illustrate the recognizer concept, consider an algorithm for searching a text file for an occurrence of the string “end”. The algorithm will "accept" the text file if it contains at least one occurrence of this word and will "reject" or "fail" otherwise. We model the algorithm with a state transition diagram (STD), where "states" (numbered circles) denote distinct configurations of the algorithm's "memory"(local variables) that define intermediate stages of "success" in making a final determination about the correctness or incorrectness of the input file. Transitions between states occur with the next character read from the input file. In the STD below, State 1 . Defines the initial starting point of computation, and denotes a state of processing that implies no occurrence of the target word has been encountered, and last character read was not the first letter "e" of the target word. States 2 and 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 91

Workman Notes - a start 1 a 5 1 start a 30 2 1 5 1 bS 10 0...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online