Deterministic Finite Automata And Regular Languages Costas Busch
Deterministic Finite Automata And Regular Languages Costas Busch - LSU 1
Deterministic Finite Automaton (DFA) Input Tape String Output Finite Automaton Costas Busch - LSU “Accept” or “Reject” 2
Transition Graph initial state transition Costas Busch - LSU accepting state 3
Alphabet For every state, there is a transition for every symbol in the alphabet Costas Busch - LSU 4
Initial Configuration Input Tape Input String Initial state Costas Busch - LSU 5
Scanning the Input head Costas Busch - LSU 6
Costas Busch - LSU 7
Costas Busch - LSU 8
Input finished accept Last state determines the outcome Costas Busch - LSU 9
A Rejection Case Input String Costas Busch - LSU 10
Costas Busch - LSU 11
Costas Busch - LSU 12
Input finished reject Last state determines the outcome Costas Busch - LSU 13
Another Rejection Case Tape is empty Input Finished (no symbol read) reject Costas Busch - LSU 14
This automaton accepts only one string Language Accepted: Costas Busch - LSU 15
To accept a string: all the input string is scanned and the last state is accepting To reject a string: all the input string is scanned and the last state is non-accepting Costas Busch - LSU 16
Another Example Accept state Costas Busch - LSU Accept state 17
Empty Tape Input Finished accept Costas Busch - LSU 18
Another Example Accept state Costas Busch - LSU trap state 19
Input String Costas Busch - LSU 20
Costas Busch - LSU 21
Costas Busch - LSU 22
Input finished accept Costas Busch - LSU 23
A rejection case Input String Costas Busch - LSU 24
Costas Busch - LSU 25
Costas Busch - LSU 26
Input finished reject Costas Busch - LSU 27
Language Accepted: Costas Busch - LSU 28
Another Example Alphabet: Language Accepted: Costas Busch - LSU 29
Formal Definition Deterministic Finite Automaton (DFA) : set of states : input alphabet : transition function : initial state : set of accepting states Costas Busch - LSU 30
Set of States Example Costas Busch - LSU 31
Input Alphabet : the input alphabet never contains empty string Example Costas Busch - LSU 32
Initial State Example Costas Busch - LSU 33
Set of Accepting States Example Costas Busch - LSU 34
Transition Function Describes the result of a transition from state with symbol Costas Busch - LSU 35
Example: Costas Busch - LSU 36
Costas Busch - LSU 37
Costas Busch - LSU 38
Transition Table for states symbols Costas Busch - LSU 39
Extended Transition Function Describes the resulting state after scanning string from state Costas Busch - LSU 40
Example: Costas Busch - LSU 41
Costas Busch - LSU 42
Costas Busch - LSU 43
Special case: for any state Costas Busch - LSU 44
In general: implies that there is a walk of transitions states may be repeated Costas Busch - LSU 45
Language Accepted by DFA Language accepted by DFA : it is denoted as and contains all the strings accepted by We also say that recognizes Costas Busch - LSU 46
For a DFA Language accepted by : Costas Busch - LSU 47
Language rejected by : Costas Busch - LSU 48
More DFA Examples Empty language All strings Costas Busch - LSU 49
Language of the empty string Costas Busch - LSU 50
= { all strings with prefix } accept Costas Busch - LSU 51
= { all binary strings containing substring } Costas Busch - LSU 52
= { all binary strings without substring } Costas Busch - LSU 53
Costas Busch - LSU 54
Regular Languages Definition: A language is regular if there is a DFA that accepts it ( ) The languages accepted by all DFAs form the family of regular languages Costas Busch - LSU 55
Example regular languages: { all strings in {a, b}* with prefix } { all binary strings without substring } There exist DFAs that accept these languages (see previous slides). Costas Busch - LSU 56
There exist languages which are not Regular: There are no DFAs that accept these languages (we will prove this later) Costas Busch - LSU 57
- Slides: 57