Game Description Language Explained

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.

Purpose of GDL

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.

Specification

Syntax

GDL is a variant of Datalog, and the syntax is largely the same. It is usually given in prefix notation. Variables begin with ?.[2]

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 means that the player (or role) ?r makes the move ?m in the current game state.
    goal
  • The predicate 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 fact about the initial game state.
    legal
  • The predicate means that ?m is a permissible move for role ?r in the current state.
    next
  • This predicate refers to a 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 an end state of the game.
    true
  • This predicate refers to a fact about the current game state.

    Rules

    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.

    Players

    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).

    Initial state

    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))

    Legal moves

    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)))

    Game state update

    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)))

    Termination

    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)

    Goal states

    The values that determine which player wins in an end state. An example is:(<= (goal xplayer 100) (line x))(<= (goal oplayer 0) (line x))

    Extensions

    GDL-II

    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 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)))

    GDL-III

    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]

    Other methods of game representation

    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:

    NameYearFormalized withGame typeTime aspect
    Congestion game[6] 1973functionssubset of n-player games, simultaneous moves
    Sequential form[7] 1994matricestwo-player games of imperfect information
    Timed games[8] [9] 1994functionstwo-player games
    Gala[10] 1997logicn-player games of imperfect information
    Graphical games[11] [12] 2001graphs, functionsn-player games, simultaneous moves
    Local effect games[13] 2003functionssubset of n-player games, simultaneous moves
    Game Petri nets[14] 2006Petri netsdeterministic n-player games, simultaneous moves
    Continuous games[15] 2007functionssubset of two-player games of imperfect information
    Petri net strategic interactions[16] [17] 2008Petri netsn-player games of imperfect information
    Action graph games[18] 2012graphs, functionsn-player games, simultaneous moves

    Applications

    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]

    See also

    External links

    Notes and References

    1. Web site: Producing the ultimate game-playing bots - tech - 29 July 2006 - New Scientist Tech. Biever. Celeste. 2006-07-29. https://web.archive.org/web/20070811111042/http://www.newscientisttech.com/channel/tech/mg19125626.100.html. 11 August 2007. live.
    2. Web site: Love . N . Genesereth . M . Hinrichs . T . General game playing: game description language specification. Tech. Rep. LG-2006-01 . Stanford University . Stanford University, Stanford . 1 July 2019 . 2006 . 24 February 2021 . https://web.archive.org/web/20210224191339/http://logic.stanford.edu/reports/LG-2006-01.pdf . dead .
    3. Thielscher . M . Fox . M . Poole . D . A general game description language for incomplete information games . Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2010 . 2010 . 1 July 2019 . AAAI Press . Atlanta.
    4. Book: Thielscher . Michael . Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence . 2017 . IJCAI . 978-0-9992411-0-3 . https://www.ijcai.org/proceedings/2017/0177.pdf . 1 July 2019 . GDL-III: A Description Language for Epistemic General Game Playing.
    5. Tagiew . Rustam . If more than Analytical Modeling is Needed to Predict Real Agents' Strategic Interaction . 3 May 2011 . 1105.0558 . cs.GT .
    6. Rosenthal . Robert W. . Robert W. Rosenthal . A class of games possessing pure-strategy Nash equilibria . International Journal of Game Theory . December 1973 . 2 . 1 . 65–67 . 10.1007/BF01737559. 121904640 .
    7. Book: Koller . Daphne . Daphne Koller . Megiddo . Nimrod . Nimrod Megiddo . von Stengel . Bernhard . Proceedings of the twenty-sixth annual ACM symposium on Theory of computing - STOC '94 . Fast algorithms for finding randomized strategies in game trees . 750–759 . 1994 . 10.1145/195058.195451 . 0-89791-663-8 . 1893272 .
    8. Alur . Rajeev . Dill . David L. . A theory of timed automata . Theoretical Computer Science . April 1994 . 126 . 2 . 183–235 . 10.1016/0304-3975(94)90010-8. free .
    9. Tomlin . C.J. . Lygeros . J. . Shankar Sastry . S. . A game theoretic approach to controller design for hybrid systems . Proceedings of the IEEE . July 2000 . 88 . 7 . 949–970 . 10.1109/5.871303. 2000IEEEP..88..949T . 1844682 . 10.1.1.129.8347 .
    10. Koller . Daphne . Pfeffer . Avi . Representations and solutions for game-theoretic problems . Artificial Intelligence . 1997 . 94 . 1–2 . 167–215 . 10.1016/S0004-3702(97)00023-4 . free .
    11. Michael . Michael Kearns . Littman . Michael L. . Graphical Models for Game Theory . In UAI . 2001 . 253–260 . 10.1.1.22.5705 .
    12. Kearns . Michael . Littman . Michael L. . Singh . Satinder . Graphical Models for Game Theory . 7 March 2011 . 1301.2281 . cs.GT.
    13. Leyton-Brown . Kevin . Tennenholtz . Moshe . Local-effect games . IJCAI'03: Proceedings of the 18th International Joint Conference on Artificial Intelligence . 2003 . 772–777 .
    14. Clempner . Julio . Modeling shortest path games with Petri nets: a Lyapunov based theory . International Journal of Applied Mathematics and Computer Science . 2006 . 16 . 3 . 387–397 . EN . 1641-876X.
    15. Sannikov . Yuliy . Games with Imperfectly Observable Actions in Continuous Time . Econometrica . September 2007 . 75 . 5 . 1285–1329 . 10.1111/j.1468-0262.2007.00795.x .
    16. Book: Tagiew . Rustam . 2008 International Conference on Computational Intelligence for Modelling Control & Automation . Multi-Agent Petri-Games . December 2008 . 130–135 . 10.1109/CIMCA.2008.15 . 978-0-7695-3514-2 . 16679934 .
    17. Book: Tagiew . Rustam . On Multi-agent Petri Net Models for Computing Extensive Finite Games . New Challenges in Computational Collective Intelligence . 244 . 2009 . 243–254 . 10.1007/978-3-642-03958-4_21 . Springer . en. Studies in Computational Intelligence . 978-3-642-03957-7 .
    18. Bhat . Navin . Leyton-Brown . Kevin . Computing Nash Equilibria of Action-Graph Games . 11 July 2012 . 1207.4128 . cs.GT.
    19. Book: Kowalski . Jakub . Szykuła . Marek . AI 2013: Advances in Artificial Intelligence: 26th Australasian Joint Conference, Dunedin, New Zealand, December 1-6, 2013. Proceedings . 2013 . 234–245 . https://www.researchgate.net/publication/289992641 . 1 July 2019 . Game Description Language Compiler Construction.
    20. de Jonge . Dave . Trescak . Tomas . Sierra . Carles . Simoff . Simeon . López de Mántaras . Ramon . 2017 . Using Game Description Language for mediated dispute resolution . AI & Society . 2017 . 4 . Springer . 767–784 . 10.1007/s00146-017-0790-8 . 22738517 .