Hanwei Lee (h5lee@ucsd.edu)
Spring 2000
A Good Language for Artificial Intelligence
     The choice for a suitable language to program artificial intelligence requires careful

consideration.  What sort of requirements must a language meet in order to be able to

program AI?  The answer can be determined by examining the most powerful features of

a language and how they are used in conjunction with AI.

     One advocate for Prolog, Denis Susac (http://ai.about.com/compute/ai/library/weekly/aa012000a.htm),

cites that a language should be modeled after first-order predicate logic.  A predicate consists

of an action which is modified by an object.  An example would be something like, "Loves(Jack, Jane)".

This example would say that Jack loves Jane due to the action being modified by the

objects.  Susac argues that declarative programming languages, such as Prolog "have their

commands executed in the order necessary to achieve the solution, not the order that can be

easily followed from the source code".  This statement says that the functionality of the

language is more important that readability.  This should obviously be true because the

correctness of an algorithm should have the utmost importance.

     The relationship between objects is also an important feature when selecting a

language for AI.  One should take a look at the example Susac describes.  The relationship

between a person and his grandparents can be described as a parent of a parent of a person.

While this example is using a relationship which is easily visible to programmers and

non-programmers alike, it does demonstrate how objects within a language can be

related to one another by virtue of syntax and not mere intuition.

    The author of the book for this course, Peter Norvig, advocates the use of Python and

Lisp due to features such as "high-level built in data structures, combined with dynamic

typing and dynamic binding" (http://www.norvig.com/python-lisp.html).  It is these features

which aid in Rapid Application Development.  Features like the ones mentioned above

aid in AI because it allows for more powerful representations of real functions.

     Several other criteria make Lisp, and similarly Python, a good candidate for a good AI

language.  One such thing is that both support heterogeneous lists.  This can be rather useful

when objects in a list are not the same data type.  Both also have relatively the same

basic data types (i.e. list, integer, float, complex, string, etc.)  The ability to have a list

as a native basic type is very powerful.  In the programming assignments for CSE150, all

the data had to be stored in lists and processed from them accordingly.  It is fully possible

to have implemented those projects in arrays (if we were to do it in another language),

however, the manipulation of such arrays get costly and time-consuming. It is much easier to

be able to recursively call a list to perform the search algorithms than to maintain an array


     For me to choose a language which I think is best for AI would be rather premature as I

have only had hands on experience with Lisp.  Lisp indeed is a powerful tool for performing

operations such as higher-order functions.  However, by reading the descriptions of the

languages described above, I would say that Prolog appears to be the language of choice

for doing AI.  The predicate nature of the language is rather unique and is conducive to

expressing relationships between objects and actions more naturally.