Automata Theory Why Study Automata? What the Course is About 1 - - PowerPoint PPT Presentation

automata theory
SMART_READER_LITE
LIVE PREVIEW

Automata Theory Why Study Automata? What the Course is About 1 - - PowerPoint PPT Presentation

Automata Theory Why Study Automata? What the Course is About 1 Why Study Automata? A survey of Stanford grads 5 years out asked which of their courses did they use in their job. Basics like intro-programming took the top spots, of course.


slide-1
SLIDE 1

1

Automata Theory

Why Study Automata? What the Course is About

slide-2
SLIDE 2

2

Why Study Automata?

A survey of Stanford grads 5 years out asked which of their courses did they use in their job. Basics like intro-programming took the top spots, of course. But among optional courses, CS154 stood remarkably high.

3X the score for AI, for example.

slide-3
SLIDE 3

3

How Could That Be?

Regular expressions are used in many systems.

E.g., UNIX a.*b. E.g., DTD’s describe XML tags with a RE format like person (name, addr, child*).

Finite automata model protocols, electronic circuits.

slide-4
SLIDE 4

4

How? – (2)

Context-free grammars are used to describe the syntax of essentially every programming language.

Not to forget their important role in describing natural languages.

And DTD’s taken as a whole, are really CFG’s.

slide-5
SLIDE 5

5

How? – (3)

When developing solutions to real problems, we often confront the limitations of what software can do.

Undecidable things – no program whatever can do it. Intractable things – there are programs, but no fast programs.

Automata theory gives you the tools.

slide-6
SLIDE 6

6

Other Good Stuff

We’ll learn how to deal formally with discrete systems.

Proofs: You never really prove a program correct, but you need to be thinking of why a tricky technique really works.

We’ll gain experience with abstract models and constructions.

Models layered software architectures.

slide-7
SLIDE 7

7

Automata Theory – Gateway Drug

This theory has attracted people of a mathematical bent to CS, to the betterment of all.

Ken Thompson – before UNIX was working

  • n compiling regular expressions.

Jim Gray – thesis was automata theory before he got into database systems and made fundamental contributions there.

slide-8
SLIDE 8

8

Course Outline

Regular Languages and their descriptors:

Finite automata, nondeterministic finite automata, regular expressions. Algorithms to decide questions about regular languages, e.g., is it empty? Closure properties of regular languages.

slide-9
SLIDE 9

9

Course Outline – (2)

Context-free languages and their descriptors:

Context-free grammars, pushdown automata. Decision and closure properties.

slide-10
SLIDE 10

10

Course Outline – (3)

Recursive and recursively enumerable languages.

Turing machines, decidability of problems. The limit of what can be computed.

Intractable problems.

Problems that (appear to) require exponential time. NP-completeness and beyond.

slide-11
SLIDE 11

11

Finite Automata

What Are They? Who Needs ‘em? An Example: Scoring in Tennis

slide-12
SLIDE 12

12

What is a Finite Automaton?

A formal system. Remembers only a finite amount of information. Information represented by its state. State changes in response to inputs. Rules that tell how the state changes in response to inputs are called transitions.

slide-13
SLIDE 13

13

Why Study Finite Automata?

Used for both design and verification of circuits and communication protocols. Used for many text-processing applications. An important component of compilers. Describes simple patterns of events, etc.

slide-14
SLIDE 14

14

Tennis

Like ping-pong, except you are very tiny and stand on the table. Match = 3-5 sets. Set = 6 or more games.

slide-15
SLIDE 15

15

Scoring a Game

One person serves throughout. To win, you must score at least 4 points. You also must win by at least 2 points. Inputs are s = “server wins point” and o = “opponent wins point.”

slide-16
SLIDE 16

16

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
slide-17
SLIDE 17

17

Acceptance of Inputs

Given a sequence of inputs (input string ), start in the start state and follow the transition from each symbol in turn. Input is accepted if you wind up in a final (accepting) state after all inputs have been read.

slide-18
SLIDE 18

18

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-19
SLIDE 19

19

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-20
SLIDE 20

20

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-21
SLIDE 21

21

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-22
SLIDE 22

22

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-23
SLIDE 23

23

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-24
SLIDE 24

24

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-25
SLIDE 25

25

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-26
SLIDE 26

26

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-27
SLIDE 27

27

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-28
SLIDE 28

28

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-29
SLIDE 29

29

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-30
SLIDE 30

30

Example: Processing a String

Love Start Love-15 15-Love s

  • Love-30

15-all 30-Love s s

  • Love-40

15-30 30-15 40-Love s s s

  • Server

Wins Opp’nt Wins s

  • 40-15

15-40 30-all s s s

  • 30-40

40-30 s s s

  • deuce

s s

  • Ad-out

Ad-in s

  • s
  • s
  • s o s o s o s o s o s s

*

slide-31
SLIDE 31

31

Language of an Automaton

The set of strings accepted by an automaton A is the language of A. Denoted L(A). Different sets of final states -> different languages. Example: As designed, L(Tennis) = strings that determine the winner.

slide-32
SLIDE 32

32

Text (Not Required)

Hopcroft, Motwani, Ullman, Automata Theory, Languages, and Computation 3rd Edition. Course covers essentially the entire book.