Propositional Nets General Game PlayingLecture 6 Michael Genesereth Spring 2012.

Slides:



Advertisements
Similar presentations
CSE 311 Foundations of Computing I
Advertisements

CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
ECE 667 Synthesis & Verification - Boolean Functions 1 ECE 667 Spring 2013 ECE 667 Spring 2013 Synthesis and Verification of Digital Circuits Boolean Functions.
Equivalence, DFA, NDFA Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 2 Updated and modified by.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Boolean Functions and their Representations
LEARNING FROM OBSERVATIONS Yılmaz KILIÇASLAN. Definition Learning takes place as the agent observes its interactions with the world and its own decision-making.
Basic Register Typically, we store multi-bit items
Let remember from the previous lesson what is Knowledge representation
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Propositional Calculus Math Foundations of Computer Science.
Metagaming General Game PlayingLecture 5 Michael Genesereth Spring 2012.
Propositional Equivalence Goal: Show how propositional equivalences are established & introduce the most important such equivalences.
Boolean Logic & Truth Tables In today’s lesson we will look at: a reminder about truth values and NOT, AND, OR and EOR truth tables operator precedence.
Chapter Introduction to Computers and Programming 1.
Themes of Presentations Rule-based systems/expert systems (Catie) Software Engineering (Khansiri) Fuzzy Logic (Mark) Configuration Systems (Sudhan) *
Finite-State Machines with No Output
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Chapter 1: Introduction to Computers and Programming.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
Truth Functions Relationships A function is a relation that links members of sets. The set of all x which are in relation R with some y is called the.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
CS6133 Software Specification and Verification
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Logic (continuation) Boolean Logic and Bit Operations.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CS1372: HELPING TO PUT THE COMPUTING IN ECE CS1372 Some Basics.
Mathematical Preliminaries
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Systems Analysis and Design in a Changing World, Fourth Edition
NP-completeness Section 7.4 Giorgi Japaridze Theory of Computability.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Propositional Logic – The Basics (2) Truth-tables for Propositions.
28.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
MECH 1500 Chapter 4. MECH 1500 The Binary Concept 4.1.
Logic Gates and Boolean Algebra Introduction to Logic II.
Turing Machine Model Are there computations that no “reasonable” computing machine can perform? –the machine should not store the answer to all possible.
Mealy and Moore Machines Lecture 8 Overview Moore Machines Mealy Machines Sequential Circuits.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
1 Semester © Michael Thielscher, Michael Genesereth 2011 General Game Playing Intelligent Agents for eMarkets Prof Michael Thielscher Adjunct.
Everything is a number Everything in a computer memory and on storages is a number. Number  Number Characters  Number by ASCII code Sounds  Number.
Logic Gates and Boolean Algebra
Thinking Mathematically
Game Description General Game Playing Lecture 3
COMP541 Sequential Logic – 2: Finite State Machines
EA C461 – Artificial Intelligence Logical Agent
Jaya Krishna, M.Tech, Assistant Professor
Intro to Theory of Computation
Truth Functions.
Propositional Calculus: Boolean Algebra and Simplification
Information Technology Department
Pruning Techniques General Game Playing Lecture 8
Introduction to Sequential Circuits
Disjunctive Normal Form
More Metagaming General Game Playing Lecture 7
Game Reformulation General Game Playing Lecture 7
Dichotomies in CSP Karl Lieberherr inspired by the paper:
Programming Techniques :: Logic & Truth Tables
Lecture 23 NP-Hard Problems
Presentation transcript:

Propositional Nets General Game PlayingLecture 6 Michael Genesereth Spring 2012

2 Metagaming Metagaming is match-independent game processing, i.e. game processing that is done independent of any particular opponent or any particular state. Objective of metagaming - to optimize performance in playing specific matches of the game. Usually done offline, i.e. during the startclock or between moves or in parallel or interleaved with regular game play.

3 Examples Boring: Headstart on Game-Graph Search Endgame book Structural: Change of Framework (e.g. state machines to propnets) Game Reformulation (e.g. game decomposition) Engineering: Compilation (machine language, fpga’s)

4 Benefits Methods discussed so far take time proportional to the size of the game graph. Propositional nets can be processed in time proportional to the size of the game graph but with much lower coefficient. Propositional Nets can be exponentially smaller. They lend themselves to analysis and many properties can be discovered in time proportional to this smaller size instead of the size of the game graph.

5 Games as State Machines s3s3 s2s2 s5s5 s6s6 s8s8 s9s9 s4s4 s7s7 s 10 s1s1 s 11 bb ba aa bbab ba aa ab aa ab aa ab aa bb aa bb ba ab

6 States versus Features In many cases, worlds are best thought of in terms of features, e.g. red or green, left or right, high or low. Individual actions often affect individual features or small subsets fo features. States represent all possible ways the world can be. As such, the number of states is exponential in the number of “features” of the world, and the action tables are correspondingly large. Idea - represent features directly and describe how actions change individual features rather than entire states. (Reference: S TRIPS.)

7 Tictactoe Example cell(1,1,x)cell(1,2,b) cell(1,3,b)cell(1,3,o) cell(2,1,b) blackcell(2,1,b)cell(2,2,o) cell(2,3,b) mark(1,3)cell(2,3,b)cell(3,1,b)cell(3,2,b)cell(3,3,x) control(black)control(white) next(cell(M,N,o)) :- does(black,mark(M,N)) & true(cell(M,N,b))

