views:

5523

answers:

19

Besides Lisp and Prolog what is a good programming language for programming intelligent systems?

+1  A: 

Forth has also been used widely I think

epatel
+1  A: 

In general - functional languages and logical languages. Maybe Haskell can be used for this, F# and O`Caml family of languges.

But good ideas can be implemented in almost any languge, so they are the first requirement.

cleg
+1  A: 

You may want to check out LUA and Python.

LUA has been used in a couple of recent games for scripting and AI

http://www.lua.org/about.html

and Python is probably a good choice too, World in Conflict uses python for modding

Cetra
Having been a game developer, I wouldn't class game code as being anything near good AI. Games usually use a randomised, weighted state system which has been designed and tweaked to make the game playable and fun. For example, in FarCry, you sniper a guard and he falls to the ground, the other guards carry on as normal. Or one guy with a crow bar verses a SWAT team!
Skizz
A: 
shaleen mohan
Did you write the Wikipedia article on this subject? If not you should attribute your source to Wikipedia, otherwise it's plagiarism.
Nick
I have edited that post by shaleen, to make it clear that it is a quote of wikipedia
kristof
+1  A: 

Article on AI in wikipedia also mentions:

  • IPL, includes features intended to support programs that could perform general problem solving, including lists, associations, schemas (frames), dynamic memory allocation, data types, recursion, associative retrieval, functions as arguments, generators (streams), and cooperative multitasking.
  • STRIPS, a language for expressing automated planning problem instances. It expresses an initial state, the goal states, and a set of actions. For each action preconditions (what must be established before the action is performed) and postconditions (what is established after the action is performed) are specified.
  • Planner is a hybrid between procedural and logical languages. It gives a procedural interpretation to logical sentences where implications are interpreted with pattern-directed inference.

Simple AI could be easily programmed with C/C++ or any other. (i'm talking about simple poker AI or something like that)

+2  A: 

It depends what you mean by AI and intelligent systems as it is quite a diverse field. Intelligent systems can have massive database backends so they can appear "knowledgable". In videogames though, the idea is to make the AI entity behave in an engaging way (e.g. an opponent) and not "behave stupidly" (e.g. run into a wall etc). Other forms of AI are really just searching a problem domain for an answer, where functional languages (e.g. Haskell, Erlang) are quite strong because they are declarative.

Videogame AI tends to be stateful, i.e. you decide to do something, sample inputs, and if the inputs trigger a change you start to do something else. E.g. I walk into an area where an ogre is waiting; he sees me (trigger) and attacks me (change of state from waiting). Languages that support continuations make implementation easier as they can be updated and retain their state (i.e. you remember what you were doing last time).

Lua is widely used in videogames because it is easy to embed, fast, lightweight and has coroutines (cooperative s/w threading). Python is also used because it is easy to learning. Many games have their own custom scripting languages that allow configuration and control of the game flow and logic. Generally, scripting languages are used in games because you don't have to recompile the game to make a change to the game behaviour, so development time is faster.

Prolog is used for AI because it is declarative. In declarative languages you "specify the problem", rather than explicity state "what to do" (i.e. as you do in imperative languages, like C). Other languages will be chosen based on their suitability for solving the problem in front of you.

Nick
A: 

Historically the Intro to AI course at my alma mater was taught using Lisp. Now it's taught using Python.

amrox
+12  A: 

AI has become such a huge field that it is virtually impossible to say what language is "best" for it. First, you should narrow down the domain, and state what sub-field of AI you are interested in (computer vision, machine learning, search, planning, robotics, natural language processing, etc.). Second, are you doing research, i. e. algorithm development, or do you want to build a production system to be used by people? In the former case you should choose a language that allows you to easily prototype stuff. For that Matlab would be a good choice, if you have access to it.

If you are building a production system, such as a computer vision system, a robot, or a game, then you will be constrained in your choice of a language by the speed requirements and by the platform on which the system will work. E. g. you would probably write a vision system in C++, although you may get away with doing it in Java. Lisp, on the other hand may not be very suitable.

Dima
+1 Excellent response!
Kensai
+1  A: 

Way Back (tm) when I was in University, all the Neural Nets courses were done in C. The reason being performance and the close mapping between C's arrays and NNs.

dsm
+1  A: 

I would say use a fast, general purpose, highly portable language with wide library support like C++. Whichever language works on your target platform that you are most productive in would be your best bet.

postfuturist
A: 

I'm not so sure that LISP and Prolog are suitable AI languages as of now...the reason being mostly that they are restricted to solving a particular kind of problems. Most top-level languages will do your job anyway I guess. What will (most probably) be required at some time is the speed (I'm talking about practical situations, and real world problems, which unfortunately are from ideal). Then a fast programming language will be your friend. A good choice would be IMO : C/C++. Good luck.

