News

Overview

Competition

Language

Gamemaster

Gameserver

Resources

CMU Common Lisp Reference Player

Source:

This is a simple port of the MCL reference player to CMU's implementation of Common Lisp, CMUCL.

player-cmucl.tar. This archive contains 5 Lisp source files:

  • minilog.lisp. Contains a backward-chaining reasoner used to compute legal moves, state update, goal and terminating conditions given a game state and GDL game description.
  • gametools.lisp. Contains functions giving legal moves, state update, etc., calling functions defined in minilog.lisp.
  • gameplayer.lisp. Contains functions handling incoming START, PLAY, and STOP messages received from the Game Manager, including managing start and play clocks and storing match data.
  • communication.lisp Contains functions opening TCP sockets to listen for and pass messages from the Game Manager to code in gameplayer.lisp.
  • loader.lisp Loads all source files as starts TCP listeners for incoming messages.

This code has been tested and runs in CMUCL on an x86 Linux machine. Slight changes to the code were necessary to make it run in CMUCL, and a number of helper libraries must be loaded to provide Allegro Common Lisp compatibility (which made the port much easier). A "proper" port would have required taking out all MCL-specific network and process-control function calls, and replacing them with the corresponding CMUCL calls.

Additional Files:

The above files alone are not sufficient to get the reference player running! You must also have a number of Lisp libraries installed on your system that provide the ACL compatibility.

  • .cmucl-init.lisp. A sample .cmucl-init.lisp file to place into your home directory. This is what CMUCL runs on startup, and this is where we load up the helper libraries. If you already have your own .cmucl-init.lisp file, it should be fairly obvious what you need to copy and paste to load up these libraries.
  • We need ACL-Compat, but to get it working correctly we need all of the following libraries:
    • ASDF. Another System Definition Facility
    • ACL-COMPAT. ACL Compatibility Layer
    • PURI. Portable Universal Resource Identifier
    • CL-PPCRE. Common Lisp Portable Perl-Compatible Regular Expressions
    For convenience, we provide two packages of these libraries:
    • lisp-libs-bin.tar.gz. Includes pre-compiled x86 Linux libraries. Same as the src distribution below, but with all libraries compiled using CMUCL's compiler.
    • lisp-libs-src.tar.gz. Same as above, but not compiled. You don't technically need to compile (I don't think) but you will gain a significant load-time performance boost if you do.

Installing/Using the Lisp Libraries:

Not much is required to install the libraries. With either the source or binary packages, you will need to put them in a directory somewhere, and set your .cmucl-init.lisp file to point to those libraries. If you look at the sample .cmucl-init.lisp file, you can see how I set things up. Make sure that you load ASDF before the .asd files.

If you are using the source files, you should compile them. Most of them provide instructions on how to do that, so I'll leave it up to you if you take the source packages.

And finally, note what loader.lisp does before it loads the main GGP player code. Namely, it unlocks the default package set, so that certain global names can be replaced; also, it loads up acl-compat using ASDF's loader, which then proceeds to load up all dependencies. If you have compiled versions it will load those automatically; else, I believe it will compile the source files on-the-fly (but not store the compiled version).

Contact:

The Linux port was provided by David Haley (dhaley@cs.stanford.edu). This code is provided for convenience and the MCL code is the 'reference' reference player (as it were), and only limited support is available for the Linux code. That being said, any feedback or especially bug reports would be most appreciated; please send them to either David or info@games.stanford.edu.




Send comments to action@games.stanford.edu.