Artificial Intelligence A Modern Approach (3rd Edition): page 165.
A game can be formally defined as a kind of search problem with the following
elements:
- S0: The initial state, which specifies how the game is set up at the
start.
- PLAYER(s): Defines which player has the move in a state.
- ACTIONS(s): Returns the set of legal moves in a state.
- RESULT(s, a): The transition model, which defines the result of a move.
- TERMINAL-TEST(s): A terminal test, which is true when the game is over
and false TERMINAL STATES otherwise. States where the game has ended are
called terminal states.
- UTILITY(s, p): A utility function (also called an objective function or
payoff function), defines the final numeric value for a game that ends in
terminal state s for a player p. In chess, the outcome is a win, loss, or
draw, with values +1, 0, or 1/2 . Some games have a wider variety of possible
outcomes; the payoffs in backgammon range from 0 to +192. A zero-sum game is
(confusingly) defined as one where the total payoff to all players is the
same for every instance of the game. Chess is zero-sum because every game has
payoff of either 0 + 1, 1 + 0 or 1/2 + 1/2 . "Constant-sum" would have been a
better term, but zero-sum is traditional and makes sense if you imagine each
player is charged an entry fee of 1/2.