Game Description Language (GDL) is a specialized logic programming language designed by Michael Genesereth. The goal of GDL is to allow the development of AI agents capable of general game playing. It is part of the General Game Playing Project at Stanford University. GDL is a tool for expressing the intricacies of game rules and dynamics in a form comprehensible to artificial intelligence (AI) systems through a combination of logic-based constructs and declarative principles.
In practice, GDL is often used for General Game Playing competitions and research endeavours. In these contexts, GDL is used to specify the rules of games that AI agents are expected to play. AI developers and researchers harness GDL to create algorithms that can comprehend and engage with games based on their rules. The use of GDL allows for the development of highly adaptable AI agents, capable of competing in diverse scenarios.
Quoted in an article in New Scientist, Genesereth pointed out that although Deep Blue can play chess at a grandmaster level, it is incapable of playing checkers at all because it is a specialized game player.[1] 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.
GDL is a variant of Datalog, and the syntax is largely the same. It is usually given in prefix notation. Variables begin with ?
.[2]
The following is the list of keywords in GDL, along with brief descriptions of their functions:
distinct
does
(does ?r ?m)
means that the player (or role) ?r
makes the move ?m
in the current game state.goal
(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
legal
(legal ?r ?m)
means that ?m
is a permissible move for role ?r
in the current state.next
role
terminal
true
A game description in GDL provides complete rules that define the game's players, initial state, valid moves, how the game state is updated, how the game ends, and how a winner is determined.
Facts that define the roles in a game. For example, the two-player game tic-tac-toe could define players in GDL with (role xplayer)
and (role oplayer)
.
Rules that entail all facts about the initial game state. The following example describes an empty three-by-three tic-tac-toe board, with player x making the starting move:
(init (cell 1 1 blank))
...
(init (cell 3 3 blank))
(init (control xplayer))
Rules that describe each move which can be taken by a player, based on the current game conditions. A tic-tac-toe player can mark a cell if it is currently blank, and it is the player's turn to move. In GDL:
(<= (legal ?player (mark ?m ?n))
(true (cell ?m ?n blank))
(true (control ?player)))
Rules that describe all facts about the next state relative to the current state and the moves taken by the players. For example:
(<= (next (cell ?m ?n x))
(does xplayer (mark ?m ?n)))
(<= (next (cell ?m ?n o))
(does oplayer (mark ?m ?n)))
Rules that describe the conditions under which the game ends. In tic-tac-toe, the game is over if either player makes three marks in a line, or there are no more blank spaces:
(<= terminal
(line x))
(<= terminal
(line o))
(<= terminal
not boardopen)
The values that determine which player wins in an end state. An example is:
(<= (goal xplayer 100)
(line x))
(<= (goal oplayer 0)
(line x))
GDL can describe finite games with an arbitrary number of players. However, GDL cannot describe games that 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). An extension of GDL known as the Game Description Language for Incomplete Information Games (GDL-II) extends the language by two keywords, sees
and random
, that allow for the description of elements of chance and incomplete information.[3] The statement (sees ?r ?p)
means that role ?r
perceives ?p
in the next game state. The random
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:
(<= (sees ?player ?card)
(does random (deal_face_down ?player ?card)))
(<= (sees ?r ?card)
(role ?r)
(does random (deal_river ?card)))
Michael Thielscher also created a further extension, GDL-III, a general GDL with imperfect information and introspection, that supports the specification of epistemic games—those characterized by rules that depend on the knowledge of players.[4]
In classical game theory, games can be formalized in extensive and normal forms. For cooperative game theory, games are represented using characteristic functions. Some subclasses of games allow special representations in smaller sizes, also known as succinct games. Over time, other formalisms and languages for representing different game types have been developed, due in part to the needs of interdisciplinary research.[5] Some of these alternative representations include time-related aspects:
Name | Year | Formalized with | Game type | Time aspect |
---|---|---|---|---|
Congestion game[6] | 1973 | functions | subset of n-player games, simultaneous moves | No |
Sequential form[7] | 1994 | matrices | two-player games of imperfect information | No |
Timed games[8][9] | 1994 | functions | two-player games | Yes |
Gala[10] | 1997 | logic | n-player games of imperfect information | No |
Graphical games[11][12] | 2001 | graphs, functions | n-player games, simultaneous moves | No |
Local effect games[13] | 2003 | functions | subset of n-player games, simultaneous moves | No |
Game Petri nets[14] | 2006 | Petri nets | deterministic n-player games, simultaneous moves | No |
Continuous games[15] | 2007 | functions | subset of two-player games of imperfect information | Yes |
Petri net strategic interactions[16][17] | 2008 | Petri nets | n-player games of imperfect information | Yes |
Action graph games[18] | 2012 | graphs, functions | n-player games, simultaneous moves | No |
![]() | This section needs expansion. You can help by adding to it. (July 2019) |
A 2016 paper "describes a multilevel algorithm compiling a general game description in GDL into an optimized reasoner in a low level language".[19]
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 to efficiently do so.[20]
general
This is the start of the #general chat. #general is a chat channel to discuss anything related to the hub.