Best AI programming language?

Started by
37 comments, last by caleb_yau 14 years, 5 months ago
Quote:Original post by dj3hut1
Hello,

why not use a logic programming language like Prolog or a constraint logic programming language? ( f.e. http://eclipse-clp.org/ )


And why would you?
Advertisement
If you want a game to simply make things up until if hones in on a "creative solution" (and I agree that is kinda nebulous), why not use a GA whose genes represent a sequence of potential actions? What actions? Depends on what you are trying to do. Can you do it in chess? Not even remotely.

I concur with what was mentioned above... methinks you need to read a lot more and do some "normal" AI programming before you start trying to accomplish something that no one has done before.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Quote:Original post by alvaro
And why would you?


You can gladly come with some constructive comment, but right now you are not contributing to anything.
TriKri,

It sounds like you might be trying to bite off more than you can chew. Chess is a very difficult game to work with, even without the complication of a 'creative' AI component.

Dynamically generating code is also very complicated; dynamically generating meaningful code even more so!

If you had some chess experience already then I'd say 'Go for it', but you don't, so I won't. :)

As much as I hate saying this, I think InnocuousFox is right and you'll probably be much happier with yours results if you take his advice about the GA and potential actions.

Quote:Original post by TriKri
Quote:Original post by alvaro
And why would you?


You can gladly come with some constructive comment, but right now you are not contributing to anything.


Actually, that could be seen as constructive in the sense that the poster is communicating that he wants the poster to which he's responding to think about why he would use something, since really that's the more important thing in this case than why he would not use something. The question is basically "Why would you [use Prolog instead of Lisp or Lua or Python as an AI scripting language]?" It's a legitimate question-response.
Best language? English! If you can clearly describe the problem you can code it...
Quote:Original post by alvaro
Quote:Original post by dj3hut1
Hello,

why not use a logic programming language like Prolog or a constraint logic programming language? ( f.e. http://eclipse-clp.org/ )


And why would you?


Prolog is good for solving search problems like the AI for chess.
The advantage is, that you don't have to code the algorithm, you must only declare the problem in the right way.

And a CLP is even more beneficial, because you have the ability to restrict the search space with the help of simple constraints.
You have to choose whether you want a "creative" Chess AI, or a Chess AI that can actually beat other players. The traditional minimax Chess AI considers ALL possibile moves - good, bad, creative, astounding, stupid, the lot - within a certain number of moves ahead (<= a limitation of computer speed, not minimax) and then picks the move that gives it the best advantage. So if there is a creative move that is good, it'll get considered in due course!

You seem to believe that creative moves are the same as good moves.. In the early histories of Chess programming, there were two opposing schools of thought (you can read about this on Wiki) the one where Chess programs should try to replicate human creative and desicion making processes, and the other where Chess programs work more like the "brute-force" method (ie minimax). In those days it was a legitimate question because computers were much slower, and minimax is costly. But in practice, when computers became faster, the minimax method beat even the very complex "creative" methods hands down. It isn't elegant, but it's what works.

So my suggestion is, you need to think about what your goal is. If you want to make a Chess AI that doesn't suck, use minimax. If you want to explore more "interesting" aspects of AI methods, and were just using Chess as example, then I think you should find a different game (or create a new one!) which is better suited to creative AI thinking (perhaps Go? This game is notoriously difficult to write an AI for, because the oft-used minimax completely fails to play the game to any high level!) I'm sorry, but Chess is already married to minimax, and doesn't want an affiar :(
The reason why I said "And why would you?" is roughly what Oberon_Command said. It's not obvious at all how a logic programming language can be used to make a function that maps chess positions to real numbers (which is what an evaluation function does). If the question had been "Why not use ANNs?" or "Why not use GAs?", at least it would have been obvious what type of solution the poster had in mind. Then we could have had a conversation about the difficulties in applying those methods to this problem.

Quote:Original post by dj3hut1
Prolog is good for solving search problems like the AI for chess.

No, it's not. I spent about seven years developing a chess program on weekends, I've read most of the relevant literature since the 80s to around 2000 and I can tell you that Prolog didn't even play a minor roll in getting computers to play chess well. Search in chess is done using alpha-beta with refinements (quiescence search, move-ordering heuristics, transposition tables, null-move pruning...), preferably in whatever language is fastest (usually C with many clever tricks so things are fast).

Quote:The advantage is, that you don't have to code the algorithm, you must only declare the problem in the right way.

I know that's how they always try to sell you declarative languages. In practice, you want to know exactly what your computer is doing at all times, and the abstraction offered by languages like Prolog doesn't buy you that much. This point of view may not be true for every type of programming problem, but it's most definitely true for chess.

Quote:And a CLP is even more beneficial, because you have the ability to restrict the search space with the help of simple constraints.

I still don't know of any chess-playing programs over 2000 ELO using anything resembling this. What kind of constraints would you impose?

Perhaps you could write a program that would find solutions to mating problems, but before the very end of the game, I wouldn't even know what the main idea of how to structure the program would be.
alvaro, maybe I misunderstood you, I guess that happens easily on the web. Didn't know you had the experience you have about chess programs either.

What I had in mind wasn't the next top rated chess program, but simply an experiment to see if code that made sense could be generated (only for the evaluation function), and if a computer could "learn" to play chess this way.

What motivated me was that I thought I had a an especially good method for telling what's good (and should be given a higher value) and whats not, since I found source that better matches the "true value" of the position (see my second post in this thread if you don't know what I'm talking about). However, I originally developed that idea for neural networks (to use with some form of backpropagation), since it would be possible to train them this way using supervised learning, and just let the program run for itself, while improving. I guess it could be used just for tuning parameters as well. Maybe it's overkill to try to generate code, but since it's the computers language, I thought it might be what has the greatest potential to achieve something really good.

Note that this would NOT be a replacement for min-max or alpha-beta pruning; those algorithms are very essential for any good chess program, and they would still be there. That would totally be to reinvent the wheel. :)

However, now I kinda don't feel like doing it any more. I feel a little bit discouraged as well. I planned of starting the project, but then it took way to long before anything happened, and then I just lost interest of it. Hopefully I've given someone else an idea or inspired anyone (anyone feels inspired?). For so long it's put it on ice, maybe I will make a try sometime later, in a few years or so.

Thank you anyway for the suggestions that I've got.

-Kristofer

[Edited by - TriKri on October 10, 2009 7:59:55 AM]

This topic is closed to new replies.

Advertisement