80 likes | 94 Views
Lecture 2 Finite Automata. Jan Maluszynski , IDA, 200 7 http://www.ida.liu.se/~janma janma @ ida.liu.se. Deterministic Finite Automata. DFA A is defined as ( Q , , , q 0 , F ) Q States Alphabet Transition function : Q Q Initial state q 0 Q
E N D
Lecture 2Finite Automata Jan Maluszynski, IDA, 2007 http://www.ida.liu.se/~janma janma @ ida.liu.se Jan Maluszynski - HT 2007
Deterministic Finite Automata DFA A is defined as (Q, , , q0, F) • Q States • Alphabet • Transition function : Q Q • Initial state q0 Q • Final (accept) states: F Q A moves from state to state on input strings: next state unique for given symbol and state A accepts s iff s brings A from q0 to some final state. The language L(A) is the set of accepted strings Jan Maluszynski - HT 2007
Nondeterministic Finite Automata NFA M is defined as (Q, , , q0, F) • Q States • Alphabet • Transition function : Q {} P(Q) InqM can move on input c to any of the states in (q,c) • Initial state q0 Q • Final (accept) states: F Q M accepts s iff s can bring M from q0 to some final state. Jan Maluszynski - HT 2007
DFA vs. NFA Finite automata M and N are equivalent iff L(M)=L(N) For every NFA there exists an equivalent DFA. (see the construction pp. 54-58). For every FA there exists a unique DFA (up to renaming of states) with a minimal number of states (the construction not discussed in the book) Jan Maluszynski - HT 2007
Regular languages Definition: A language is regular iff it is accepted by a Finite Automaton Regular languages are closed under • Union • Kleene Star • Concatenation • Intersection Jan Maluszynski - HT 2007
Proving closure properties • Construct NFA’s for basic automata • Construct combinations of NFA’s for • Concatenation • Union • Kleene star pp.59-63 • Construct product of DFA’s for proving closure under intersection. p.45 Jan Maluszynski - HT 2007