Loading ...
Sorry, an error occurred while loading the content.

Running the AIMA LISP code with a freeware LISP (long)

Expand Messages
  • Antti Ylikoski
    I have been, and am in the process of, delving into the AIMA LISP code with the GNU Emacs plus the SLIME Integrated Development Environment, and I have been
    Message 1 of 1 , Jul 1 2:44 AM
    • 0 Attachment
      I have been, and am in the process of, delving into the AIMA LISP code
      with the GNU Emacs plus the SLIME Integrated Development Environment,
      and I have been trying out the AIMA LISP code with the various
      freeware LISP's that there are there publicly available as freeware.

      About the Common LISP language and the various existing
      implementations, see :

      http://en.wikipedia.org/wiki/Common_Lisp

      http://en.wikipedia.org/wiki/Common_Lisp#List_of_implementations

      ----------------------------------------------------------------------

      About the SLIME, see

      http://en.wikipedia.org/wiki/SLIME

      and concerning the GNU Emacs, see

      http://en.wikipedia.org/wiki/Emacs

      ----------------------------------------------------------------------

      Personally, I prefer to use the Clozure Common LISP with the Emacs +
      the SLIME in order to run the AIMA code. Also, The Steel Bank Common
      LISP (the SBCL) is perfecly usable, and is being considered a very
      high quality Common LISP implementation, but there is one particular
      beauty flaw with the SBCL's Windows implementation -- as it compiles a
      big program, it will print a huge mass of text which I find not
      optimally usable. The SBCL's Unix implementation will not give such a
      big set of compilation notes, interestingly.


      ----------------------------------------------------------------------

      The ABCL, the Armed Bear Common LISP, is a LISP implementation written
      in the Java language.

      http://common-lisp.net/project/armedbear/

      This one will run with the SLIME, and it looks like a good, solid LISP
      implementation, but because my time for this pastime is very limited,
      I have not tried out it with the AIMA code.

      Run the .jar file with:

      C:\>java -jar abcl.jar

      ----------------------------------------------------------------------

      The CLISP is a virtual machine based Common LISP implementation. It
      will run with the SLIME. It looks like a very good implementation,
      with both a compiler and interpretive execution. However, I have not
      tried out it with the AIMA code.

      http://en.wikipedia.org/wiki/CLISP

      ----------------------------------------------------------------------

      The Clozure Common LISP (CCL) is the freeware Common LISP
      implementation which I personally prefer. It has all the details and
      the features just right.

      For a download, see:

      http://ccl.clozure.com/download.html

      For their company pages, see:

      http://www.clozure.com/clozurecl.html

      See

      http://en.wikipedia.org/wiki/Clozure_CL

      The incantation to say to the program that we are in the CCL is the
      directive #+CCL :

      ----------------------------------------------------------------------
      ;;; The SLIME with the CCL:

      ; SLIME 2012-05-04
      CL-USER> (print '(#+CLISP 'its-a-clisp))

      NIL
      NIL
      CL-USER> (print '(#+CCL 'its-a-CCL))

      ('ITS-A-CCL)
      ('ITS-A-CCL)
      CL-USER>

      ----------------------------------------------------------------------

      When running the AIMA code, the CCL also will output a number of
      warnings -- but these are harmless, they all are caused by functions
      being used before their definition, which in this case will not hurt.

      There are two bugs there: the FORMAT directive ~V is being used in the
      AIMA code, but it is not there in the CCL. Moreover, the directives
      (à la #+CLISP) to point out to the program which LISP implementation
      is being used, do not include the option #+CCL.

      ;;; Testing the AIMA code with the CCL:

      ; SLIME 2012-05-04
      CL-USER> (load "aima.lisp")
      ;Compiler warnings for "C:/aima/utilities/utilities.lisp" :
      ; In FOR-EACH: Unknown directive in format string:
      ; "~V is an illegal variable in (for each ~V in ~A ...)"
      ; ^
      ;
      #P"c:/aima/aima.lisp"
      CL-USER> (test 'all)
      ;Compiler warnings for "C:/aima/agents/environments/basic-env.lisp" :
      ; In (INITIALIZE (ENVIRONMENT)) inside an anonymous lambda form:
      Undefined function INITIALIZE-AGENT-NAMES
      ; In MAKE-AGENT: Undefined function MAKE-AGENT-BODY
      ;Compiler warnings for "C:/aima/agents/environments/grid-env.lisp" :
      ; In FREE-LOC?: Undefined function FIND-OBJECT-IF
      ; In PARSE-WHAT: Undefined function PLACE-OBJECT
      ; In (RELEASE (GRID-ENVIRONMENT T)) inside an anonymous lambda form:
      Undefined function PLACE-OBJECT
      ; In (GRAB (GRID-ENVIRONMENT T)) inside an anonymous lambda form:
      Undefined function FIND-OBJECT-IF
      ; In (GRAB (GRID-ENVIRONMENT T)) inside an anonymous lambda form:
      Undefined function PLACE-IN-CONTAINER
      ; In (FORWARD (GRID-ENVIRONMENT T)) inside an anonymous lambda form:
      Undefined function MOVE-OBJECT-TO
      ; In (FORWARD (GRID-ENVIRONMENT T)) inside an anonymous lambda form:
      Undefined function ADD-LOCS
      ; In (PRINT-STRUCTURE (OBJECT T)) inside an anonymous lambda form:
      Undefined function HEADING->STRING
      ;Compiler warnings for "C:/aima/agents/environments/vacuum.lisp" :
      ; In (SUCK (VACUUM-WORLD T)) inside an anonymous lambda form:
      Undefined function FIND-OBJECT-IF
      ; In (SUCK (VACUUM-WORLD T)) inside an anonymous lambda form:
      Undefined function PLACE-IN-CONTAINER
      ; In (GET-PERCEPT (VACUUM-WORLD T)) inside an anonymous lambda form:
      Undefined function FIND-OBJECT-IF
      ;Compiler warnings for "C:/aima/agents/environments/wumpus.lisp" :
      ; In PROPAGATE-ARROW: Undefined function FIND-OBJECT-IF
      ; In PROPAGATE-ARROW: Undefined function FIND-OBJECT-IF
      ; In PROPAGATE-ARROW: Undefined function FIND-OBJECT-IF
      ; In PROPAGATE-ARROW: Undefined function ADD-LOCS
      ; In (GET-PERCEPT (WUMPUS-WORLD T)) inside an anonymous lambda form:
      Undefined function FIND-OBJECT-OR-NEIGHBOR-IF

      ;;; et cetera............

      ----------------------------------------------------------------------

      The CMUCL is the the Carnegie-Mellon University Common LISP.
      See:

      http://en.wikipedia.org/wiki/CMUCL

      The CMUCL only is available for Unix and Linux.


      ----------------------------------------------------------------------

      the ECL, the Embeddable Common LISP

      http://en.wikipedia.org/wiki/Embeddable_Common_Lisp

      This one looks good, but I have not tried out it, because of my
      limited time that I can use for this hobby. Somebody over there might
      want to run the ECL with the Emacs + the SLIME + the AIMA code and
      write about his/her experiences.

      ----------------------------------------------------------------------

      The GCL is the GNU Common LISP. There exists a (partially) ANSI
      standard compliant JAPI (Java Applications Programming Interface)
      implementation:

      http://en.wikipedia.org/wiki/GNU_Common_Lisp

      I have not tried the GNU Common LISP with the Emacs + the SLIME + the
      AIMA code. My spare time is limited, namely. I did try it to a large
      enough extent to see that it is a full-fledged, good, working
      implementation, though regrettably not 100% ANSI compliant.

      ----------------------------------------------------------------------

      For Apple(TM) Mac users: the Macintosh Common LISP. Clozure derives
      its heritage from this one, historically.

      http://en.wikipedia.org/wiki/Macintosh_Common_Lisp

      ----------------------------------------------------------------------

      The Poplog is a British-created software environment, which offers the
      programmer the Common LISP, Prolog, POP-11, and the Standard ML. I
      have not attempted to run the Poplog with the SLIME or the AIMA code,
      even though I did try out the Poplog with the Linux and liked it.

      See:

      http://en.wikipedia.org/wiki/Poplog

      ----------------------------------------------------------------------

      The SBCL, the Steel Bank Common LISP, is an offspring of the CMUCL.
      It would be technically one of the best ones of this group, and is
      being considered a very high quality LISP implementation, but I
      dislike its tendency to output a very large number of almost useless
      warnings as it compiles a big program. The SBCL will flawlessly run
      the AIMA LISP code. The incantation to point out to the LISP system
      that we are being in the SBCL is the directive #+SBCL, as follows:

      ----------------------------------------------------------------------
      ;;; The SLIME with the SBCL:

      ; SLIME 2012-05-04
      CL-USER> (print '(#+CMU 'its-a-CMU))

      NIL
      NIL
      CL-USER> (print '(#+SBCL 'its-a-SBCL))

      ('ITS-A-SBCL)
      ('ITS-A-SBCL)
      CL-USER>

      ----------------------------------------------------------------------




      kind regards, Antti J Ylikoski
      Helsinki, Finland, the EU
      antti.ylikoski@...
      http://www.hut.fi/~ajy/
      http://www.hut.fi/~ajy/diss.pdf
      PhD student, Aalto University
      http://www.aalto.fi
    Your message has been successfully submitted and would be delivered to recipients shortly.