Re: Question from a Prolog dummy



nowhereface@xxxxxxx writes:

I am interested in how languages work

As a start, I recommend Zoltan Somogyi's lecture notes about Prolog
implementation:

http://www.cs.mu.oz.au/471/lectures/index.shtml

I also find GNU Prolog's "-W" switch useful to study generated WAM
code. For your example:

predicate(happy/1,3,static,private,user,[
allocate(1),
get_variable(y(0),0),
put_value(y(0),0),
call(healthy/1),
put_value(y(0),0),
call(wealthy/1),
put_value(y(0),0),
deallocate,
execute(wise/1)]).

Also try out the effect of disabling the various optimisations.

All the best,
Markus

--
comp.lang.prolog FAQ: http://www.logic.at/prolog/faq/
.