Skip to main content

Camel: An extension of the categorical abstract machine to compile functional/logic programs

  • Conference paper
  • First Online:
Programming Language Implementation and Logic Programming (PLILP 1992)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 631))

  • 175 Accesses

Abstract

In this paper we present a clean implementation technique for functional / logic (or algebraic) programming languages. First we define an intermediate language to which a functional / logic program is compiled. In order to implement this intermediate language, we extend the Categorical Abstract Machine (CAM) by an additional data structure to handle logical variables and by a few instructions covering unification and backtracking. Finally, we show how the intermediate language is compiled into the instruction set of our Categorical Abstract Machine extension.

Finally I would like to thank H. Hußmann, P. Padawitz, V. Pollara, B. Reus, Th. Streicher and M. Wirsing for useful suggestions. Thanks also to M. Hanus, H. Lock and R. Loogen for their helpful comments on the intermediate language.

Without the help of Tatjana, the paper would not have been ready in time.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. H. Ait Kaci: The WAM: A (Real) Tutorial, DEC Research Centre, Paris, PRL Research Report 5, 1990

    Google Scholar 

  2. Egon Börger, Dean Rosenzweig: From Prolog Algebras Towards WAM — A Mathematical Study of Implementation, Proc. 4th Workshop on Computer Science Logic, Springer LNCS, 1991

    Google Scholar 

  3. P.G. Bosco et al: An Extension of WAM for K-LEAF: A WAM-based Compilation of Conditional Narrowing, Proc. Int. Conf. on Logic Programming, pp. 318–336, MIT Press, 1989

    Google Scholar 

  4. L. Cardelli: The Amber machine, Proc. Combinators and Functional Programming, LNCS 242, 1986

    Google Scholar 

  5. G. Cousineau et al: The Categorical Abstract Machine, Proc. Functional Programming Languages and Computer Architectures, Nancy, France, pp. 50–64, Springer LNCS 201, 1986

    Google Scholar 

  6. G. Cousineau: The Categorical Abstract Machine, in G. Huet (ed.): Logical Foundations of Functional Programming, Addison Wesley, 1990

    Google Scholar 

  7. L. Fribourg: Handling Function Definition through Innermost Superposition and Rewriting, Proc. RTA 85, pp. 325–344, Springer LNCS, 1985

    Google Scholar 

  8. M. Hanus: Logic programs with equational type specifications, Proc. ALP 90, Nancy, France, pp. 70–85, Springer LNCS 463, 1990

    Google Scholar 

  9. M. Hanus: Compiling Logic Programs with Equality, Proc. PLILP 90, Linköping, Sweden, pp. 387–401, Springer LNCS 456, 1990

    Google Scholar 

  10. H. Hussmann: Unification in Conditional Equational Theories, Research Report MIP 8502, Universität Passau, 1985

    Google Scholar 

  11. H. Kuchen et al: Graph-based Implementation of a Functional Logic Language, Proc. ESOP 90, pp. 271–290, Springer LNCS 432, 1990

    Google Scholar 

  12. P.J. Landin: The mechanical evaluation of expressions, Computer Journal 6, pp. 308–320, 1964

    Google Scholar 

  13. H.C.R. Lock, M.M.T. Chakravarty: The Implementation of Lazy Narrowing, Proc. PLILP 91, Passau, Germany, pp. 111–122, Springer LNCS 528, 1991

    Google Scholar 

  14. H.C.R. Lock: A Systematic Method For Designing Abstract Narrowing Machines, Workshop on Declarative Programming, Sasbachwalden, Workshops in Computing, Springer Verlag 1991

    Google Scholar 

  15. R. Loogen: From Reduction Machines to Narrowing Machines, Proc. TAPSOFT 91, Brighton, UK, pp. 438–457, Springer LNCS 494, 1991

    Google Scholar 

  16. R. Loogen, S. Winkler: Dynamic Detection of Determinism in Functional Logic Languages, Proc. PLILP 91, Passau, Germany, pp. 335–346, Springer LNCS 528, 1991

    Google Scholar 

  17. A. Mück: Compilation of Narrowing, Proc, PLILP 90, Linköping, Sweden, pp. 16–29, Springer LNCS 456, 1990

    Google Scholar 

  18. A. Mück: A Verified Implementation of a Functional Logic Language, University of Munich, forthcoming report, 1992

    Google Scholar 

  19. R. Paterson: A non-deterministic λ-calculus, Imperial College London, 1990

    Google Scholar 

  20. J.A. Robinson: A Machine Oriented Logic Based on the Resolution Principle, JACM, Vol. 12, No. 1, pp. 23–41, 1965

    Google Scholar 

  21. D.M. Rusinoff: A Verified Prolog Compiler for the Warren Abstract Machine, MCC Technical Report, ACT-ST-292-89, Austin, Texas, USA, 1989

    Google Scholar 

  22. D.H.D. Warren: An Abstract Prolog Instruction Set, SRI International, Technical Note 309, 1983

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Maurice Bruynooghe Martin Wirsing

Rights and permissions

Reprints and permissions

Copyright information

© 1992 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Mück, A. (1992). Camel: An extension of the categorical abstract machine to compile functional/logic programs. In: Bruynooghe, M., Wirsing, M. (eds) Programming Language Implementation and Logic Programming. PLILP 1992. Lecture Notes in Computer Science, vol 631. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55844-6_146

Download citation

  • DOI: https://doi.org/10.1007/3-540-55844-6_146

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-55844-6

  • Online ISBN: 978-3-540-47297-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics