Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Best AI programming language?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
38 replies to this topic

#21 Álvaro   Crossbones+   -  Reputation: 13880

Like
0Likes
Like

Posted 09 October 2009 - 08:24 AM

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?

Sponsor:

#22 IADaveMark   Moderators   -  Reputation: 2531

Like
0Likes
Like

Posted 09 October 2009 - 10:41 AM

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-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
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!"

#23 TriKri   Members   -  Reputation: 124

Like
0Likes
Like

Posted 09 October 2009 - 11:25 AM

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.

#24 willh   Members   -  Reputation: 160

Like
0Likes
Like

Posted 09 October 2009 - 01:11 PM

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.



#25 Oberon_Command   Crossbones+   -  Reputation: 1959

Like
0Likes
Like

Posted 09 October 2009 - 01:20 PM

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.


#26 SimonHx   Members   -  Reputation: 126

Like
0Likes
Like

Posted 09 October 2009 - 01:44 PM

Best language? English! If you can clearly describe the problem you can code it...

#27 dj3hut1   Members   -  Reputation: 106

Like
0Likes
Like

Posted 09 October 2009 - 05:57 PM

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.

#28 CzarKirk   Members   -  Reputation: 100

Like
0Likes
Like

Posted 09 October 2009 - 06:13 PM

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 :(

#29 Álvaro   Crossbones+   -  Reputation: 13880

Like
0Likes
Like

Posted 09 October 2009 - 06:43 PM

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.

#30 TriKri   Members   -  Reputation: 124

Like
0Likes
Like

Posted 09 October 2009 - 10:59 PM

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]

#31 Daerax   Members   -  Reputation: 1207

Like
0Likes
Like

Posted 10 October 2009 - 12:29 AM

I would not post but there is some contraformation being stated.

Quote:
Original post by alvaro
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).


Nonsense. Look at his statement. Prolog *is* good for solving search problems. And in the general, most any modern language can handle 'chess algorithims' just fine. In the 80s, C over Prolog made sense because computers were slow, simple and in order. Momentum and tradition may be why it still continues. As stated earlier in thread speed is not the main issue and even Python was advised. But I prefer the Prolog suggestion myself but would suggest Clojure (lisp derivative) or Oz as better.

Quote:
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.


In practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore. And the abstractions offered by declarative languages buy you a massive amount. I say this as someone who uses them for work. And cringe when I have to do something in C# that I know would be implemented much more clearly and robustly in a more declarative language. These languages excel at recursion and manipulating complex data structures (especially recursive ones like trees). I never done any chess programming but those algorithims you state would be more easily implemented correctly in a declarative languages.

#32 Daerax   Members   -  Reputation: 1207

Like
0Likes
Like

Posted 10 October 2009 - 01:26 AM

http://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html

"Now for the fifth argument. It has to do with the influence of the tool we are trying to use upon our own thinking habits. I observe a cultural tradition, which in all probability has its roots in the Renaissance, to ignore this influence, to regard the human mind as the supreme and autonomous master of its artefacts. But if I start to analyse the thinking habits of myself and of my fellow human beings, I come, whether I like it or not, to a completely different conclusion, viz. that the tools we are trying to use and the language or notation we are using to express or record our thoughts, are the major factors determining what we can think or express at all!"

#33 CzarKirk   Members   -  Reputation: 100

Like
0Likes
Like

Posted 10 October 2009 - 01:50 AM

Trikri, have you tried genetic programming? It seems to be just what you are looking for. You generate a number of different code "candidates", and test each to see its performance. Then you take the best candidate, and regenerate several parts of its code again to create a new generation of candidates. You test these in turn, and carry on until hopefully you have evolved a kick-ass evaluation function!

#34 willh   Members   -  Reputation: 160

Like
0Likes
Like

Posted 10 October 2009 - 02:57 AM

Quote:
Original post by DaeraxIn practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore.

I don't follow. I thought multicore had no impact at all on what a program was doing. I was under the impression that, unless you specifically designed your program to use multiple processors, the OS would treat your app just like it always has.


