Deterministic Finite-State Machine (or Deterministic Finite Automaton)

3
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ: a finite set of symbols called the alphabet T: a transition function (T : S × Σ → S) s: a start state (s S) A: a set of accept states (A S) Let M be a DFA such that M = (S, Σ, T, s, A), and X = x 0 x 1 ... x n be a string over the alphabet Σ. M accepts the string X if a sequence of states, r 0 ,r 1 , ..., r n , exists in S with the following conditions: 1. r 0 = s 2. r i +1 = T(r i , x i ), for i = 0, ..., n-1 3. r n A.

description

Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ: a finite set of symbols called the alphabet T: a transition function (T : S × Σ → S) s: a start state (s  S) - PowerPoint PPT Presentation

Transcript of Deterministic Finite-State Machine (or Deterministic Finite Automaton)

Page 1: Deterministic Finite-State Machine (or Deterministic Finite Automaton)

Deterministic Finite-State Machine (or Deterministic Finite Automaton)

A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of:

S: a finite set of states

Σ: a finite set of symbols called the alphabet

T: a transition function (T : S × Σ → S)

s: a start state (s S)

A: a set of accept states (A S)

Let M be a DFA such that M = (S, Σ, T, s, A), and X = x0x1 ... xn be a string over the alphabet Σ. M accepts the string X if a sequence of states, r0,r1, ..., rn, exists in S with the following conditions:

1. r0 = s

2. ri+1 = T(ri, xi), for i = 0, ..., n-1

3. rn A.

Page 2: Deterministic Finite-State Machine (or Deterministic Finite Automaton)

Every Regular Expression can be Recognized by some DFA

• Regular expressions consist of constants and operators that denote sets of strings and operations over these sets, respectively.

• Given a finite alphabet Σ the following constants are defined:– (empty set) ∅– (empty string) ε – (literal character) a in Σ

• The following operations are defined:– concatenation– alternation: a|b– Replication: R* – Wildcard: . (exactly one occurrence)

Page 3: Deterministic Finite-State Machine (or Deterministic Finite Automaton)

Classical Limitation of DFA

no DFA can recognize is bracket language, that is language that consists of properly paired brackets, such as (()()).

More formally the language consisting of strings of the form anbn — some finite number of a's, followed by an equal number of b's. It can be shown that no DFA can have enough states to recognize such a language.