A complete indexing scheme for WAM-based abstract machines
This paper introduces an indexing scheme for logic programming languages, complete in considering all parameters and nested terms. Nevertheless it does not lead to a code-size explosion, because the sets of valid clauses are not encoded by special control flow instructions. Instead, some kind of identifiers of the applicable clauses are stored in (clause) sets allowing the stepwise restriction of alternative clauses during the runtime analysis of the parameters.
We present the compilation scheme to integrate this approach in existing compilers. It shows the cooperation of the new instructions, the strict separation of the indexing code from the code executing the compiled clauses, and it demonstrates the easiness of integrating a complete indexer in compilers. The compilation scheme was originally developed for the stack-based narrowing machine of the functional logic language BABEL. We describe, however, the slightly modified indexing scheme for the usual WAM-architecture and assume Prolog as the language platform.
Unable to display preview. Download preview PDF.
- [AÏt-Kaci91]H. AÏt-Kaci, Warren's Abstract Machine: A Tutorial Reconstruction, MIT Press, Logic Programming Series. Cambridge, MA, 1991Google Scholar
- [Chakravarty,Lock91]M. M. T. Chakravarty and H. C. R. Lock, The Implementation of Lazy Narrowing, PLILP 91, Lecture Notes in Computer Science, 528, Springer Verlag, Aug. 1991Google Scholar
- [Hickey,Mudambi89]T. Hickey and Sh. Mudambi, Global compilation of Prolog, Journal on Logic Programming, Vol. 7, 1989Google Scholar
- [Kliger,Shapiro88]S. Kliger and E. Shapiro, A Decision Tree Compilation Algorithm for FCP(—,:,?), Proceedings of the Fifth International Conference of Logic Programming and Symposium of Logic Programming, MIT Press, 1988Google Scholar
- [Kliger,Shapiro90]S. Kliger and E. Shapiro, From Decision Trees to Decision Graphs, North American Conference on Logic Programming, Austin, MIT Press, October 1990Google Scholar
- [Korsloot,Tick91]M. Korsloot and E. Tick, Compilation Techniques for Nondeterminate Flat Concurrent Logic Programming Languages, Logic Programming: Proceedings of the Eighth International Conference, MIT Press, June 1991Google Scholar
- [Loogen91]R. Loogen, From Reduction Machines to Narrowing Machines, In CCPSD, TAPSOFT 91, Lecture Notes in Computer Science, 494, Springer Verlag, 1991Google Scholar
- [Loogen,Winkler91]R. Loogen and S. Winkler, Dynamic Detection of Determinism in Functional Logic Languages, PLILP 91, Lecture Notes in Computer Science, 528, Springer Verlag, 1991Google Scholar
- [Moreno,Rodríguez89]J.J. Moreno-Navarro and M. Rodríguez-Artalejo, Logic Programming with Functions and Predicates: The Language BABEL, Technical Report DIA/89/3, Universidad Complutense, Madrid 1989Google Scholar
- [Palmer,Naish91]D. Palmer and L. Naish, NUA-Prolog: An Extension to the WAM for Parallel Andorra, Logic Programming: Proceedings of the Eighth International Conference, MIT Press, June 1991Google Scholar
- [Peyton,Jones87]S. L. Peyton Jones, The Implementation of Functional Programming Languages, Prentice Hall, 1987Google Scholar
- [Warren83]D.H.D. Warren, An Abstract PROLOG Instruction Set, Technical Note 309, SRI International, Menlo Park, California, 1983Google Scholar