game description
DESCRIPTION
General Game PlayingLecture 3. Game Description. Michael Genesereth / Nat Love Spring 2006. Finite Synchronous Games. Finite environment Environment with finitely many states One initial state and one or more terminal states Finite Players - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/1.jpg)
Game Description
General Game Playing Lecture 3
Michael Genesereth / Nat Love Spring 2006
![Page 2: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/2.jpg)
2
Finite Synchronous Games
Finite environment Environment with finitely many states One initial state and one or more terminal states
Finite Players Fixed finite number of players Each with finitely many “actions” Each with one or more goal states
Synchronous Update All players move on all steps (some no ops) Environment changes only in response to moves
![Page 3: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/3.jpg)
3
Example
s3
s2 s5
s6
s8
s9
s4 s7 s10
s1 s11
bbba
aa
bb ab
ba
aa
ab aa
ab
ab
aa aa
ab
aabb aa
bb
ba ab
![Page 4: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/4.jpg)
4
Example Revisited
S ={s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11}I1={a, b} I2={a, b}
u(s1,a,a,s2) u(s4,a,a,s7) u(s7,a,a,s10) u(s10,b,a,s9)u(s1,a,b,s3) u(s4,a,b,s3) u(s8,a,b,s5) u(s10,b,b,s11)u(s1,b,a,s4) u(s6,a,a,s5) u(s8,b,b,s11) u(s11,a,a,s11)u(s1,b,b,s1) u(s6,a,b,s9) u(s9,a,a,s8)u(s2,a,a,s5) u(s6,b,a,s7) u(s9,a,b,s11) u(s2,a,b,s3) u(s6,b,b,s3)
i=s1
T ={s3, s8, s11}G1={s8, s11} G2={s3, s7}
![Page 5: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/5.jpg)
5
Games as Mathematical Structures
An n-player game is a structure with components:
S - finite set of statesI1, …, In - finite sets of actions, one for each player
u S I1 ... In S - update relation
i S - initial game stateT S - the terminal statesG1, ..., Gn - where Gi S - the goal relations
![Page 6: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/6.jpg)
6
Direct Description
Good News: Since all of the games that we are considering are finite, it is possible in principle to communicate game information in the form of sets of objects and tuples of objects.
Problem: Size of description. Even though everything is finite, these sets can be large.
![Page 7: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/7.jpg)
7
Relational Nets
![Page 8: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/8.jpg)
8
States versus Propositions
In many cases, worlds are best thought of in terms of propositions, e.g. whether a particular light is on or off. Actions often affect a subset of propositions.
States represent all possible ways the world can be. As such, the number of states is exponential in the number of such propositions, and the action tables are correspondingly large.
Idea - represent propositions directly and describe actions in terms of their effects on indidvidual propositions rather than entire states.
![Page 9: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/9.jpg)
9
Tic-Tac-Toe
X
O
X
![Page 10: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/10.jpg)
10
Relational States
cell(1,1,x)cell(1,2,b)cell(1,3,b)cell(2,1,b)cell(2,2,o)cell(2,3,b)cell(3,1,b)cell(3,2,b)cell(3,3,x)control(black)
![Page 11: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/11.jpg)
11
cell(1,1,x) cell(1,1,x) cell(1,2,b) cell(1,2,b) cell(1,3,b) cell(1,3,o) cell(2,1,b) cell(2,1,b) cell(2,2,o) cell(2,2,o) cell(2,3,b) cell(2,3,b) cell(3,1,b) cell(3,1,b) cell(3,2,b) cell(3,2,b) cell(3,3,x) cell(3,3,x) control(black) control(white)
Transitions
noop
mark(1,3)
![Page 12: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/12.jpg)
12
init(cell(1,1,b))init(cell(1,2,b))init(cell(1,3,b))init(cell(2,1,b))init(cell(2,2,b))init(cell(2,3,b))init(cell(3,1,b))init(cell(3,2,b))init(cell(3,3,b))init(control(x))
legal(W,mark(X,Y)) :- true(cell(X,Y,b)) & true(control(W))
legal(white,noop) :- true(cell(X,Y,b)) & true(control(black))
legal(black,noop) :- true(cell(X,Y,b)) & true(control(white))
…
Logical Encoding
![Page 13: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/13.jpg)
13
Syntax of Relational Logic
![Page 14: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/14.jpg)
14
Syntax of Relational Logic
Vocabulary: Object Variables: X, Y, Z Object Constants: a, b, c Function Constants: f, g, h Relation Constants: p, q, r Logical Operators: ~, &, |, :-, #
Terms: Variables: X, Y, Z Object Constants: a, b, c Functional Terms: f(a), g(a,b), h(a,b,c)
Sentences: Simple Sentences: p(a,g(a,b),c) Logical Sentences: r(X,Y) :- p(X,Y) & ~q(Y)
![Page 15: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/15.jpg)
15
SafetyA rule is safe if and only if every variable in the head appears in some positive subgoal in the body.
Safe Rule:
Unsafe Rule:
In GDL, we require all rules to be safe.
r(x,y):−p(x,y)∧q(y,z)
r(x,z) :−p(x,y)∧q(y,x)
![Page 16: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/16.jpg)
16
Dependency Graph
The dependency graph for a set of rules is a directed graph in which (1) the nodes are the relations mentioned in the head and bodies of the rules and (2) there is an arc from a node p to a node q whenever p occurs with the body of a rule in which q is in the head.
r(x,y):−p(x,y),q(x,y)
s(x,y):−r(x,y)
s(x,z):−r(x,y),t(y,z)
t(x,z) :−s(x,y),s(y,x)
A set of rules is recursive if it contains a cycle. Otherwise, it is non-recursive.
r
p q
s
t
![Page 17: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/17.jpg)
17
Recursion
A set of rules is recursive if it contains a cycle. Otherwise, it is non-recursive.
r(x,y):−p(x,y),q(x,y)
s(x,y):−r(x,y)
s(x,z):−r(x,y),t(y,z)
t(x,z) :−s(x,y),s(y,x)
r
p q
s
t
![Page 18: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/18.jpg)
18
Stratified NegationThe negation in a set of rules is said to be stratified if there is no recursive cycle in the dependency graph involving a negation.
Stratified Negation:
Negation that is not stratified:
In GDL, we require that all negations be stratified.
![Page 19: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/19.jpg)
19
Extensional and Intensional Relations
Database applications start with a partial database, i.e. sentences for some relations (extensional relations) and not others (intensional relations). Rules are then written to define the intensional relations in terms of the extensional relations.
rules
Extensional Intensional
Given an extensional database and a set of rules, we can obtain the database’s closure as follows.
![Page 20: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/20.jpg)
20
Example
Database applications start with a partial database, i.e. sentences for some relations (extensional relations) and not others (intensional relations). Rules are then written to define the intensional relations in terms of the extensional relations.
Given an extensional database and a set of rules, we can obtain the database’s closure as follows.
![Page 21: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/21.jpg)
21
Single Rule
The value of a single non-recursive rule on a database D is the set of all rule heads obtained by consistently substituting ground terms from D for variables in such a way that the substituted subgoals are all in D.
Sample Rule:
Database:
Extension:
q(x,z):−p(x,y),p(y,z)
{p(a,b),p(b,c),p(c,d)}
{q(a,c),q(b,d)}
![Page 22: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/22.jpg)
22
Multiple Rules
The value of a set of rules with a common relation on a database D is the union of the values on the individual rules.
Sample Rules:
Sample Database:
Value:
q(x,y) :−p(x,y)
q(x,z):−p(x,y),p(y,z)
{p(a,b),p(b,c),p(c,d)}
{q(a,b),q(b,c),q(c,d),q(a,c),q(b,d)}
![Page 23: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/23.jpg)
23
Multiple Relations
The value of a set of non-recursive rules with different head relations is obtained by evaluating rules in order in which their head relations appear in the corresponding dependency graph.
Sample Rules:
Value Computation:
s(x,y):−p(x,y),q(x,y)
t(x,z) :−s(x,y),r(y,z)
{p(a,b),p(b,c),q(b,c),r(c,d)}
{s(b,c)}
{t(a,c)}
![Page 24: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/24.jpg)
24
Recursion
To compute the value of a recursive rule, start with the empty relation. Compute the value using multiple rule computation. Iterate till no new tuples are added.
Sample Rules:
Value Computation:
q(x,y) :−p(x,y)
q(x,z):−q(x,y),q(y,z)
{p(a,b),p(b,c),p(c,d)}
{q(a,b),q(b,c),q(c,d)}
{q(a,c),q(b,d)}
{q(a,d}
![Page 25: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/25.jpg)
25
Negation
There are various ways to compute the value of negative rules.
In classical negation, a negation is true only if the negated sentence is known to be false (i.e. there must be rules concluding negated sentences). This is the norm in computational logic systems. In GDL, we do not have such rules.
In negation as failure, a negation is true if and only if the negated sentence is not known to be true. This is the norm in database systems.
![Page 26: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/26.jpg)
26
Negation as Failure Example
Definition:
Value Computation:
childless(x):−person(x),¬father(x),¬mother(x)
{person( joe),person(bill), father(joe)}
{childless(bill)}
![Page 27: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/27.jpg)
27
Game Description Language
![Page 28: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/28.jpg)
28
Game-Independent Vocabulary
Object Constants: 0, 1, 2, 3, … - numbers
Relation Constants: role(player) init(proposition) true(proposition) next(proposition) legal(player,action) does(player,action) goal(proposition) terminal
![Page 29: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/29.jpg)
29
Tic-Tac-Toe Vocabulary
Object constants: white, black - players x, o, b - marks
Function Constants: mark(number,number) --> action cell(number,number,mark) --> proposition control(player) --> proposition
RelationConstants: row(number,player) column(number,player) diagonal(player) line(player) open
![Page 30: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/30.jpg)
30
Extensional and Intensional Relations
Extensional Relations: does(player,action) true(proposition)
Intensional Relations: role(player) init(proposition) legal(player,action) next(proposition) goal(proposition,score) terminal
![Page 31: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/31.jpg)
31
Roles
role(white)role(black)
![Page 32: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/32.jpg)
32
Initial State
init(cell(1,1,b))init(cell(1,2,b))init(cell(1,3,b))init(cell(2,1,b))init(cell(2,2,b))init(cell(2,3,b))init(cell(3,1,b))init(cell(3,2,b))init(cell(3,3,b))init(control(x))
![Page 33: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/33.jpg)
33
Legality
legal(W,mark(X,Y)) :- true(cell(X,Y,b)) & true(control(W))
legal(white,noop) :- true(cell(X,Y,b)) & true(control(black))
legal(black,noop) :- true(cell(X,Y,b)) & true(control(white))
![Page 34: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/34.jpg)
34
Physics
next(cell(M,N,x)) :- does(white,mark(M,N))
next(cell(M,N,o)) :- does(black,mark(M,N))
next(cell(M,N,Z)) :- does(W,mark(M,N)) & true(cell(M,N,Z)) & Z#b
next(cell(M,N,b)) :- does(W,mark(J,K)) & true(cell(M,N,b)) & (M#J | N#K)
next(control(white)) :- true(control(black))
next(control(black)) :- true(control(white))
![Page 35: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/35.jpg)
35
Supporting Concepts
row(M,W) :- diagonal(W) :- true(cell(M,1,W)) & true(cell(1,1,W)) & true(cell(M,2,W)) & true(cell(2,2,W)) & true(cell(M,3,W)) true(cell(3,3,W))
column(N,W) :- diagonal(W) :- true(cell(1,N,W)) & true(cell(1,3,W)) & true(cell(2,N,W)) & true(cell(2,2,W)) & true(cell(3,N,W)) true(cell(3,1,W))
line(W) :- row(M,W)line(W) :- column(N,W)line(W) :- diagonal(W)
open :- true(cell(M,N,b))
![Page 36: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/36.jpg)
36
Goals and Termination
goal(white,100) :- line(x)goal(white,50) :- ~line(x) & ~line(o) & ~opengoal(white,0) :- line(o)
goal(black,100) :- line(o)goal(white,50) :- ~line(x) & ~line(o) & ~opengoal(white,0) :- line(x)
terminal :- line(W)terminal :- ~open
![Page 37: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/37.jpg)
37
More Tedious Details
![Page 38: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/38.jpg)
38
No Built-in Assumptions
What we see:
next(cell(M,N,x)) :- does(white,mark(M,N)) & true(cell(M,N,b))
What the player sees:
next(welcoul(M,N,himenoing)) :- does(himenoing,dukepse(M,N)) & true(welcoul(M,N,lorenchise))
![Page 39: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/39.jpg)
39
Knowledge Interchange Format
Knowledge Interchange Format is a standard for programmatic exchange of knowledge represented in relational logic.
Syntax is prefix version of standard syntax.Some operators are renamed: not, and, or.Case-independent. Variables are prefixed with ?.
r(X,Y) <= p(X,Y) & ~q(Y)
(<= (r ?x ?y) (and (p ?x ?y) (not (q ?y))))(<= (r ?x ?y) (p ?x ?y) (not (q ?y)))
Semantics is the same.
![Page 40: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/40.jpg)
40
Agent Communication Language
Start Message
(start id role (s1 … sn) startclock playclock)
Play Message
(play id (a1 ... ak))
Stop Message
(stop id (a1 ... ak))
![Page 41: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/41.jpg)
41
![Page 42: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/42.jpg)
42
Propositional Nets
![Page 43: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/43.jpg)
43
Buttons and Lights
p q
a b
r
c
![Page 44: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/44.jpg)
44
Relational States
pqr
pq
p
![Page 45: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/45.jpg)
45
State Machine
pqr
pq
p
![Page 46: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/46.jpg)
46
init(q)
legal(robot,a)legal(robot,b)legal(robot,c)
next(p) :- does(robot,a) & -true(p)next(p) :- does(robot,b) & true(q)next(p) :- does(robot,c) & true(p)next(q) :- does(robot,a) & true(q)next(q) :- does(robot,b) & true(p)next(q) :- does(robot,c) & true(q)next(r) :- does(robot,a) & true(r)next(r) :- does(robot,b) & true(r)next(r) :- does(robot,c) & true(q)
goal :- true(p) & -true(q) & true(r)term :- true(p) & -true(q) & true(r)
Logical Encoding
![Page 47: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/47.jpg)
47
Buttons and Lights Formalization
S ={s1, s2, s3, s4, s5, s6, s7, s8}I = {a, b, c}
u(s1,a,s5) u(s000,b,s010) u(s000,c,s001)u(s2,a,s2) u(s000,b,s010) u(s000,c,s001)u(s3,a,s3) u(s000,b,s010) u(s000,c,s001)u(s4,a,s4) u(s000,b,s010) u(s000,c,s001)
I = s1
T = {s8}G = {s8}
![Page 48: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/48.jpg)
48
Buttons and Lights Formalization
P ={p, q, r}I = {a, b, c}
u(s1,a,s5) u(s000,b,s010) u(s000,c,s001)u(s2,a,s2) u(s000,b,s010) u(s000,c,s001)u(s3,a,s3) u(s000,b,s010) u(s000,c,s001)u(s4,a,s4) u(s000,b,s010) u(s000,c,s001)
I = s1
T = {s8}G = {s8}
![Page 49: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/49.jpg)
49
cell(1,1,x) cell(1,1,x) cell(1,2,b) cell(1,2,b) cell(1,3,b) cell(1,3,o) cell(2,1,b) cell(2,1,b) cell(2,2,o) cell(2,2,o) cell(2,3,b) cell(2,3,b) cell(3,1,b) cell(3,1,b) cell(3,2,b) cell(3,2,b) cell(3,3,x) cell(3,3,x) control(black) control(white)
Transitions
noop
mark(1,3)
![Page 50: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/50.jpg)
50
Buttons and Lights
p q
a b
r s
c d
![Page 51: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/51.jpg)
51
Buttons and Lights Formalization
S ={s000, s001, s010, s011, s100, s101, s110, s111}I = {a, b, c}
u(s000,a,s100) u(s000,b,s010) u(s000,c,s001)u(s001,a,s001) u(s000,b,s010) u(s000,c,s001)u(s010,a,s010) u(s000,b,s010) u(s000,c,s001)u(s011,a,s011) u(s000,b,s010) u(s000,c,s001)
I = s0
T = {sF}G = {sF}
![Page 52: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/52.jpg)
52
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. Actions often affect subset of 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.
![Page 53: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/53.jpg)
53
Propositions
Connectives
Transitions
Propositional Net Components
p q r
![Page 54: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/54.jpg)
54
Propositional Net
![Page 55: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/55.jpg)
55
Markings
![Page 56: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/56.jpg)
56
Inputs
![Page 57: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/57.jpg)
57
Enablement
?
![Page 58: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/58.jpg)
58
Update
![Page 59: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/59.jpg)
59
Buttons and Lights
Pressing button a toggles p.Pressing button b interchanges p and q.
p q
a b
![Page 60: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/60.jpg)
60
Propositional Net for Buttons and Lights
q
p
a
![Page 61: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/61.jpg)
61
Propositional Nets as State Machines
State Machines as Propositional Nets One proposition per state Only one proposition is true at each point in time
Propositional Nets and State Machines
s110
![Page 62: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/62.jpg)
62
Comparison
Propositional Nets vs State Machines Expressively equivalent and interconvertible State Machines can be exponentially larger e.g. state machine for Tic-Tac-Toe has 5478 states propositional net has 45 propositions
Propositional Nets vs Petri Nets Propositional Nets are computable (equivalent to Petri nets with finitely many
tokens) Propositional Nets are composable without revealing inner details of components
![Page 63: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/63.jpg)
63
p
q
r2,1 1.3
Object Nets
![Page 64: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/64.jpg)
64
![Page 65: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/65.jpg)
65
Relational Nets
![Page 66: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/66.jpg)
66
Propositional Net Fragment
o13
o11
or1o12
o23
o21
or2o22
o33
o31
or3o32
x13
x11
xr1x12
x23
x21
xr2x22
x33
x31
xr3x32
![Page 67: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/67.jpg)
67
Decompose states into “relations”.
Use relational operators to capture behavior.
s p q r
€
a b
b c
d e
€
a
d
€
a b c
a d es1
p
q
r2,1 1.3
ec
db
da
hf
he
gd hc
gb
ga
Relational Nets
![Page 68: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/68.jpg)
68
Comparison
Relational Nets vs Propositional Nets Expressively equivalent and interconvertible Number of Tuples = Number of Propositions Fewer Relations than propositions Fewer connectives
Relational Nets vaguely related to RMDPs
![Page 69: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/69.jpg)
69
Logical Encoding
![Page 70: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/70.jpg)
70
p
q
r2,1 1.3
Relational Net
![Page 71: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/71.jpg)
71
Relational Net Fragment
Encoding
r(X,Z) :- p(X,Y) & q(Y,Z)
p
q
r2,1 1.3
Possible Relational Net Encoding
ec
db
da
hf
he
gd hc
gb
ga
![Page 72: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/72.jpg)
72
Relational Net Fragment
Encoding without delay Encoding with delay
true(r(X,Z)) :- next(r(X,Z)) :- true(p(X,Y)) & true(p(X,Y)) & true(q(Y,Z)) true(q(Y,Z))
p
q
r2,1 1.3
Actual Relational Net Encoding
![Page 73: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/73.jpg)
73
Tic-Tac-Toe
X
O
X
![Page 74: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/74.jpg)
74
Partial Propositional Net for Tic-Tac-Toe
cell(1,2,b)
mark(1,2)
cell(1,2,x)
cell(1,1,b)
mark(1,1)
cell(1,1,x)
cell(1,3,b)
mark(1,3)
cell(1,3,x)
![Page 75: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/75.jpg)
75
Logical Description
Direct encoding in relational logic:next(cell(1,1,x)) <= does(mark(1,1)) & true(cell(1,1,b))
Use of variables to compact description:next(cell(M,N,x)) <= does(mark(M,N)) & true(cell(M,N,b))
Game-specific “views” / “macros”:row(M,W) <= true(cell(M,1,W)) & true(cell(M,2,W)) & true(cell(M,3,W))
![Page 76: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/76.jpg)
76
Syntax of Relational Logic
Object Variables: X, Y, ZObject Constants: a, b, cFunction Constants: f, g, hRelation Constants: p, q, rLogical Operators: ~, &, |, :-, distinct
Terms: X, Y, Z, a, b, c, f(a), g(a,b), h(a,b,c)Relational Sentences: p(a,b)Logical Sentences: r(X,Y) <= p(X,Y) & ~q(Y)
An expression is ground iff it contains no variables.The Herbrand base is the set of all ground relational sentences.
![Page 77: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/77.jpg)
77
Legality
legal(W,mark(X,Y)) true(cell(X,Y,b)) true(control(W))
legal(white,noop) true(cell(X,Y,b)) true(control(o))
legal(black,noop) true(cell(X,Y,b)) true(control(x))
![Page 78: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/78.jpg)
78
Update
next(cell(M,N,x)) does(white,mark(M,N)) true(cell(M,N,b))
next(cell(M,N,o)) does(black,mark(M,N)) true(cell(M,N,b))
next(cell(M,N,W)) true(cell(M,N,W)) distinct(W,b)
next(cell(M,N,b)) does(W,mark(J,K)) true(cell(M,N,b)) (distinct(M,J) | distinct(N,K))
![Page 79: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/79.jpg)
79
Update (continued)
next(control(x)) true(control(o))
next(control(o)) true(control(x))
![Page 80: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/80.jpg)
80
Goals
goal(white,100) line(x)goal(white,0) line(o)goal(black,100) line(o)goal(white,0) line(x)
line(W) row(M,W)line(W) column(N,W)line(W) diagonal(W)
![Page 81: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/81.jpg)
81
Supporting Concepts
row(M,W) true(cell(M,1,W)) true(cell(M,2,W)) true(cell(M,3,W))
column(N,W) true(cell(1,N,W)) true(cell(2,N,W)) true(cell(3,N,W))
diagonal(W) true(cell(1,1,W)) true(cell(2,2,W)) true(cell(3,3,W))
diagonal(W) true(cell(1,3,W)) true(cell(2,2,W)) true(cell(3,1,W))
![Page 82: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/82.jpg)
82
Termination
terminal line(W)terminal ~open
open true(cell(M,N,b))
![Page 83: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/83.jpg)
83
![Page 84: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/84.jpg)
84
Of necessity, game descriptions are logically incomplete in that they do not uniquely specify the moves of the players.
Every game description contains complete definitions for legality, termination, goalhood, and update in terms of the primitive moves and the does relation.
The upshot is that in every state every player can determine legality, termination, goalhood and, given a joint move, can update the state.
Completeness
![Page 85: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/85.jpg)
85
A game is playable if and only if every player has at least one legal move in every non-terminal state.
Note that in chess, if a player cannot move, it is a stalemate. Fortunately, this is a terminal state.
In GGP, we guarantee that every game is playable.
Playability
![Page 86: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/86.jpg)
86
A game is strongly winnable if and only if, for some player, there is a sequence of individual moves of that player that leads to a terminating goal state for that player.
A game is weakly winnable if and only if, for every player, there is a sequence of joint moves of the players that leads to a terminating goal state for that player.
In GGP, every game is weakly winnable, and all single player games are strongly winnable.
Winnability
![Page 87: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/87.jpg)
87
Comparison to Extensive Normal Form
In Extensive Normal Form, a game is modeled as a tree with actions of one player at each node.
In State Machine Form, a game is modeled as a graph and players’ moves are all synchronous.
In GGP, a game must be described formally. While ENF and SMF are expressively equivalent for finite games, SMF descriptions are simpler.
Some players may create game trees from game descriptions; however, searching game graphs can be more efficient.
![Page 88: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/88.jpg)
88
State Machines
Propositional Nets
Relational Nets
Tabular Encoding
Logical Encoding
Programme for Today
![Page 89: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/89.jpg)
89
Game Model
An n-player game is a structure with components:
S - finite set of statesI1, …, In - finite sets of actions, one for each playerl1, ..., ln - where li Ii S - the legality relationsu S I1 ... In S - update relationi S - initial game stateT S - the terminal statesG1, ..., Gn - where Gi S - the goal relations
![Page 90: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/90.jpg)
90
s
Define states in terms of propositions.
Use propositional connectives to capture behavior.
Propositional Nets and State Machines
q
p
r
qp
r
s110
![Page 91: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/91.jpg)
91
Markings
A marking for a propositional net is a function from the propositions to boolean values.
m: P {true,false}
![Page 92: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/92.jpg)
92
Acceptability
A marking is acceptable iff it obeys the logical properties of all connectives.
Negation with input x and output y: m(y)=true m(x)=false
Conjunction with inputs x and y and output z: m(z)=true m(x)=true m(y)=true
Disjunction with inputs x and y and output z: m(z)=true m(x)=true m(y)=true
![Page 93: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/93.jpg)
93
Update
A transition is enabled by a marking m iff all of its inputs are marked true.
The update for a marking m is the partial marking m* that assigns true to the outputs of all transitions enabled by m and false to the outputs of all other transitions.
A successor m’ of a marking m is any complete, acceptable marking consistent with m*.
![Page 94: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/94.jpg)
94
Example
q
p
r
![Page 95: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/95.jpg)
95
cell(1,1,x) cell(1,1,x) cell(1,2,b) cell(1,2,b) cell(1,3,b) cell(1,3,o) cell(2,1,b) cell(2,1,b) cell(2,2,o) cell(2,2,o) cell(2,3,b) cell(2,3,b) cell(3,1,b) cell(3,1,b) cell(3,2,b) cell(3,2,b) cell(3,3,x) cell(3,3,x) control(black) control(white)
Logical Encoding
noop
mark(1,3)
![Page 96: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/96.jpg)
96
Arguing for Evaluation Function
Assume evaluation function f partitions states into n categories S1, …, Sn.
Consider probabilities p1, …, pn of winning in each category. (More generally, consider expected utilities u1, …, un.) Use these probabilities (utilities) as evaluation function values for the corresponding categories.
Choosing a move that leads to a category with maximal value maximizes chances of winning.
![Page 97: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/97.jpg)
97
Evaluation Functions
An ideal evaluation function is one that reflects the expected utility of each state. (In the case of win-lose games, it is the probability of winning.)
For each terminal state, it is the payoff in that state.
For each nonterminal state, it is the maximum of the expected utilities of the legal actions in that state. (The expected utility of an action in a state is the sum of the expected values of the states resulting from that action weighted by probabilities of the opponents’ actions.)
![Page 98: Game Description](https://reader035.vdocuments.net/reader035/viewer/2022062321/56812ddb550346895d932b5c/html5/thumbnails/98.jpg)
98
Evaluation Functions
Choosing moves that maximize expected value
NB: Different priors possible. Random is common.