Programming In Logic[ProLog]
Life goes on .................Oh well . Some thoughts on Prolog and recursion .
Prolog is a very logic and recursion centric language .
Logic as in every statement is a True or false statement .
example ; Say if X is not initialised .
Then if u say : X is 10 .
Youll see a : Yes
Then that means that ,the statement was compared to Prologs database of true statements, was not found - and hence then added to it . Thus X has a value of 10 now (unification).
Whats so special about that ?
Well ......
Say that now u do : X is 15 .
What u'll see is : No
Because prolog looked it up in its db , saw that there is a contradiction - and declared it a false statement.
What that effectively means is variables cant be redeclared .......
Neither can u do X=X+1
Get what that means -> no counters, no iterations ....
Im pretty sure i had a point telling all this . Ah here is it .. See - C ,Java werent really new languages . They had grown out of conventional languages , say english .Do this , do this again ,go there , go there do that and then come back .
On the other hand - Prolog requires a totally new type of thinking , of speaking . It has a totally different paradigm basis- that of logic. Programming in prolog makes u speak funny. Think funny . Instead of saying "Are u Bon jovi ?" u say "u are Bon Jovi" and wait for the true or false .
Things are split in quantifiers . U look for recursive solutions to every problem .
And even then u know that this is just a glimpse , a mask of what could have been .U are still just putting on a skin . U still cant think in logic ...in boolean quantifiers . U convert ur thoughts : put a translator on them . What would happen if a child was taught a logical language from day one ? Would he think differently from us ? Does language shape the mind ?
What happens if aliens come up ? I mean how can we even think of understanding them .... U cant just translate their language. All human languages have the basic tenets same - their approach in temporality, in the spatial domain same . (Devy's words sprout from mouth) .
But an alien civ could have their temporality scheme reversed . Imagine what their sciences would look like . In elementry stuff like refraction - which happens coz light wants to follow the shortest path -for them :- the destination is there ,the source is ahead . What laws of physics will they devise ? If we try to translate their language , will we go mad - taking the future first then the past ? Really see ur unborn children in her eyes (with apologies to Bryan Adams)- and then go and introduce yourself .
Oh well - read Babel-17 by Samuel Delany and his other books .
Coming back to prolog - as i said, before our utility belt consists of recursion and logic
Starting with recursion in prolog :-
(Coming Soon).
2 Comments:
Abey now don't confuse me. For a moment I was trying to answer 'True' or 'False' to 1+1=3 ?
Hey just imagine the way aliens exist. First of all, I always had a fascination about locomotion. Why would anyone think aliens have "weird legs", "big big eyes". I mean they cannot have a concept of anatomy and teleporting could be their way of going around. And then communication can have a different sense, not as we see it like giving a message and anticipating a reply. I mean what if there was no exchange of messages involved in their style of communication :)
Post a Comment
<< Home