lect2-fa1

lect2-fa1 - FiniteAutomata Motivation AnExample 1...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Finite Automata Motivation An Example
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Informal Explanation Finite automata are finite collections of  states with transition rules that take you  from one state to another. Original application was sequential  switching circuits, where the “state” was  the settings of internal bits. Today, several kinds of software can be  modeled by FA.
Background image of page 2
3 Representing FA Simplest representation is often a  graph. Nodes = states. Arcs indicate state transitions. Labels on arcs tell what causes the  transition.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Example : Recognizing Strings  Ending in “ing” nothing Saw  i i Not  i Saw  ing g i Not  or  g Saw  in n i Not  or  n Start
Background image of page 4
5 Automata to Code In C/C++, make a piece of code for  each state.  This code: 1. Reads the next input. 2. Decides on the next state. 3. Jumps to the beginning of the code for  that state.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Example : Automata to Code 2: /* i seen */ c = getNextInput(); if (c == ’n’) goto 3; else if (c == ’i’) goto 2; else goto 1; 3: /* ”in” seen */ . . .
Background image of page 6
7 Automata to Code – Thoughts
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/30/2012 for the course CS 154 taught by Professor Motwani,r during the Spring '08 term at Stanford.

Page1 / 22

lect2-fa1 - FiniteAutomata Motivation AnExample 1...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online