[comp.ai] Writing an AI Program

elon@phsbbs.princeton.nj.us (Elon Danziger) (06/09/91)

     I was recently referred to three books about AI, namely GODEL ESCHER 
BACH, AI AND NATURAL MAN, and MACHINES WHO THINK (I have the first two and 
can get the last).  What I would like to do is to try to write some type of 
AI program--probably in Pascal.  I have quite a bit of experience with 
Pascal, but not that much with AI.  My question is, can anyone point out 
anything particularly interesting that I could program (given the limitation 
that I have a Mac IICX, and limited space and memory)?  I've seen some 
really impressive accounts of AI in AI AND NATURAL MAN, but I'm not sure how 
feasible it is to try to program some of the examples on my computer.
     I want to make clear that I am more interested in getting a feel for AI 
than trying to do something original.
     Thanks in advance.
 
-Elon

mcovingt@athena.cs.uga.edu (Michael A. Covington) (06/09/91)

Most AI programs would be very long and unwieldy in Pascal because of the
complex data structures involved.

The usual programming languages for AI are Lisp and Prolog. Textbooks
for either of these languages usually feature lots of AI examples.

I believe XLISP (a public-domain Lisp interpreter) is available for the
Macintosh, though I don't know where you'd get it. A good AI-oriented
Lisp textbook is Winston and Horn's "Lisp", 3rd edition.

As for Prolog, there is a good public domain Prolog for the PC but not
for the Mac as far as I know. You can download the PC one by anonymous
ftp from aisun1.ai.uga.edu. A suitable Prolog textbook is "Prolog
Programming in Depth," by Covington, Nute, and Vellino.


-- 
-------------------------------------------------------
Michael A. Covington | Artificial Intelligence Programs
The University of Georgia  |  Athens, GA 30602   U.S.A.
-------------------------------------------------------

scotp@csc2.essex.ac.uk (Scott P D) (06/12/91)

In article <P3P935w164w@phsbbs.princeton.nj.us> elon@phsbbs.princeton.nj.us (Elon Danziger) writes:
>
>     I was recently referred to three books about AI, namely GODEL ESCHER 
>BACH, AI AND NATURAL MAN, and MACHINES WHO THINK (I have the first two and 
>can get the last).  What I would like to do is to try to write some type of 
>AI program--probably in Pascal.  I have quite a bit of experience with 
>Pascal, but not that much with AI.  My question is, can anyone point out 
>anything particularly interesting that I could program (given the limitation 
>that I have a Mac IICX, and limited space and memory)?  

Don't be put off be those who tell you that you have to use Lisp or Prolog
to do real AI.  While there are good reasons why those languages are
widely used, you can do a lot of interesting work using Pascal.  If you
stick to problems that don't need fancy knowledge representation schemes
you can do a great deal with a straightforward procedural language.  In fact
quite a lot of machine learning research work is done using Pascal or C.

The "Manhattan Cab Driver" would make a good start.  The system is given
a town plan, which consists of a rectangular grid of roads.  To make the
problem interesting some of the roads are closed and some are one-way
streets.  Then the system is given a start point and a destination.  Its
task is to find a good (eg shortest) route from one to the other.  This
problem will allow you to try out a variety of search techniques.  Provided
you are familiar with building and manipulating lists using pointers, you
should have no problem doing this in Pascal.  You could also arrange for
the town plan to be displayed and thus illustrate how the searches proceed.

I don't think you will find any of the three books you mention to be
particularly helpful in writing AI programs.  I would suggest you try to
get hold of a decent introductory textbook on the subject: Rich & Knight's
"Artificial Intelligence" (McGraw-Hill, 1991) is pretty good and isn't
built around either Lisp or Prolog.  It would also provide you with further
ideas for programming projects.


Paul Scott, Dept Computer Science, University of Essex, Colchester, UK.

simon@engcon.marshall.ltv.com (SHSIMON) (06/14/91)

If you have read those book, I commend you.  If you want to get into creating
new AI programs, you may want to learn LISP and PROLOG, but for simple
investigation, PASCAL is fine...although, I suggest you learn C also.

I hope you can read other languages and translate.  There is a book called
AI in PASCAL, written by the same author who wrote AI in C.  I do not
remember his name, but the local bookstores, libraries, and grad students at
the AI dept at Princeton should be happy to help...focus on finding the
AI in C book; it is more easily available.  I think he has a copy of ELIZA.

There are also books on AI in BASIC.  BASIC Artificial Intelligence by Mike 
James (1986)  has some good programs.  I personally do not like BASIC, but
I can't argue with successful implementations...again the programs can be
translated to PASCAL and the ability to translate ideas is very, very important
in AI.

By the WAY,  just for another point of reference, one of the very early expert
System Shells called EXPERT was originally written in FORTRAN.  

Good Luck,

Hank