29
Preparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015 271 - fall 2015

Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Preparing for the FinalNov 24, 3:30-4:50, ICS 174

Kalev Kask

ICS 271

Fall 2015

271-fall 2015

Page 2: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Basics

• 1:20 minutes

• closed-book

• 1 (one) sheet of A4 size paper of notes

Page 3: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Material Covered

• Chapters 3-10

– Search

– Games

– Constraint Satisfaction

– Propositional Logic

– First Order Logic

– Classical Planning

Page 4: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Chapters 3,4 (Search) Concepts• Search space : states (initial, goal), actions

• Search tree/graph

• Breadth-first, depth-first, uniform-cost search

– Expanding a node, open (frontier), closed (explored) lists

– Optimality, complexity

– Depth limited search, iterative deepening search

• Heuristic search

– Heuristic fn, admissibility, consistency

– f, h, g, h*, g*

– Heuristic dominance

• Greedy search

• A*, IDA*

• Branch-and-Bound DFS

• Generating heuristics from relaxed problems, pattern databases

• Hill-climbing search, SLS, local vs. global maxima

Page 5: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

1 4

S G

A B

D E

C

F

4.06.710.4

11.0

8.96.9

3.0

S G

A B

D E

C

F

2

2

52 4

3

5

271-Fall 2015

Search Problem

Page 6: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Example of A* Algorithm in Action

7 + 4 = 11

S

A D

B D

C E E

B F

G

2 +10.4 = 12.45 + 8.9 = 13.9

3 + 6.7 = 9.7

8 + 6.9 = 14.9

4 + 8.9 = 12.9

6 + 6.9 = 12.9

11 + 6.7 = 17.7

10 + 3.0 = 13

13 + 0 = 13

Dead End

271-Fall 2015

1 4

SG

A B

D E

C

F

2

2

52 4

3

5S G

A B

D E

C

F

4.06.710.4

11.0

8.96.9

3.0

1

2

3

4

5

6

7

8

Page 7: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Example of Branch and Bound in action

S

A D2+10.4=12.4 5+8.9=13.9

271-Fall 2015

DB 4+8.9=12.9

3+6.7=9.7

1

2

3

EC8+6.9=14.9

7+4=11

4 5

DF

10+8.9=18.912+3=15 6

GL=15+0=15

7

E 6+6.9=12.9

8

9

F10+3=1310

GL=13+0=13

11

B

11+6.7=17.7

1 4A B C

S G

D E F

2

2

5 2 4 3

5

S G

A B

D E

C

F

4.06.710.4

11.0

8.96.9

3.0

Page 8: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Admissible but not consistent

Page 9: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Chapter 5 (Games) Concepts• Game tree

– Players

– Actions/moves

– Terminal utility

– MIN/MAX nodes

• MINIMAX algorithm

• Alpha/Beta pruning

– Effect of node/move ordering on pruning

• Evaluation functions

– Why do we need them?

• Stochastic games

Page 10: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

A Game tree

Page 11: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Another game tree

Page 12: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Answer to Example

3 4 1 2 7 8 5 6

-which nodes can be pruned?

Answer: NONE! Because the most favorable nodes for both are

explored last (i.e., in the diagram, are on the right-hand side).

Max

Min

Max

Page 13: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Answer to Second Example(the exact mirror image of the first example)

6 5 8 7 2 1 3 4

-which nodes can be pruned?

Min

Max

Max

Answer: LOTS! Because the most favorable nodes for both are

explored first (i.e., in the diagram, are on the left-hand side).

Page 14: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Schematic Game Tree for Backgammon Position

• How do we evaluate good move?

• By expected utility leading to expected minimax

• Utility for max is highest expected value of child nodes

• Utility of min-nodes is the lowest expected value of child nodes

• Chance node take the expected value of their child nodes.

• Try Monte-Carlo here!!!

Page 15: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Chapter 6 (CSP) Concepts• Variables, domains, constraints

• A solution : assignment of values to variables so that all constraints are satisfied

• Constraint graph

• Local consistency

– Arc-consistency, path-consistency, k-consistency

• Backtracking search (Q : how is BT search different from DFS?)

– Variable, value ordering heuristics

• Interleaving search and inference

– E.g. BT with arc-consistency

• Back-jumping, no-good learning

• Greedy local search

– Min-conflicts

• Tree-structured CSPs

• Cut-set conditioning, tree-decomposition

Page 16: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Arc-consistency

32,1,

32,1, 32,1,

1 X, Y, Z, T 3

X Y

Y = Z

T Z

X T

X Y

T Z

32,1,

=

Page 17: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

A Constraint problem

Page 18: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

The effect of variable orderingz divides x, y and t

Page 19: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Backtracking Search for a Solution

Page 20: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Min-Conflicts

QQ

QQ

1X

4X

3X

2X

1 2 3 4

At each step, find globally minimizing move!

Page 21: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Chapter 7 (Prop Logic) Concepts• Syntax

– Propositional symbols

– Logical connectives

• Semantics

– Worlds, models

– Entailment

– Inference

• Model checking

• Modus Ponens

• CNF

• Horn clauses, Forward/Backward chaining

• Resolution

• DPLL backtracking search

Page 22: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Forward chaining

• Idea: fire any rule whose premises are satisfied in the KB,

– add its conclusion to the KB, until query is found

Page 23: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Backward chaining example

Page 24: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Chapters 8,9 (FOL) Concepts

• Syntax

– Variables, const symbols, fn symbols, predicate symbols

– Terms, atomic sentences

– Quantifiers

• Semantics

– Model, interpretation

– Entailment

– Inference

Page 25: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Chapters 8,9 (FOL) Concepts cont.

• Universal, existential instantiation

• Unification

• Generalized Modus Ponens

• Definite clauses, Forward/Backward chaining

• Converting a FOL sentence to CNF

• Resolution

– Answer extraction

Page 26: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

FOL Resolution Problem

(d) Use resolution-answer-extraction to find a particular object that is green

Page 27: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Chapter 10 (Planning) Concepts• Planning as inference, situation calculus

– States, actions, frame axioms

• STRIPS (PDDL) language

– Factored representation of states

– Actions (schema) : PC, AL/DL (EL)

• Planning as search

– Recursive STRIPS

– Forward/Backward

• Heuristics for planning, relaxed problem idea

– Ignore PC, DL

– Abstraction

• Planning graphs : construction, properties, GraphPlan

• Planning as satisfiability

Page 28: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

STRIPS/PDDL

Page 29: Preparing for the Final Nov 24, 3:30-4:50, ICS 174kkask/Fall-2015 CS271/slides/10-final-preparation.pdfPreparing for the Final Nov 24, 3:30-4:50, ICS 174 Kalev Kask ICS 271 Fall 2015

Planning as Satisfiability• Propositionalize actions

• Define initial state (F/F for everything known)

• Propositionalize the goal

• Add successor-state axioms; for each fluent F

– Ft+1 ActionCausesFt (Ft ActionCausesNotFt)

• Add precondition axioms

– At Preconditions(At)

• Add action exclusion axioms

– Exactly one action at a time (can have NoOP)