Wartin
+6  A: 

Haskell is also a very good programming language for AI. Lazy evaluation and the list and LogicT monads make it easy to express non-deterministic algorithms, which is often the case. Infinite data structures are great for search trees. The language's features enable a compositional way of expressing the algorithms. The only drawback is that working with graphs is a bit harder at first because of purity.

Take a look at the following paper, which compares Haskell and Prolog for programming search problems:

Escape from Zurg: An Exercise in Logic Programming

http://web.engr.oregonstate.edu/~erwig/papers/Zurg_JFP04.pdf

Herrmann
A: 

Use a Lisp

A: 

Not mainstream: I have worked with AI and robotics scientists who used VHDL for putting their algorithms in FPGA.

mouviciel
A: 

One feature of a language that makes it very interesting for AI is homoiconicity, that means that code and data have the same internal representation (read the text for better explanation).

A language with this property is able to modify itself to better suit the problem.

These are some homoiconic languages:

  • Clojure
  • Lisp
  • Prolog
  • Snobol
  • TCL
alvatar
SNOBOL, wow. Haven't seen that one in awhile.
outis
A: 

Mathematica is probably great for AI, since it has a lot of mathematical functions, like graphs algorithms and such. It is also very easy to do iamge analysis in mathematica, so i'd say it is very versatile.

Paxinum
+1  A: 

I have limited exposure to AI, mainly involving LISP so I don't know I'd venture to answer what's the "best" one, but I will share the one I've found most interesting.

In a game programming course at University, I was introduced to a language called SOAR, which my professor had helped create. SOAR attempts to model human cognition so it likely would not be ideally suited to your needs, but it is used to do things like model situational awareness for fighter pilots. In that sense it differs from in purpose from traditional intelligent system in that it isn't necessarily intended to find the best solution as to model how a human would evaluate things in a given situation.

On the downside, just understanding the architecture was extremely difficult and even writing a 25 line piece of code took me almost 40 hours--though to be fair, I was new to the language and concepts.

Zac
A: 

When crunching big data-sets for AI and Machine Learning, do look to use C and the extensions for taking advantage of the GPU. EG Nvidia's CUDA and http://gpgpu.org/.

dlamblin
A: 

I think VB is an excellent AI language. The reason: it's the easiest language around now.

People think that Lisp is hard, but actually the reason it was a good language for AI is that it was just about the easiest language around, at the time. Built in data structures, pretty much automatic syntax checking (given any reasonable editor), debugging, inspection, introspection, automated garbage collection, structure editors.

Intellisense gives many of the advantages of Lisp structure editors.

The main properties of an AI language is that you be able to write a lot of code, very fast, with few errors, and that the resulting code run reasonably fast. As far as functional programming goes, in any language you can break down a program into smaller and smaller functoins - Lisp, Prolog, or VB - then internally in Lisp I was using a lot of setf and loop constructs - what's the difference from VB?

By the way, VB/C# - just a syntactic difference or preference. Either one would be fine.

Larry Watanabe