Equivalence, DFA, NDFA - PowerPoint PPT Presentation

1 / 51
About This Presentation
Title:

Equivalence, DFA, NDFA

Description:

Recognizer. If x I ... the application of x to the recognizer results in a final state F, then ... x, Is Accepted by a Recognizer Left-most Letter First, i.e. ... – PowerPoint PPT presentation

Number of Views:270
Avg rating:3.0/5.0
Slides: 52
Provided by: TeaL7
Category:

less

Transcript and Presenter's Notes

Title: Equivalence, DFA, NDFA


1
Equivalence, DFA, NDFA
  • ECE-548 Sequential Machine Theory
  • Prof. K. J. Hintz
  • Department of Electrical and Computer Engineering
  • Lecture 2

2
Equivalence Relation on A
  • An Equivalence Relation (Not Relationship) Is Not
    an Equality Relation
  • A Relation is an Equivalence Relation if and only
    if (iff) it is
  • Reflexive
  • Symmetric
  • Transitive

3
Equivalence Relation on A
4
Non-Algebraic Equivalence Relation Example
  • Equivalence Relation on the Set of All Triangles
    on a Plane
  • is congruent to or is similar to
  • Reflexive, each triangle is similar to itself,

5
Equivalence Relation Example
  • Symmetric, if
  • is similar to
  • then
  • is similar to

6
Equivalence Relation Example
  • Transitive, if
  • is similar to
  • and
  • is similar to
  • then
  • is similar to

7
Inclusion Relation
8
Inclusion Relation Example
9
Partition Notation
  • Overbar Indicates States Which Are Elements of
    the Same ?-block.
  • Single States Are Not Normally Listed

10
Relations May Be Orderings
  • Partial Ordering
  • Total Ordering, aka Chain
  • Well Ordering (not discussed here)

11
Partial Ordering
  • Given an Inclusion Relation, R s ? s, Defined
    on some Elements of the Set S such that s, s ?
    S, R Is a Partial Ordering If It Is
  • Reflexive
  • Anti-Symmetric (asymmetric)
  • Transitive
  • Not all orderings are specified, therefore partial

12
Properties of PO
  • Reflexive
  • s ? s for all s ? S
  • Anti-Symmetric (asymmetric)

e.g., let ? older than if Sam is older than
Bill, then Bill cannot be older than Sam
13
Properties of PO
  • Transitive

e.g., If the Redskins beat the Patriots and the
Patriots beat the Cowboys then the Redskins will
beat the Cowboys
14
Total Ordering
  • aka
  • Chain, simply ordered set, totally ordered set
  • A Partial Ordering for Which All Orderings Are
    Specified
  • A Chain Is Connected Because

15
POSET
  • Partially Ordered SET
  • A set on which a partial ordering is specified
  • ( S, ? ) where ? is defined
  • Not a chain since not all elements are connected
  • We Will Revisit This Concept in the Second Half
    of the Course

16
Finite Automata
  • A Deterministic semi-automaton, aka Completely
    Specified Deterministic Semi-automaton Is a
    Triple
  • with no Mealy machine output function, Beta (?)

Ginzburg, 1968
17
FSM Set Properties
I
ib
sa
sc
S
18
Language Recognizer
  • aka, Rabin-Scott Automata (machine), Automaton,
    Language Recognizer
  • A Recognizer Is a Quintuple of Sets
  • with S, I, ? as before

19
Kleene Star
  • a e, a, aa, aaa, aaaa, ...
  • The Kleene Star, , means NONE or more
    occurrences of something
  • Star is an overloaded operator so be aware of
    context
  • a ONE or more occurrences of something.
  • a is Kleene Star less the null string, ?.

20
Kleene Closure
  • Kleene Closure Is Not Identical to Kleene Star
  • Symbol is the same (overloaded)
  • Kleene Closure/Star Closure
  • Found in descriptions of formal language
  • Language consisting of all strings over some
    alphabet

