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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
H. Ait Kaci: The WAM: A (Real) Tutorial, DEC Research Centre, Paris, PRL Research Report 5, 1990
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
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
L. Cardelli: The Amber machine, Proc. Combinators and Functional Programming, LNCS 242, 1986
G. Cousineau et al: The Categorical Abstract Machine, Proc. Functional Programming Languages and Computer Architectures, Nancy, France, pp. 50–64, Springer LNCS 201, 1986
G. Cousineau: The Categorical Abstract Machine, in G. Huet (ed.): Logical Foundations of Functional Programming, Addison Wesley, 1990
L. Fribourg: Handling Function Definition through Innermost Superposition and Rewriting, Proc. RTA 85, pp. 325–344, Springer LNCS, 1985
M. Hanus: Logic programs with equational type specifications, Proc. ALP 90, Nancy, France, pp. 70–85, Springer LNCS 463, 1990
M. Hanus: Compiling Logic Programs with Equality, Proc. PLILP 90, Linköping, Sweden, pp. 387–401, Springer LNCS 456, 1990
H. Hussmann: Unification in Conditional Equational Theories, Research Report MIP 8502, Universität Passau, 1985
H. Kuchen et al: Graph-based Implementation of a Functional Logic Language, Proc. ESOP 90, pp. 271–290, Springer LNCS 432, 1990
P.J. Landin: The mechanical evaluation of expressions, Computer Journal 6, pp. 308–320, 1964
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
H.C.R. Lock: A Systematic Method For Designing Abstract Narrowing Machines, Workshop on Declarative Programming, Sasbachwalden, Workshops in Computing, Springer Verlag 1991
R. Loogen: From Reduction Machines to Narrowing Machines, Proc. TAPSOFT 91, Brighton, UK, pp. 438–457, Springer LNCS 494, 1991
R. Loogen, S. Winkler: Dynamic Detection of Determinism in Functional Logic Languages, Proc. PLILP 91, Passau, Germany, pp. 335–346, Springer LNCS 528, 1991
A. Mück: Compilation of Narrowing, Proc, PLILP 90, Linköping, Sweden, pp. 16–29, Springer LNCS 456, 1990
A. Mück: A Verified Implementation of a Functional Logic Language, University of Munich, forthcoming report, 1992
R. Paterson: A non-deterministic λ-calculus, Imperial College London, 1990
J.A. Robinson: A Machine Oriented Logic Based on the Resolution Principle, JACM, Vol. 12, No. 1, pp. 23–41, 1965
D.M. Rusinoff: A Verified Prolog Compiler for the Warren Abstract Machine, MCC Technical Report, ACT-ST-292-89, Austin, Texas, USA, 1989
D.H.D. Warren: An Abstract Prolog Instruction Set, SRI International, Technical Note 309, 1983
Author information
Authors and Affiliations
Editor information
Rights 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