# Nfadef - δ is a partial relation on its domain and has...

This preview shows pages 1–6. Sign up to view the full content.

NFAs and DFAs COT 4210 Fall 2001 © Dr. David A. Workman School of EE and CS University of Central Florida

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

View Full Document
05/01/09 2 DFA to C code q 0 p1 p2 pn a n a 2 a 1 Σ = {a 1 , a 2 , …, a n } Boolean File.EOF(){. .} //This is a boolean function //returning true if an end-of-file //has been found, false if not all // input has been read. Char File.getChar(){. .} //This function returns the next //character in the input stream //if input remains to be read. Char a; //next input character q0: if( file.EOF() ) { output(" accept !"); exit(0);} a = file.getChar(); switch( a ){ case a 1 : goto p1; case a 2 : goto p2; case a n : goto pn; } p1:if( file.EOF() ) { output(" reject !"); exit(0);} a = file.getChar(); switch( a ){ case a 1 : goto …; case a 2 : goto …; case a n : goto …; } p2:p1:if( file.EOF() ) { output(" accept !"); exit(0);} a = file.getChar(); switch( a ){ case a 1 : goto …; case a 2 : goto …; case a n : goto …; }
05/01/09 3 NFA Definition: An NFA is a 5-tuple, M = (Q, Σ , δ , Q 0 , A) where Q fn rel Q Q Q 2 }) { ( : }) { ( : Λ Σ × Λ Σ × δ The relation

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ( δ ) is a partial relation on its domain and has range set, Q. The function ( δ ) is a total function on its domain and has range set, 2 Q . To understand the difference in these two definitions, recall from Discrete I the definition of a relation R from A to B . This is depicted in the figure below. A (domain set) B (range set) A relation R is an arbitrary subset of A × B . 05/01/09 4 NFA EXAMPLE: To illustrate the definition of the transition relation ( δ ), let Q = {1,2,3} and let Σ = { a, b} rel Q 3 2 1 (1,a) (2,a) (3,a) (1,b) (2,b) (3,b) (1, Λ )(2, Λ )(3, Λ ) 05/01/09 5 NFA 2 Q {1,2,3} {2,3} {1,3} {1,2} {3} {2} {1} Φ (1,a) (2,a) (3,a) (1,b) (2,b) (3,b) (1, Λ )(2, Λ )(3, Λ ) fn 05/01/09 6 Example 1: δ a b Λ Λ * *1 {1,4} Φ Φ {1} 2 Φ {4,5} Φ {2} → 3 {2} Φ Φ {3} *4 {5} {5} Φ {4} → 5 Φ Φ {1,3} {1,3,5 }...
View Full Document

## This note was uploaded on 06/09/2011 for the course COT 4210 taught by Professor Staff during the Spring '08 term at University of Central Florida.

### Page1 / 6

Nfadef - δ is a partial relation on its domain and has...

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

View Full Document
Ask a homework question - tutors are online