18
Human-aware Robo.cs 1 Automata in the Real World 2017/09/28 Maze solver https://stephenwattam.com/projects/maize/ Ø Announcement: q Project announced: due Friday Oct 20, 11:59PM q Poll 2 to be announced q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/CSE355/Lectures/PROJECT.pdf Slides using materials from Steve Wattam & John Vidler at stephenwattam.com

2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

1

Automata in the Real World •  2017/09/28

•  Maze solver

https://stephenwattam.com/projects/maize/

Ø  Announcement: q  Project announced: due Friday Oct 20, 11:59PM

q  Poll 2 to be announced

q  Slides for this lecture are here:

http://www.public.asu.edu/~yzhan442/teaching/CSE355/Lectures/PROJECT.pdf

Slides using materials from Steve Wattam & John Vidler at stephenwattam.com

Page 2: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

2

Last time

FA (DFA & NFA) express Regular Expressions (RE)

•  Context free langauges

o  Context free grammars

o  Pushdown automata

q  Definition of PDA

q  Computation PDA

q  Design of PDA

q  PDA and CFG

q  DPDA vs NPDA

Ø  Goals:

o  Learned how to design PDA

o  Equivalence of PDA and CFG

o  Learned about DPDA

CFL

Page 3: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

3

Outline for today •  Project details

Ø  Goals:

o  Learn to use FA and PDA in

real-world applications

Page 4: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

4

Project: Maze Solving •  Maze

o  Find a path from start to goal

•  Why is it hard?

Page 5: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

5

Project: Maze Solving •  Maze

o  Find a path from start to goal

•  Why is it hard?

o  Limited memory and processing power

Page 6: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

6

Maze solving •  Mice are maze solvers

•  Compete in many competitions, solving

real-life mazes

•  Limited memory and processing power

how does it compare to a FA or PDA?

Page 7: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

7

•  Stateless (reactive) agent: e.g., FA

Maze solving

Page 8: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

8

Maze solving •  Stateful (deliberative) agent: e.g., PDA

Page 9: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

9

Project •  FA implementation

o  The FA controller keeps running until the bot has reached the end of the maze: it has no finishing state.

o  The controller is only reset when it reaches a node that does not have any outgoing transitions.

o  Transitions between states are specified using boolean expressions. If they evaluate to true, the transition can

o  be made.

o  The robot will only move when it is in a state named {F(orward), B(ackword), L(eft), R(ight)}. If no transitions

can be made, the robot will stay in that state.

o  At any step, the controller transitions until reaching an action state (i.e., a state with name in {F, B, L, R}), and

the corresponding movement will be executed.

o  You can have multiple states with the same name; you can have non-action state.

Turns the robot right when there are walls or obstacles ahead and free on the right; otherwise it moves the robot forward

Page 10: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

10

Project •  PDA implementation

o  The FA controller keeps running until the bot has reached the end of the maze: it has no finishing state.

o  The controller is only reset when it reaches a node that does not have any outgoing transitions.

o  The PDA controls the bot by leaving symbols on the stack.

o  You don’t have to read to the end of the tape.

o  The robot will only move when action symbols {F, B, L, R} are left on the stack. If there are multiple action

symbols left, they are executed in reversed order.

o  If no transitions can be made, the robot will stay in that state.

o  At any step, the controller transitions until at least an action symbol is left on the stack, and the corresponding

o  movement(s) will be executed.

o  You can write other symbols onto the stack as well.

Goes forward until it runs against a wall or obstacle and then turn left.

Page 11: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

11

Environment •  Baffle

Page 12: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

12

•  Circle

Environment

Page 13: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

13

•  Depth first search

Environment

Page 14: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

14

Environment •  Empty

Page 15: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

15

•  Line

Environment

Page 16: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

16

•  Regular scatter

Environment

Page 17: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

17

Software tool: Maize (on Blackboard)

Page 18: 2017/09/28 Maze solver …yzhan442/teaching/CSE355/Lectures/...o Pushdown automata q Definition of PDA q Computation PDA q Design of PDA q PDA and CFG q DPDA vs NPDA Ø Goals: o Learned

Human-awareRobo.cs

18

Outline for today

•  Reading assignment for the next class:

o  Sipser Sec. 2.3 – Quiz link will be sent out;

due date is before the beginning of the

next class

o  Sec. 2.4 is optional reading (given what we

have covered about DPDA)

•  Project details

Ø  Goals:

o  Learned to use FA and PDA in

real-world applications