Incomplete Information General Game PlayingLecture 5 Michael Genesereth Spring 2005.

Slides:



Advertisements
Similar presentations
Lisp Control and Data Structures CIS 479/579 Bruce R. Maxim UM-Dearborn.
Advertisements

09 Examples Functional Programming. Tower of Hanoi AB C.
CS 63 LISP Philip Greenspun's Tenth* Rule of Programming:
Heuristic Search CIS 479/579 Bruce R. Maxim UM-Dearborn.
C-LISP. LISP 2 Lisp was invented by John McCarthy in 1958 while he was at the Massachusetts Institute of Technology (MIT).John McCarthyMassachusetts Institute.
Lisp II. How EQUAL could be defined (defun equal (x y) ; this is how equal could be defined (cond ((numberp x) (= x y)) ((atom x) (eq x y)) ((atom y)
Functional Programming. Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends.
1 Programming Languages and Paradigms Lisp Programming.
Lisp II. How EQUAL could be defined (defun equal (x y) ; this is how equal could be defined (cond ((numberp x) (= x y)) ((atom x) (eq x y)) ((atom y)
Common Lisp! John Paxton Montana State University Summer 2003.
CSE 341, S. Tanimoto Pattern Matching - 1 Pattern Matching in Lisp Lists can be used to represent sentences, relations, tree structures, etc. (this list.
PZ10CX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ10CX - LISP Programming Language Design and Implementation.
Introduction to Artificial Intelligence Lisp Ruth Bergman Fall 2002.
Artificial Intelligence and Lisp #12 The Programming Language LISP.
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
CMSC 471 LISP. Why Lisp? Because it’s the most widely used AI programming language Because it’s good for writing production software (Graham article)
CSE S. Tanimoto Explicit Function Application 1 Explicit Application of Functions, Functional Arguments and Explicit Evaluation Implicit and explicit.
Introductory Lisp Programming Lecture # 2 Main Topics –Basic Lisp data types –Lisp primitives –Details of list handling Cons cells (boxes) & their representation.
Artificial Intelligence and Lisp Lecture 6 LiU Course TDDC65 Autumn Semester, 2010
Symbolic Expressions (S Expressions) Syntax: Opening and Closing parenthesis having elements in between. List represented in LISP: (A B2 C3 Shahid) (A.
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2002.
Communication and Cooperation General Game PlayingLecture 8 Michael Genesereth / Nat Love Spring 2006.
Managing Search General Game PlayingLecture 5 Michael Genesereth / Nat Love Spring 2006.
Spring 2008Programming Development Techniques 1 Topic 6 Hierarchical Data and the Closure Property Section September 2008.
LISP 1.5 and beyond A very quick tour. Data Atoms (symbols) including numbers – All types of numbers including Roman! (well, in the early days) – Syntactically.
F UNCTIONAL P ROGRAMMING 05 Functions. F UNCTIONS - G LOBAL F UNCTIONS fboundp Tells whether there is a function with a given symbol as its name > (fboundp.
PRACTICAL COMMON LISP Peter Seibel 1.
Functional Programming Here we briefly look at what functional programming is and why we want to study it –a function, in the mathematical sense, is a.
Common Lisp Macros Read for Input Macros Macro lifetime Macro syntax
1 Lisp Functions –Built-in functions –Defining functions –Function Evaluation and Special Forms defun, if Control statements –Conditional if, cond –Repetition.
Lecture 2-1CS250: Intro to AI/Lisp Intelligent Agents Lecture 3-2 October 14 th, 1999 CS250.
CSC3315 (Spring 2009)1 CSC 3315 Programming Paradigms Scheme Language Hamid Harroud School of Science and Engineering, Akhawayn University
CSE 341, S. Tanimoto Lisp Defining Functions with DEFUN Functions are the primary abstraction mechanism available in Lisp. (Others are structures.
Lisp Files, Arrays, and Macros CIS 479/579 Bruce R. Maxim UM-Dearborn.
LISP Data Types Functional Programming Academic Year Alessandro Cimatti
Introduction to LISP. Lisp Extensible: It lets you define new operators yourself Lisp programs are expressed as lisp data structures –You can write programs.
UMBC CMSC Common Lisp II. UMBC CMSC Input and Output Print is the most primitive output function > (print (list 'foo 'bar)) (FOO BAR) The.
Milos Hauskrecht (PDF) Hieu D. Vu (PPT) LISP PROGARMMING LANGUAGE.
1 Variable Declarations Global and special variables – (defvar …) – (defparameter …) – (defconstant …) – (setq var2 (list 4 5)) – (setf …) Local variables.
Lists CSC 358/ Outline Lab #1 / Homework #1 Lists A question List Internals of Lists List operations Extended Example.
Search as a problem solving technique. Consider an AI program that is capable of formulating a desired goal based on the analysis of the current world.
Propositional Nets General Game PlayingLecture 6 Michael Genesereth Spring 2012.
State Space Search and Planning General Game PlayingLecture 4 Michael Genesereth Spring 2005.
Automated Reasoning General Game PlayingLecture 3 Michael Genesereth Spring 2005.
1 Outline Review Introduction to LISP Symbols and Numbers Lists Writing LISP Functions LISPWorks.
Artificial Intelligence and Lisp Lecture 6 LiU Course TDDC65 Autumn Semester,
Additional Scheme examples
Section 15.4, 15.6 plus other materials
Example of formula (defun roots (a b c) (list
Modern Programming Languages Lecture 20 Fakhar Lodhi
Data Structures in Lisp
Functional Languages Early in AI research, there was a need for symbolic computing handling symbols instead of numbers or strings recursion Design goals.
LISP A brief overview.
Binomial Priority Queues
PZ10CX - LISP Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section Appendix A.6.
Modern Programming Languages Lecture 21 Fakhar Lodhi
What to do when you don’t know anything know nothing
Lisp Tutorial Click on Xlisp icon – you enter the interpreter
Iterative Deepening A* (IDA*) Search: Rough Algorithm from LISP
Modern Programming Languages Lecture 20 Fakhar Lodhi
CSE S. Tanimoto Explicit Function Application
Lisp: Using Functions as Data
LISP A brief overview.
John McCarthy Pioneer in AI Also Lisp Formalize common-sense reasoning
Defining Functions with DEFUN
Abstraction and Repetition
Lisp: Using Functions as Data
Binomial Priority Queues
Modern Programming Languages Lecture 18 Fakhar Lodhi
Common Lisp II.
Presentation transcript:

Incomplete Information General Game PlayingLecture 5 Michael Genesereth Spring 2005

2 Goal States c be f h i dgj a k

3 Simultaneous Actions c be f h i dgj a k b/b b/a a/a b/ba/b b/a a/a a/ba/a a/b a/a a/b a/a b/b a/a b/b a/b b/a

4 Maze World

5 Maze World State Machine

6 Initial State Uncertainty

7 Maze World Percepts

8 Dealing With Incomplete Information Approaches: Coercion Conditional Plans Interleaved Planning and Execution In the face of incomplete information, one searches state set space rather than state space. Representations: Extensive (explicit state sets) Intensional (implicit state sets via properties)

9

10 Tree Expansion function expands (player nodes) (do ((i 1) (node)) ((or (> i nodes) (null (fringe player))) 'done) (setq node (car (fringe player))) (setf (fringe player) (cdr (fringe player))) (unless (score node) (setq i (1+ i)) (setf (fringe player) (nconc (fringe player) (expandnode node))))))

11 Tree Expansion (defun expands (player, nodes) (do ((i 1) (node)) ((or (> i nodes) (null (fringe player))) 'done) (setq node (car (fringe player))) (setf (fringe player) (cdr (fringe player))) (unless (score node) (setq i (1+ i)) (setf (fringe player) (nconc (fringe player) (expandnode node))))))

12 Node Expansion function expand (node) (let (player role data al nl) var player=player(node); var role=role(player) for action in legals(role,node) do old = data(node); data(node) = consaction(role,action,old); data = sort(simulate(node),#'minlessp); data(node) = old; if new = gethash(data,hasher(player)) then new else {new = node(player,data,theory,node); gethash(data,hasher(player)) = new; if termp(new) then score(new)= reward(role,new); (setf (score new) (reward (role player) new))) (setq nl (cons new nl)))) (setq al (acons (car l) new al)))))

13 Node Expansion (defun expandnode (node) (let (player role data) (setq player (player node)) (setq role (role player)) (do ((l (legals role node) (cdr l)) (al) (nl)) ((null l) (setf (alist node) (nreverse al)) (nreverse nl)) (setq old (data node)) (setf (data node) (consaction role (car l) (data node))) (setq data (sort (simulate node) #'minlessp)) (setf (data node) old) (cond ((setq new (gethash data (hasher player)))) (t (setq new (makeminnode player data (theory node) node)) (setf (gethash data (hasher player)) new) (when (termp new) (setf (score new) (reward (role player) new))) (setq nl (cons new nl)))) (setq al (acons (car l) new al)))))

14 Best Move (defun bestmove (node) (do ((l (alist node) (cdr l)) (best) (score)) ((null l) (or best (caar (alist node)))) (setq score (minscores (cdar l))) (cond ((equal score 100) (return (caar l))) ((equal score 0)) ((not best) (setq best (caar l))))))

15 Node Evaluation (defun maxscore (node) (cond ((score node)) ((null (alist node)) nil) (t (do ((l (alist node) (cdr l)) (score) (max 0)) ((null l) max) (setq score (maxscores (cdar l))) (cond ((equal score 100) (return 100)) ((not (numberp score)) (setq max nil)) ((not max)) ((> score max) (setq max score)))))))

16 Natural Deduction