#35 Daerax   Members   -  Reputation: 1207

Like
0Likes
Like

Posted 10 October 2009 - 03:26 AM

Quote:
Original post by willh
Quote:
Original post by DaeraxIn practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore.

I don't follow. I thought multicore had no impact at all on what a program was doing. I was under the impression that, unless you specifically designed your program to use multiple processors, the OS would treat your app just like it always has.


Exactly. If you are not writing for multicore these days then you are not writing for the present. Certainly not for the future.

#36 SamLowry   Members   -  Reputation: 1670

Like
0Likes
Like

Posted 10 October 2009 - 03:41 AM

Quote:
Original post by willh
Quote:
Original post by DaeraxIn practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore.

I don't follow. I thought multicore had no impact at all on what a program was doing. I was under the impression that, unless you specifically designed your program to use multiple processors, the OS would treat your app just like it always has.

The OS certainly isn't intelligent enough to automatically parallelize single-threaded code, so, yes, a single-threaded application will more-or-less run on a single core (or in the worst case, switch cores all the time, but it will never run on two or more cores simultaneously).

I believe Daerax meant that if one wants to actually utilize multiple cores, he or she needs to step into a very chaotic and nondeterministic world, and that harnessing the power of multiple cores correctly is extremely hard when using "regular languages" such as C++, java or C#, while when programming in a higher level language such as Prolog, Haskell, Oz or Erlang, a lot of complexity can be handled by the language/compiler, and writing a correctly behaving multi-threaded program can then become quite easy. For example, as far as I know, most Prolog programs (those who do not use the somewhat ugly assert/retract constructs) can be run on multiple cores with no change to the source code whatsoever.

(Directed towards "use any language you wish" posts) Languages are indeed "just tools", meaning there is no sense in claiming one language is absolutely superior to another. However, using the right language for the right problem can make a huge difference. Screwdrivers are not inherently better than forks, but they sure make it easier to put those screws in. There's more than one programming language for a reason.

#37 IADaveMark   Moderators   -  Reputation: 2531

Like
0Likes
Like

Posted 10 October 2009 - 03:49 AM

Quote:
Original post by Daerax
"Now for the fifth argument. It has to do with the influence of the tool we are trying to use upon our own thinking habits. ...that the tools we are trying to use and the language or notation we are using to express or record our thoughts, are the major factors determining what we can think or express at all!"


"The limits of my language mean the limits of my world."
-Ludwig Wittgenstein


Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC

Professional consultant on game AI, mathematical modeling, simulation modeling
Co-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
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!"

#38 Yvanhoe   Members   -  Reputation: 157

Like
0Likes
Like

Posted 27 October 2009 - 03:05 AM

Quote:
Original post by TriKri
By the way, I read a book before sometime which contained a chapter about a computer or a computer program (don't know which) called Eurisko (you can see http://en.wikipedia.org/wiki/Eurisko). Ever heard of it? I think that used Lisp too, or at least something similar. That computer achieved some amazing things! Does anyone know how it worked? It would be really awesome if my program could do about the same thing!

I have spent some time documenting myself about Eurisko. Unfortunately, the details available in the literature are sparse. It was a rule-based system that had rules to generate new rules. It was some sort of an expert-system designed to create expert-systems. Very interesting stuff. Now its designer founded CycCorp. I am not sure about how well it is doing but he got a truckload of money to develop datamining software for antiterrorist purposes. Unfortunately it makes most of his work unpublished. There is an open version of Cyc named OpenCyc but I never really understood how one was supposed to use that.

If these interest you, I suggest you read about rule base system, planners, theorem solvers, and all that falls into the GOFAI (Good Old Fashion AI) field.


#39 caleb_yau   Members   -  Reputation: 122

Like
0Likes
Like

Posted 13 November 2009 - 10:12 AM

I would think the language with the richest ai history is prolog. But again just like everyone is saying, the best language is always a situationally dependent question.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS