Anda di halaman 1dari 30

Game theory denotes games of strategy

Game theory allows decision makers


(players) to cope with other decision-
makers (player) who have different purpose
in mind.
i.e. Players determine their strategy in terms
of strategies and goals of the opponent
If computers are to simulate humans, they
should be able to play games which require
intelligence
Game Playing in AI
Computers can be programmed to
play games such as tic-tac-toe,
chequers, chess, etc.

Game Trees
can represent all possible games(of a
given type) by a directed graph often
called a game tree.
The nodes of the graph represent
the states of the game.
The arcs of the graph represent
possible moves by the players (+ and
-)
The game starts in some "start" state,
there is a set of possible moves: m
1
, m
2
..
m
N
These give rise, respectively, to states:
S
1
, S
2
.. S
N


S
1
S2
S
n
Start state
M1
M2
.
M
n
The game starts in some "start" state, and
there is a set of possible moves: m
1
, m
2
..
m
N
. These give rise, respectively, to states:
S
1
, S
2
.. S
N
.
By considering possible moves at any state
Si (recursively), we develop a "game tree".
The game starts in some "start" state, and
there is a set of possible moves: m
1
, m
2
..
m
N
. These give rise, respectively, to states:
S
1
, S
2
.. S
N
.
By considering possible moves at any
state Si (recursively), we develop a
"game tree".
The leaves of this tree ("tip nodes")
represent the state of play so far.
The rules of the game assign
a value to every terminal position.

W -- Won
L -- Lost From the point of view of '+'
D -- Drawn