8 s Decompose states into “propositions”. Benefit - n propositions can represent 2 n states. Propositions qp r s1s1

9 Connectives Transitions Propositional Net Components pqr

10 Propositional Net q p r

11 Propositional Net q p r Input Proposition View Proposition Base Proposition

12 Markings A marking for a propositional net is a function from the propositions P to boolean values. m: P  {true,false} A marking m is partial if and only if m is a partial function. Otherwise, it is total. Think of a marking as a state of a game.

13 Acceptability A marking is acceptable if and only if it obeys the logical properties of all connectives. Negation with input x and output y: m(x)=false  m(y)=true Conjunction with inputs x and y and output z: m(x)=true  m(y)=true  m(z)=true Disjunction with inputs x and y and output z: m(x)=true  m(y)=true  m(z)=true

14 Definitions A transition is enabled by a marking m if and only if all of its inputs are marked true. The transitional marking for m is the partial marking that assigns true to the base propositions that are outputs of transitions enabled by m and false to the outputs of all other base propositions. An input marking for a propositional net is a marking for the input propositions.

15 Update The update m’ of a marking m (with transitional marking t) and input marking i is any acceptable marking consistent with t and i. Algorithm for update: (1) Given m, compute enabled transitions and form a transitional marking t. (2) Take as input an input marking i. (3) Erase all marks from propnet. (4) Compute acceptable marking m’ from t and i using the rules of acceptability. Theorem: This algorithm produces exactly one update for each initial marking and input marking.

16 Example

17 Buttons and Lights Pressing button a toggles p. Pressing button b interchanges p and q. pq ab

18 Propositional Net for Buttons and Lights q p a

19 Tic-Tac-Toe X O X

20 Partial Propositional Net for Tic-Tac-Toe 12b b12 12o 11b b11 11o 13b b13 13o

21 Propositional Net Fragment 13o 11o row1o 12o 23o 21o row2o 22o 33o 31o row3o 32o 13x 11x row1x 12x 23x 21x row2x 22x 33x 31x row3x 32x

22 Propositional GDL row1o :- row1x :- true(11o), true(11x), true(12o), true(12x), true(13o) true(13x) row2o :- row1x :- true(21o), true(21x), true(22o), true(22x), true(23o) true(23x) row3o :- row1x :- true(31o), true(31x), true(32o), true(32x), true(33o) true(33x)

23 Performance ? (time (genwinnerp tttrel)) 5,478 states 130,444 milliseconds. 142,685,136 bytes of memory allocated. NIL ? (time (genwinnerp tttprop)) 5,478 states 594,555 milliseconds 117,281,008 bytes of memory allocated. NIL ? (time (propwinnerp tttprop)) 5,478 states 10,390 milliseconds. 5,900,904 bytes of memory allocated. NIL

24 Compilation Specialized Data Structures for state e.g. Boolean propositional net 1 bit per proposition Convert rules to bit operations e.g. Relational net vector of relations Compile the Game Description into machine code subroutine to compute view prop/rel from state update routine to compute base prop/rel from state

25 Propositional GDL (<= (next 11x) (does white mark11)) (<= (next 11x) (true 11x)) (<= (next 11o) (does black mark11)) (<= (next 11o) (true 11o)) (<= (next 11b) (true 11b) (not (does white mark11)) (not (does black mark11)))

26 Example (defun tttinit () (vector nil nil t nil nil t nil nil t nil nil t nil nil t nil nil t nil nil t nil nil t nil nil t t nil)) (defun true11x (state) (elt state 1)) (defun true11o (state) (elt state 2)) (defun true11b (state) (elt state 3)) (defun next11x (input state) (or (does 'white 'mark11 input) (true11x state))) (defun next11o (input state) (or (does 'black 'mark11 input) (true11o state))) (defun next11b (input state) (and (true11b state) (not (does 'white 'mark11 input)) (not (does 'black 'mark11 input))))

27 Performance ? (time (genwinnerp tttprop)) 5,478 states 594,555 milliseconds 117,281,008 bytes of memory allocated. NIL ? (time (propwinnerp tttprop)) 5,478 states 10,390 milliseconds. 5,900,904 bytes of memory allocated. ? (time (compwinnerp tttprop)) 5,478 states 855 milliseconds 3,475,432 bytes of memory allocated. NIL Compilation time: 234 milliseconds

28 Example (defun pbvinit () #b ) (defun x11 () #b ) (defun true11x (state) (= (logand state #b ) #b )) (defun true11o (state) (= (logand state #b ) #b )) (defun true11b (state) (= (logand state #b ) #b )) (defun newsimulate (input state) (logior input state))

29 Performance ? (time (genwinnerp tttprop)) 5,478 states 594,555 milliseconds 117,281,008 bytes of memory allocated. NIL ? (time (compwinnerp tttprop)) 5,478 states 855 milliseconds 3,475,432 bytes of memory allocated. NIL ? (time (pbvwinnerp tttprop)) 5,478 states 234 milliseconds 64 bytes of memory allocated. NIL

30

31