Garner Lee

CSE151 Short Essay #1


What special needs does AI have of a programming language? What language do you think best accomplishes these objectives?

To talk about what a programming language needs to support its use in AI implies the question of how we define AI. What is to be achieved? My definition of AI is how should a computer determine a course of action that would arrive at a solution given a set of constraints in a apparently "intelligent" manner. I argue that it does not necessarily have to be something a human would do, only that there be a logical and if time to solve something were a constraint, a good heuristic should be found/selected by the AI to get the "solution" or "correct" set of actions. "Intelligent " in my definition would mean accepting some input, and produce an answer where the desired result is most closely approached (Russell, Norvig (1)). As Russell and Norvig described, this "agent" in embodies all the supporting elements that is needed to intelligently analyze the given input.

One thing obvious for intelligent systems is that they should be able to learn from past performances of their decisions. Naturally, this requires some way of remembering what has happened. From this, it should be able to recognize past winning patterns and try to determine the best action. A programming language should therefore make it relatively simple to store and retrieve that information. A programming language should make it easy to construct the basic elements required to construct these intelligent systems in terms of ease of coding, and ease of debugging.

AI should be able to store past information and use that information to decide newer situations. Otherwise, that AI would be little more than a slightly enhanced way to program a desired behavior. The language should easily support the basic elements that form the storage and allow the type of execution an AI program desires. According to Russel and Norvig(3):

"[AI consists of] the learning element, which is responsible for making improvements, and the performance element, which is responsible for selecting external actions. The learning element takes some knowledge about the learning element and some feedback on how the agent is doing, and determines how the performance element should be modified to hopefully do better in the future. The design of the learning element depends very much on the design of the performance element."

From my experience thus far, one troublesome aspect of programming AI in particular is that because the results may not be extremely clear cut and predictable, it is quite possible that the system is incorrectly programmed with a code bug or two that does not manifest itself well. Since the goal may well be to learn something, the learning algorithm itself can mask that error(2). Take for instance back propagation in a neural network for learning. Unless thoroughly tested, it can well appear that the system is functioning properly as intended. As the system becomes larger, with the networks layered and aggregated to form a larger more complex network.

In this particular representation of AI, there is a need to support multidimensional arrays, and also easy dynamic allocation of them. Furthermore, since back propagation essentially needs to manipulate matrixes, the language should provide easy support for such operations. LISP for instance, makes this a doable task, but is far from ideal for this task as a symbol manipulation language without a prewritten library. C/C++ also has the same problem but has the extra handicap of forcing the user to look for a garbage collector, or manage the memory allocation by themselves. Fortran, I believe lacks high level forms of data encapsulation like objects, and the lack of recursion will definitely hurt itís ease of use if one must hack the functionality into it. Recursion is one way to act on data in a structured way to get a solution. Java however, has good dynamic allocation of multidimensional arrays (unlike C/C++ where hacks are required to add support), classes, recursion, and garbage collection. Garbage collection in particular is important for any real system to work because real systems my need to run for long stretches of time. However, lacking built in support for matrix operations hurts it a bit. As a strongly typed language, however, it lacks the symbol manipulation slant of LISP where the distinction of one type to another can be as simple as the list structure, and the implicit types that LISP automatically resolves. Java does have a syntax structure for pushing the programmer towards complex high level objects like classes, which relieves this constraint a bit as long as the AI needs simple elements to build up the desired effect.

The more complex the data however, the more need there is to abstract the details of what makes up the network. I believe LISP because of its recursive nature is both powerful, and a bit difficult to debug due to small number of tools to help debug programs. The bent towards objects is an important aspect of Java, since if the AI program gets complex, the need to be able to debug the AI implementation becomes important. If manipulations of the basic elements are difficult, it can well make it difficult to debug, and moreover, difficult to concentrate efforts on how to build a good system to make decisions on.

The language should not hinder the programmer with unnecessary details of dealing with building the network, and should encourage high level thinking once the basic building blocks of the AI system is constructed. Java achieves this be eliminating the need to explicitly manage memory usage, provides recursion, an strong leaning towards high level thinking, and good clean ways to allocate memory dynamically. While it isnít "ideal" I think it does the best job thus far.



Stuart Russell and Peter Norvig, Artificial Intelligence: A Modern Approach, Prentice Hall, Upper Saddle River, New Jersey, 1995, pg 31(1), pg. 525(3).

Garry Cottrell, Lecture on back propagation, Winter 2000(2).