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/
.



Relevant Pages

  • Re: Planner, micro-planner, etc.
    ... emulator-based Prolog implementations had we followed the DEC-10 ... TOAM) is fundamentally better than the WAM. ... and probably many other implementation principles that one could ...
    (comp.lang.prolog)
  • Re: Prolog compiler correctness
    ... which in turn has an assembler that executes the ... WAM code. ... I'm only concerned about Prolog correctness, ... And for people who worked on popular open source Prolog compiler ...
    (comp.lang.prolog)
  • Re: WAM: looking for register allocation algorithm
    ... Debray, S. K. ... Register Allocation in a Prolog Machine ... Improving the register allocation in WAM by reordering unification ...
    (comp.lang.prolog)
  • Re: WAM: looking for register allocation algorithm
    ... Debray, S. K. ... Register Allocation in a Prolog Machine ... Improving the register allocation in WAM by reordering unification ...
    (comp.lang.prolog)
  • Re: Planner, micro-planner, etc.
    ... And also, if things like WAM were created for Prolog, why ... Prolog, but we could have ended up with similar or even faster ... emulator-based Prolog implementations had we followed the DEC-10 ... implementation or the traditional Pascal machine. ...
    (comp.lang.prolog)