The current state of the game is the
root of the tree ( In general this node
has several children, representing all of
the possible moves that one can make
Each of those nodes has children
representing the game state after each
of the opponent's moves
These nodes have children
corresponding to the possible second
moves of the current player, and so on.
The leaves of the tree are final states
of the game: states where no further
move can be made because one
player has won, or perhaps the game
is a tie.

Min-max algorithm
minimizing the possible loss while maximizing the
potential gain.
(Tree)

the maximising player will choose move A.
Conversely, had it been the turn of the minimising
player, s/he would choose move C

Algorithm
Inspect all nodes down to some depth N, as
follows:
Evaluate all terminal nodes
Assign backed up values, starting at level N-
1 and working up to level 1




Max
Min
Alpha-Beta Pruning

Refine mini-max technique.
Alpha-beta pruning follows same algo
except that certain sub-trees can be
rejected ("pruned") as they are
encountered, considerably reducing the
search effort
Essentially, we keep track of the "best move
so far" available to each player, and reject
any subtrees which can only produce a
worse result
Consider a situation in which the MIN-
children of a MAX-node have been partially
inspected.

First-order logic
is a formal system used
in mathematics, philosophy, linguistics,
and computer science
Also refered as Predicate logic
In first-order theories, predicates are often
associated with sets. In interpreted higher-
order theories, predicates may be
interpreted as sets of sets
propositional logic deals with simple
declarative propositions, first-order logic
additionally
covers predicates and quantification
FOL
First-order logic (FOL) models the world in terms
of
Objects, which are things with individual
identities
Properties of objects that distinguish them from
others
Relations that hold among sets of objects
Functions, which are a subset of relations

Examples:
Objects: Students, lectures, companies, cars ...
Relations: Brother-of, bigger-than, outside, part-
of, has-color, occurs-after, owns, visits,
precedes, ...
Properties: blue, oval, even, large, ...
Functions: father-of, best-friend, second-half,
more-than ...


Constants Nimal, 2, OUSL,...
Predicates Brother, >, ...
Functions Sqrt, LeftLegOf,...
Variables x, y, a, b,...
Connectives , , ., v,
Equality =
Quantifiers , -
User provides


Constant symbols, which represent individuals in the
world
Mary
3
Green
Function symbols, which map individuals to
individuals
father-of(Mary) = John
color-of(Sky) = Blue
Predicate symbols, which map individuals to truth
values
greater(5,3)
green(Grass)
color(Grass, Green)
FOL provides
Variable symbols
E.g., x, y, foo
Connectives
Same as in PL: not (), and (.), or (v), implies
(), if and only if (biconditional )
Quantifiers
Universal x or (Ax)
Existential -x or (Ex)

Atomic sentence
Atomic sentence = predicate
(term
1
,...,term
n
) or term
1
=
term
2

Term = function
(term
1
,...,term
n
) or
constant or variable

E.g., Brother(Nimal, Namal)

Complex sentences
Complex sentences are made from
atomic sentences using connectives

S, S
1
. S
2
, S
1
v S
2
, S
1
S
2
, S
1


S
2
,

E.g. Sibling(Namal, Nimal)
Sibling(Nimal, Namal)
>(1,2) v (1,2)


Universal Quantfier &
Existential quantification

Universal quantification
(x)P(x) means that P holds for all values of x in
the domain associated with that variable
E.g., (x) dolphin(x) mammal(x)

Existential quantification
(- x)P(x) means that P holds for some value of x
in the domain associated with that variable
E.g., (- x) mammal(x) . lays-eggs(x)
Permits one to make a statement about some
object without naming it

Properties of quantifiers
Universal quantifiers are often used
with implies to form rules:
(x) student(x) smart(x) means All
students are smart
Universal quantification is rarely used
to make blanket statements about
every individual in the world:
(x)student(x).smart(x) means Everyone
in the world is a student and is smart
Existential quantifiers are usually used
with and to specify a list of properties
about an individual:
(-x) student(x) . smart(x) means There is a
student who is smart
A common mistake is to represent this
English sentence as the FOL sentence:
(-x) student(x) smart(x)
But what happens when there is a person
who is not a student?

Typically, . is the main connective with -

Common mistake: using as the main
connective with -:

-x At(x,OUSL) Smart(x)

is true if there is anyone who is not at
OUSL!
Properties of quantifiers
x y is the same as y x

-x -y is the same as -y -x

-x y is not the same as y -x

-x y Likes(x,y)
There is a person who likes everyone in the world

y -x Likes(x,y)
Everyone in the world is liked by at least one person

Quantifier duality: each can be expressed using the other
x Likes(x,IceCream) -x Likes(x,IceCream)
-x Likes(x,Broccoli) x Likes(x,Broccoli)

Quantified inference rules
Universal instantiation
x P(x) P(A)
Universal generalization
P(A) . P(B) x P(x)
Existential instantiation
-x P(x) P(F) skolem
constant F
Existential generalization
P(A) -x P(x)

Universal instantiation
If (x) P(x) is true, then P(C) is true,
where C is any constant in the domain
of x
Example:
(x) eats(Ziggy, x) eats(Ziggy, IceCream)

The variable symbol can be replaced
by any ground term, i.e., any constant
symbol or function symbol applied to
ground terms only

Existential instantiation
(a.k.a. existential elimination)
From (-x) P(x) infer P(c)
Example:
(-x) eats(Zara, x) eats(Zara, snails)
Note that the variable is replaced by a
brand-new constant not occurring in this
or any other sentence in the KB
Also known as skolemization; constant is a
skolem constant

In other words, we dont want to
accidentally draw other inferences
about it by introducing the constant
Convenient to use this to reason about
the unknown object, rather than
constantly manipulating the existential
quantifier

Existential generalization
(a.k.a. existential
introduction)
If P(c) is true, then (-x) P(x) is
inferred.
Example
eats(Zara, IceCream) (-x) eats(Zara, x)

All instances of the given constant
symbol are replaced by the new
variable symbol
Note that the variable symbol cannot
already exist anywhere in the
expression

Logic
Axioms
1. All dogs are animals : VX [dog(X) ) -> animal(X)]
2. Snowy is a dog : dog(Snowy).
3. All animals will die : VY [animal(Y ) -> die(Y )]

Theorem to proof :
Snowy will die : die(Snowy).

Converting the predicates to a clause form:
1. dog(X) V animal(X)
2. dog(Snowy)
3. animal(Y ) V die(Y )

Negate the conclusion that Snowy will die :
die(Snowy).

Proof by resolution refutation
~dog(X) V animal(X) dog(Snowy)


~animal(Y) V die(Y)
animal(Snowy)


die(Snowy)
~die(Snowy)

Anda mungkin juga menyukai