Game Description Language
   HOME

TheInfoList



OR:

Game Description Language, or GDL, is a
logic programming Logic programming is a programming paradigm which is largely based on formal logic. Any program written in a logic programming language is a set of sentences in logical form, expressing facts and rules about some problem domain. Major logic prog ...
language designed by
Michael Genesereth Michael Genesereth (born 1948) is an American logician and computer scientist A computer scientist is a person who is trained in the academic study of computer science. Computer scientists typically work on the theoretical side of computatio ...
for
general game playing General game playing (GGP) is the design of artificial intelligence programs to be able to play more than one game successfully. For many games like chess, computers are programmed to play these games using a specially designed algorithm, which ca ...
, as part of the General Game Playing Project at
Stanford University Stanford University, officially Leland Stanford Junior University, is a private research university in Stanford, California. The campus occupies , among the largest in the United States, and enrolls over 17,000 students. Stanford is consider ...
. GDL describes the state of a game as a series of facts, and the game mechanics as logical rules. GDL is hereby one of alternative representations for game theoretic problems.


Purpose of GDL

Quoted in an article in
New Scientist ''New Scientist'' is a magazine covering all aspects of science and technology. Based in London, it publishes weekly English-language editions in the United Kingdom, the United States and Australia. An editorially separate organisation publishe ...
, Genesereth pointed out that although
Deep Blue Deep Blue may refer to: Film * ''Deep Blues: A Musical Pilgrimage to the Crossroads'', a 1992 documentary film about Mississippi Delta blues music * Deep Blue (2001 film), ''Deep Blue'' (2001 film), a film by Dwight H. Little * Deep Blue (2003 ...
is able to play chess at a grandmaster level, it is incapable of playing
checkers Checkers (American English), also known as draughts (; British English), is a group of strategy board games for two players which involve diagonal moves of uniform game pieces and mandatory captures by jumping over opponent pieces. Checkers ...
at all because it is a specialized game player. Both chess and checkers can be described in GDL. This enables general game players to be built that can play both of these games and any other game that can be described using GDL.


Specification


Syntax

GDL is a variant of
Datalog Datalog is a declarative logic programming language. While it is syntactically a subset of Prolog, Datalog generally uses a bottom-up rather than top-down evaluation model. This difference yields significantly different behavior and properties ...
, and the
syntax In linguistics, syntax () is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure ( constituency) ...
is largely the same. It is usually given in
prefix notation Polish notation (PN), also known as normal Polish notation (NPN), Łukasiewicz notation, Warsaw notation, Polish prefix notation or simply prefix notation, is a mathematical notation in which operators ''precede'' their operands, in contrast t ...
. Variables begin with "?".


Keywords

The following is the list of keywords in GDL, along with brief descriptions of their functions: ;distinct :This predicate is used to require that two terms be syntactically different. ;does :The predicate does(?r,?m) means that player (or ''role'') ?r makes move ?m in the current game state. ;goal :The predicate goal(?r,?n) is used to define goal value ?n (usually a natural number between 0 and 100) for role ?r in the current state. ;init :This predicate refers to a true fact about the initial game state. ;legal :The predicate legal(?r,?m) means that ?m is a legal move for role ?r in the current state. ;next :This predicate refers to a true fact about the next game state. ;role :This predicate is used to add the name of a player. ;terminal :This predicate means that the current state is terminal. ;true :This predicate refers to a true fact about the current game state.


Rules

A game description in GDL provides complete rules for each of the following elements of a game.


Players

Facts that define the roles in a game. The following example is from a GDL description of the two-player game
Tic-tac-toe Tic-tac-toe (American English), noughts and crosses (Commonwealth English), or Xs and Os (Canadian or Irish English) is a paper-and-pencil game for two players who take turns marking the spaces in a three-by-three grid with ''X'' or ''O''. T ...
:
(role xplayer)
(role oplayer)


Initial state

Rules that entail all facts about the initial game state. An example is:
(init (cell 1 1 blank))
...
(init (cell 3 3 blank))
(init (control xplayer))


Legal moves

Rules that describe each move by the conditions on the current position under which it can be taken by a player. An example is: (<= (legal ?player (mark ?m ?n)) (true (cell ?m ?n blank)) (true (control ?player)))


Game state update

Rules that describe all facts about the next state relative to the current state and the moves taken by the players. An example is: (<= (next (cell ?m ?n x)) (does xplayer (mark ?m ?n))) (<= (next (cell ?m ?n o)) (does oplayer (mark ?m ?n)))


Termination

Rules that describe the conditions under which the current state is a terminal one. An example is:
(<= terminal
    (line x))
(<= terminal
    (line o))
(<= terminal
    not boardopen)


Goal states

The goal values for each player in a terminal state. An example is: (<= (goal xplayer 100) (line x)) (<= (goal oplayer 0) (line x))


Extensions


GDL-II

With GDL, one can describe finite games with an arbitrary numbers of players. However, GDL cannot describe games which contain an element of chance (for example, rolling dice) or games where players have incomplete information about the current state of the game (for example, in many card games the opponents' cards are not visible). GDL-II, the Game Description Language for Incomplete Information Games, extends GDL by two keywords that allow for the description of elements of chance and incomplete information: ;sees :The predicate sees(?r,?p) means that role ?r perceives ?p in the next game state. ;random :This constant refers to a pre-defined player who chooses moves randomly. The following is an example from a GDL-II description of the card game
Texas hold 'em Texas hold 'em (also known as Texas holdem, hold 'em, and holdem) is one of the most popular variants of the card game of poker. Two cards, known as hole cards, are dealt face down to each player, and then five Community card poker, communit ...
: (<= (sees ?player ?card) (does random (deal_face_down ?player ?card))) (<= (sees ?r ?card) (role ?r) (does random (deal_river ?card)))


GDL-III

Michael Thielscher also created a further extension, GDL-III, a general game description language with ''imperfect information'' and ''introspection'', that supports the specification of ''epistemic games'' — ones characterised by rules that depend on the knowledge of players.


Other formalisms and languages for game representation

In classical game theory, games can be formalised in extensive and
normal Normal(s) or The Normal(s) may refer to: Film and television * ''Normal'' (2003 film), starring Jessica Lange and Tom Wilkinson * ''Normal'' (2007 film), starring Carrie-Anne Moss, Kevin Zegers, Callum Keith Rennie, and Andrew Airlie * ''Norma ...
forms. For
cooperative game theory In game theory, a cooperative game (or coalitional game) is a game with competition between groups of Player (game), players ("coalitions") due to the possibility of external enforcement of cooperative behavior (e.g. through contract law). Those ...
, games are represented using characteristic functions. Some subclasses of games allow special representations in smaller sizes also known as succinct games. Some of the newer developments of formalisms and languages for representation of some subclasses of games or representations adjusted to the needs of interdisciplinary research are summarized as the following table. Some of these alternative representations also encode time related aspects:


Applications

A 2016 paper "describes a multilevel algorithm compiling a general game description in GDL into an optimized reasoner in a low level language". A 2017 paper uses GDL to model the process of mediating a resolution to a dispute between two parties, and presented an algorithm that uses available information efficiently to do so.


See also

*
General Game Playing General game playing (GGP) is the design of artificial intelligence programs to be able to play more than one game successfully. For many games like chess, computers are programmed to play these games using a specially designed algorithm, which ca ...
*
Artificial Intelligence Artificial intelligence (AI) is intelligence—perceiving, synthesizing, and inferring information—demonstrated by machines, as opposed to intelligence displayed by animals and humans. Example tasks in which this is done include speech re ...


References


External links


Game Description Language SpecificationRefereed paper introducing GDL-II
{{Game theory Game artificial intelligence Game theory Logic programming languages