|Prolog to WAM Register Allocation? firstname.lastname@example.org (Ludwig Wittgenstein) (2006-01-12)|
|Re: Prolog to WAM Register Allocation? email@example.com (2006-01-17)|
|Re: Prolog to WAM Register Allocation? firstname.lastname@example.org (Jens Kilian) (2006-01-17)|
|Re: Prolog to WAM Register Allocation? email@example.com (Ivan A. Kosarev) (2006-01-17)|
|Re: Prolog to WAM Register Allocation? firstname.lastname@example.org (russell kym horsell) (2006-01-19)|
|From:||"Ivan A. Kosarev" <email@example.com>|
|Date:||17 Jan 2006 21:41:51 -0500|
|Posted-Date:||17 Jan 2006 21:41:51 EST|
"Ludwig Wittgenstein" <firstname.lastname@example.org> wrote
> I'm currently studying how Prolog compiles its source into Warren
> Abstract Machine code and I was wondering what kind of algorithm does
> Prolog use to assign variables and constants to X and Y registers?
> For instance, predicate(X,Y,john) allocates X1 for X, X2 for Y, and X3
> for john ? or, when I pass a query ?- lives_in(john, X) Do I assume
> that X variable is bound value is in X1 or X2?
I'm not sure it would be reasonable to perform register allocation
directly from Prolog programs, since they are more likely databases,
not execution paths. Generally, what way a Prolog program will execute
depends from a goal a Prolog machine should solve, not the program
> I've seen numerous literature on code generation/register allocation
> for imperative languages (on register-based machines and stack-based
> machines) but there seems to be no literature at all on how Prolog code
> generation against Warren Abstract machines (Ait-Kaci's book barely
> touches on this subject). Any idea on where such information could be
Will you know how to construct a CFG for a Prolog program, the totally
same principles would be used to write a register allocation mechanism
for your Prolog compiler.
Unicals Group -- Development Tools for OEMs
Return to the
Search the comp.compilers archives again.