ProLog
******
the name ProLog comes from "PROgramming in LOGic", ProLog is differnet
from other programming languages like C,C++,java,VB etc.
In ProLog you don't ask How to do it, you rather ask what to do.
this attribute of prolog makes it a very useful language in several
fields of programming like: Expert Systems, as a database, and for
old times text adventure games.
today prolog is mostly used in the academies and universitys to show a
different way of programming.
ProLog is basicly built of facts and rules, here is a small example:
male(seinfeld). // these are facts (always ended in a period).
male(geogre). // also the use of lowercase letter is intentional, because
male(kreimer). // uppercase letters define a variable not a constant.
female(alain).
lovers(X,Y):-male(X),female(Y). // this is a rule (olso ended by a period).
now compile it, and then start asking questions.
Q:male(george). Q:male(X). Q:lovers(seinfeld,alain).
A:yes A:X=seinfeld; A:yes
X=george;
Q:female(alain). X=kreimer; Q:lovers(george,alain).
A:yes no A:yes
Q:female(kreimer). Q:female(Y). Q:lovers(george,kreimer).
A:no A:Y=alain; A:no
no
Q:lovers(X,alain). Q:lovers(seinfeld,X). Q:lovers(X,Y).
A:X=seinfeld; A:X=alain; A:X=sienfeld Y=alain;
X=george; no X=george Y=alain;
X=kreimer; X=kreimer Y=alain;
no no
well this was just a small peek at prolog and you didn't realy saw it's powerful
recursion, and many other abilities.
you can extend your knowledge from the AMZI.COM website (download from free stuff
in this website).
have fun
WiseGuy
come visit my site at http://go.to/wiseguy.
               (
geocities.com/wiseguyil)