* Lecture - Regular Languages S Lecture - Fnte Automata where A fnte automaton s a -tuple s a fnte set called the states s a fnte set called the alphabet s the transton functon s the ntal state s the set of acceptng states s accepted such that be an FA A strng f there exsts a seuence for every of states n Let by S Lecture - s the notated as The language recognzed (or accepted by language over such that accepts over (* for every strng Example A FA that recognzes the language over consstng of all the strngs wth an even number of s an even number of s S Lecture - Regular Languages be two languages Defne Let or ' s Unon of ' s ( oncatenaton of '- s Star of The class of regular languages s the class of languages recognzed by fnte automata S Lecture -
8 8 = < 7 * 9 > > 9 > ' ' = ( Nondetermnstc Fnte Automata A nondetermnstc fnte automaton s a -tuple where now s a mappng of to the power set of the collecton of all subsets of where e states that upon readng each can go from to any state n For each an s accepted by f there exsts a seuence of states n a representaton over for every A strng 6 of 6 such that S Lecture - Example of NFA An NFA that recognzes the language over that conssts of all strngs such that s ether a multple of or a multple of r r r S Lecture - 6 FA = NFA Theorem Every NFA can be converted an euvalent FA be an NFA Defne a FA Proof Let by 9 ; ' *> B A? @ > 8 for each s the set of all states that can go to from one of the upon recevng symbol So over s accepted by f takes from the state to a subset of contanng an (the set of such subsets s Here states n only f element n S Lecture - 7 Regular Expresson s s a regular expresson f An expresson n some alphabet for some for some regular expressons or for some regular expressons for some regular expresson * 6 S Lecture - 8
Fnte Automata are euvalent to Regular Expressons Ths reures proofs n both drectons FA Every regular expresson descrbes a NFA Lemma (REXPR regular language Proof Each set consstng only of a sngle letter s regular the set consstng only of the empty strng s regular the empty set s regular fnal states Let be a FA wth ntal state onstruct an NFA wth ntal state fnal states D ; to -move to Unon has an oncatenaton of to -move from each an to -move from each an Star of Step ombne multple labels (a For every transton label label k j n the NFA change t to S Lecture - 9 label label k j a regular expresson so we call the resultng automaton a GENERALIZED NFA (GNFA Lemma (FA NFA REXPR Every regular language s descrbed by some regular expresson Proof (Sketch We want to get from an FA to a regular expresson Step hange an FA for any gven regular language to an euvalent NFA wth a new start state a new unue acceptng state usng -transtons HANGE TO NFA FA S Lecture - S Lecture - (b For every par of transtons (whle there reman such pars label j label n the GNFA change these to label label j S Lecture -
Step Elmnate ( rp out successve states of the GNFA (other than replacng lost -step paths by -step paths we generally lose some local paths @ E Ie when we elmnate a state of the form label rp label j may be the same or dstnct j label the self loop may or may not be present For each such local path (a nsert a sngle arrow labeled lke ths label (label label j * S Lecture - (b If there was already a transton label j merge the two arrows nto F to from ( label (label * label label j S Lecture - Result regular expresson the language recognzed by the The regular expresson descrbes orgnal FA Showng ths reures an nductve proof that at each step of the converson the resultng GNFA stll accepts exactly the same nput seuences as before We ll omt further detals S Lecture - REXPR Example of FA A FA that recognzes the language over that conssts of all strngs wth no solated s e wherever there s a there s another adjacent on ts left or rght S Lecture - 6
Steps combned labels S Lecture - 7 Step Rp there are local paths to replace * * * * combned labels S Lecture - 8 Step contnued Rp there are local paths to replace * * ( * * combned labels * * S Lecture - 9 so t just dsappears G Step contnued Rp there are no local paths through G there s local path to replace H Rp ( * (( * * ( * * S Lecture -
* Step concluded ombne labels * ( * (( * * ( * * Not as smple as t mght be S Lecture -