..........................................NEXT PREVIOUS INDEX
L04 FSA: Formal Def. Finite State Machine: Formal Definition o A deterministic finite-state machine formally is - Q: A finite set of states (Ex.:{q0,q1,q2}) - SIGMA: A finite set of input alphabet (Ex.: {a,b,c}) - Start state: A state in Q, from which machine starts (Ex.: q0) - F: A set of accepting states (Ex.: {q2}) - DELTA (q,i): A transition function or transition matrix where: - q MEMBER Q, i MEMBER SIGMA, - DELTA(q,i) MEMBER Q Thus, DELTA(q,i): Q x SIGMA --> Q o Above is 'deterministic' because DELTA is a function not a relation. There is a unique state after each transition. o To recognize a given input sentence: * Call RECOGNIZE (start-state, given input string) o Recognition algorithm: RECOGNIZE (q, s) * Current state: cur-q = q; remaining-input: rem = s. * LOOP: Repeat the following while rem is non-empty. - Examine first symbol in rem and make a transition to q' (where q' = DELTA (cur-q, first(rem)) cur-q = q' - Now continue with the remaining input: rem = rest(rem) * go LOOP; * End of loop * If cur-q is an accepting state, output ACCEPT - else output REJECT...........................................NEXT PREVIOUS INDEX