S
Sarum TheBlack
Guest
- Thread starter
- #61
Originally posted by Arnor2
not the actual joke(dont understand) but the entire thing
![]()
OK, just for you, "The Nerdy Bit (tm)"
Prolog, in some sense, is a "prover" rather than a "do-er" language. The simplest stuff you can do with it is supply some facts eg "car(bmw), car(ford)" (Fords and BMWs are cars), and some simple rules "has_Wheels(X) :- car(X)" (cars have wheels). You can then query the system, and it will attempt to prove what you say, or if you supplied a variable (represented by the first letter being caps) it will try to provide a list of possible matches. So
? car(bmw).
would result in the answer “Yes.”
?car(Zippy).
would give you
Zippy = bmw?
Zippy = ford?
And
?has_wheels(bmw).
Would give “Yes.” (since bmw is a car, and cars have wheels, it logically follows that bmw has wheels)
if the system cannot prove what you asked/said on the information given, it answers No. (note, this doesn't mean the statement is actually wrong, just prolog can't prove it on the information supplied). Eg
?car(honda).
No.
So that's prolog in its simplest form.. given these basic building blocks, and a few other features (and a lot of nifty tricks) it's relatively easy to build half decent AI systems fairly quickly. (my housemates 3rd year project used prolog to write a GO AI.. it was pretty good too, could beat me hands down.)
So in the joke... if information regarding the changing of lighbulbs and the relative numbers of prolog programmers required to do stuff wasn't supplied, prolog would answer "No" to the question. Now I'm explained it.. it's not that funny any more is it?.. Don't worry, I think it's a geek thing.
/end The Nerdy Bit(tm).