Você está na página 1de 39

Formalization of Games

Vikram Saralaya
(100928010)
Dept. of I&CT, MIT, Manipal

February 4, 2011

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Contents

Informal Overview
Introduction
Game Theory
Finite Duration Games
Tower of Hanoi puzzle
Formalize Chess Game
Summary
References

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Informal Overview

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Introduction

Why formalize games ?

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Introduction

Why formalize games ?


How ?
Use Game Theory Concepts

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Introduction

Why formalize games ?


How ?
Use Game Theory Concepts
What to model ?
Is it widely Used ?
Uncritical Environment

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Game Theory

Two-Person Zero-Sum Games


Perfect Information Games
Im-Perfect Information Games
What are Board Games?
Move
Piece
Rules
Finite duration Games
Configuration

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Finite & Perfect Information Games

Computer-Programmer Interaction
Tic-Tac-Toe, Checkers, Chess & Go.

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Finite & Perfect Information Games

Computer-Programmer Interaction
Tic-Tac-Toe, Checkers, Chess & Go.
Board Game be : G
2 set of Configurations : A & B
Winning Configurations

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Finite/Perfect Information Games
W(A) ⊆ A ∪ B
W(B) ⊆ A ∪ B

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Finite/Perfect Information Games
W(A) ⊆ A ∪ B
W(B) ⊆ A ∪ B
W(A) ∩ W(B) = φ

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Finite/Perfect Information Games
W(A) ⊆ A ∪ B
W(B) ⊆ A ∪ B
W(A) ∩ W(B) = φ
Directed edge from each a ∈ A to b ∈ B & vice versa

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Finite/Perfect Information Games
W(A) ⊆ A ∪ B
W(B) ⊆ A ∪ B
W(A) ∩ W(B) = φ
Directed edge from each a ∈ A to b ∈ B & vice versa
G begins with s0 ∈ A

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Finite/Perfect Information Games
W(A) ⊆ A ∪ B
W(B) ⊆ A ∪ B
W(A) ∩ W(B) = φ
Directed edge from each a ∈ A to b ∈ B & vice versa
G begins with s0 ∈ A
Play : s0 s1 s2 ...si ...sn
Play Stops : si ∈ W(A) ∪ W(B)

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Game Play Strategies
Evaluation Function
Min-Max Concept
Alpha-Beta Pruning(ABP)
ABP can look twice as deep as Min-Max

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Example : Tower of Hanoi

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Example : Tower of Hanoi

Poles : { left, middle, right }


Disks : d1,d2,d3,d4
Move : 1 to 4

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Example : Tower of Hanoi

Poles : { left, middle, right }


Disks : d1,d2,d3,d4
Move : 1 to 4
When discs can move ?

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Example : Tower of Hanoi

Poles : { left, middle, right }


Disks : d1,d2,d3,d4
Move : 1 to 4
When discs can move ?
d1 != d2 ∧ d1 != d3 ∧ d1 != d4

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Example : Tower of Hanoi

Initialize : d1=left ∧ d2=left ∧ d3=left ∧ d4=left


Specify Transition
next(d1) != d1 ∧
next(d2) = d2 ∧
next(d3) = d3 ∧
next(d4) = d4 ∧
noDiskOn d1 ∧
next(d1) != d2 ∧
next(d1) != d3 ∧
next(d1) != d4

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Example : Tower of Hanoi

Initialize : d1=left ∧ d2=left ∧ d3=left ∧ d4=left


Specify Transition
next(d1) != d1 ∧
next(d2) = d2 ∧
next(d3) = d3 ∧
next(d4) = d4 ∧
noDiskOn d1 ∧
next(d1) != d2 ∧
next(d1) != d3 ∧
next(d1) != d4
! EF(d1=right ∧ d2=right ∧ d3=right ∧ d4=right)

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Chess

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess

Poker Vs Rock-Paper-Scissors Vs Stratego Vs Chess

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess

Poker Vs Rock-Paper-Scissors Vs Stratego Vs Chess


Finite or Infinite ?

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess

Poker Vs Rock-Paper-Scissors Vs Stratego Vs Chess


Finite or Infinite ?
Perpetual Check
Photographic Position
50 move rule

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess

Poker Vs Rock-Paper-Scissors Vs Stratego Vs Chess


Finite or Infinite ?
Perpetual Check
Photographic Position
50 move rule
Outcome is determined or not ?
Win / Lose

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess : Aspects to consider

Position of Pieces
White or Black to move
Castling
Last Move
Number of moves after Last Pawn move or Capture

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess : Modelling Options

Algebraic Notation

Enumerate Positions

LEGAL
WIN ⊆ LEGAL

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess : Modelling Options

Player 1 wins : s ∈ A
Player 2 wins : s ∈
/A
Is there a winning strategy ?

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Formalize Chess : Modelling Options

Player 1 wins : s ∈ A
Player 2 wins : s ∈
/A
Is there a winning strategy ?
∃x0 ∀y0 ∃x1 ∀y1 ...∃xN−1 ∀yN−1 ([x0 , y0 , x1 , y1 , ...xN−1 , yN−1 ] ∈ A)
∀x0 ∃y0 ∀x1 ∃y1 ...∀xN−1 ∃yN−1 ([x0 , y0 , x1 , y1 , ...xN−1 , yN−1 ] ∈
/ A)

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Model : State Variables

white
King
Rank
File
Queen
Rook
Bishop
Knight
Pawn[i]
black
King
.......
32 ∗ 2 + 32 ∗ 2 + 1

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Our Model

Finite State Machine

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Our Model : Rules in CTL

King Movement
M, s0 |= AG((white.king.rank - white.prev king.rank = 0 ∨
white.king.rank - white.prev king.rank = 1 ∨
white.king.rank - white.prev king.rank = -1)

(white.king.file - white.prev king.file = 0 ∨
white.king.file - white.prev king.file = 1 ∨
white.king.file - white.prev king.file = -1))

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Our Model : Rules in CTL

Queen Movement
M, s0 |= AG(white.Queen.rank = white.prev Queen.rank

white.Queen.file = white.prev Queen.file

(white.Queen.rank - white.prev Queen.rank
= white.Queen.file - white.prev Queen.file ∨
white.Queen.rank - white.prev Queen.rank
= -1 * white.Queen.file - white.prev Queen.file) )

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Our Model : Rules in CTL I

Knight Movement
M, s0 |= AG((white.knight.rank = white.prev knight.rank ∧
white.knight.file = white.prev knight.file)

(white.knight.rank = white.prev knight.rank+1 ∧
(white.knight.file = white.prev knight.file + 2 ∨
white.knight.file = white.prev knight.file - 2))

(white.knight.rank = white.prev knight.rank-1 ∧
(white.knight.file = white.prev knight.file + 2 ∨
white.knight.file = white.prev knight.file - 2))

(white.knight.rank = white.prev knight.rank+2 ∧
(white.knight.file = white.prev knight.file + 1 ∨
white.knight.file = white.prev knight.file - 1))

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Our Model : Rules in CTL II


(white.knight.rank = white.prev knight.rank-2 ∧
(white.knight.file = white.prev knight.file + 1 ∨
white.knight.file = white.prev knight.file - 1)) )

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


Summary

1 Renew model further


2 State Explosion
3 Game play Strategy ?

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


References

1 Yurii Khomskii, ”Infinite Games” Summer Course at the


University of Sofia, Bulgaria, July 2010.
2 RC Chakraborthy, ”Game Playing - Artificial Intelligence”,
www.myreaders.info, June 2010.
3 Bakhadyr Khoussainov and Anil Nerode,”Automata Theory
and its Applications”, Volume 3, Brikhauser Boston, 2010.

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games


THANK YOU

Vikram Saralaya (100928010) Dept. of I&CT, MIT, Manipal Formalization of Games

Você também pode gostar