21
String
  • An Ordered Concatenation of Symbols From an
    Alphabet
  • Used in Place of Word to Decouple From Common
    Concept of Word in Informal Language
  • If ? a, 1, 0, b, then a 10b is a
    string.

22
Recognizer
  • If x ? I,
  • i.e., a string of input symbols selected from
    the set of allowable input symbols,
  • and
  • the application of x to the recognizer results
    in a final state ? F,
  • then
  • the recognizer accepts the string.

23
Strings
  • A String, x, Is Accepted by a Recognizer
    Left-most Letter First, i.e.,
  • if
  • the input to a recognizer is a string w,
  • and if
  • w ? w
  • then
  • ? is the first letter of the string which causes
    a state transition. Subsequent letters from left
    to right do the same.

24
State Transition
  • Let There Be Two Configurations for a Machine

?1
q
q
S
25
String Example
  • Let
  • w a b b a
  • then
  • w a w
  • and
  • w b b a

26
Recognizer as Directed Graph
  • Arbitrary State
  • State Transition
  • Start (initial) State
  • Final State

?1
q
-
or
or

27
Recognizer Examples
  • Let I a, b
  • Accepts no strings since no final state
  • Accepts all strings
  • Dead State

a, b
28
Recognizer Examples
  • Accepts only ?, the null string

29
Recognizer Example
  • This Recognizer Accepts the Language
  • L ab, a (aa) b, a (aa) (aa) b, ...
  • ab (bb), ab (bb) (bb), ... , etc.
  • L a (aa) b ( b (aa) b )

30
Rabin-Scott Example

31
Rabin-Scott Example
  • L (M) x ? I ? ( 1, x ) 4
  • L (M) a , aa , aaa , ...

1
32
Non-Deterministic FSM
  • A Non-deterministic Finite Automata Is a
    Quintuple with S, I, s0, F
  • as in a recognizer, but,

33
Non-Deterministic FSM
  • State May Change
  • to two different states in response to the same
    input at the same state
  • in response to a string rather than just a single
    element from the set of inputs
  • in response to a null string input

34
DFA-NDFA Theorem
  • Every NDFA Can Be Replaced by an Equivalent DFA
  • Equivalent Means Not Only Accepting All Strings
    Accepted by the NDFA, but Also NOT Accepting Any
    Others

35
NDFA Example
  • Non-deterministic Since
  • ( ( 1, a ), 2 ) and ( ( 1, a ), 3 )

1
36
NDFA Example
  • Non-deterministic Since Not Completely Specified

ab
1
abb
37
NDFA Example
  • Non-deterministic Since State Changes in Response
    to a Null String.

38
NDFA to DFA
  • Theorem
  • For each NDFA there is an equivalent DFA
  • Constructive Proof
  • 4 Difficulties to Resolve
  • Missing transitions
  • Single transitions due to strings gt 1
  • Transitions due to ? strings
  • Multiple transitions

39
Problem Missing Transitions
  • I a, b
  • In DFA, all i ? I must be accounted for in each
    state

?
40
Solution Missing Transitions
  • Add a sink state which is not a final state and
    terminate all missing transitions there.

41
Problem strings gt 1
  • Single transition due to string of size gt 1
  • Add intermediate states and sink, other
    characters in those states go to sink state

42
Problem ? Strings
  • Cant just combine states since

b
b
b
a
a
b
43
Solution ? Strings Multiple Transitions
  • Eliminate ? by defining the set of next states
    which occur in response to no input, call this
    function E( ? )
  • E( ? ) is called the equivalents of ( ? )

44
NDFA Example

45
State Equivalents
  • E( 1 ) self, explicit alternative 1, 3
  • E( 2 ) 2
  • E( 3 ) 3
  • E( 4 ) 4
  • Define a new machine based on the old using the
    E( ? ) states

46
New Machine
47
New Machine Transition Table
48
New Machine Transition Table
49
New Machine Transition Table
50
DFA Equivalent of NDFA
51
Reduced DFA Equivalent
Write a Comment
User Comments (0)
About PowerShow.com