Abstract
We describe a family of program transformations that compile a Horn Clause program into equivalent programs of a simpler and more regular structure.
Our transformations, seen as morphisms between term algebras, commute with unification, clause unfoldings and Prolog’s LD-resolution, thus preserving the operational semantics of the Horn Clause programs.
As applications, the resulting programs have simpler execution algorithms and can be compiled to minimalist instruction sets.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
- 2.
- 3.
For most of our Python implementation variants. However, we define appropriate data types in Julia, Swift and C either as combinations of struct and union equivalents or by using more efficient tagged unsigned 64 bit integers for both values and array indices or pointers.
References
Boehm, H., Weiser, M.: Garbage collection in an uncooperative environment. Softw. Pract. Exp. 18(9), 807–820 (1988)
Chen, W., Kifer, M., Warren, D.: HiLog: a first-order semantics for higher-order logic programming constructs. In: Lusk, E., Overbeek, R. (eds.) 1st North American Conference Logic Programming. pp. 1090–1114. MIT Press, Cleveland (1989)
Clark, K.L., McCabe, F.G.: Micro-PROLOG - programming in logic. Prentice Hall international series in computer science, Prentice Hall (1984)
Falaschi, M., Levi, G., Martelli, M., Palamidessi, C.: A new declarative semantics for logic languages. In: Kowalski, R.A., Bowen, K.A. (eds.) Proceedings of the Fifth International Conference and Symposium on Logic Programming, pp. 993–1005. The MIT Press (1988)
Howard, W.: The formulae-as-types notion of construction. In: Seldin, J., Hindley, J. (eds.) To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, pp. 479–490. Academic Press, London (1980)
Knuth, D.E.: The art of computer programming, Fundamental Algorithms, vol. I, 3rd edn. Addison-Wesley (1997). https://www.worldcat.org/oclc/312910844
Kowalski, R., Emden, M.V.: The semantics of predicate logic as a programming language. JACM 23(4), 733–743 (1976)
Lloyd, J.W.: Foundations of Logic Programming, 1st edn. Springer, Cham (1984)
Pettorossi, A., Proietti, M.: Transformation of Logic Programs: Foundations and Techniques. J. Log. Program. 19(20), 261–320 (1994). https://doi.org/10.1016/0743-1066(94)90028-0
Pettorossi, A., Proietti, M.: Transformations of logic programs with goals as arguments. Theory Pract. Log. Program. 4(4), 495–537 (2004). https://doi.org/10.1017/S147106840400198X, https://doi.org/10.1017/S147106840400198X
Russinoff, D.M.: A verified prolog compiler for the warren abstract machine. J. Log. Program. 13, 367–412 (1992)
Tarau, P.: A simplified abstract machine for the execution of binary metaprograms. In: Proceedings of the Logic Programming Conference 1991, pp. 119–128. ICOT, Tokyo, July 1991
Tarau, P.: The BinProlog experience: architecture and implementation choices for continuation passing prolog and first-class logic engines. Theory Pract. Log. Program. 12(1–2), 97–126 (2012)
Tarau, P.: A hitchhiker’s guide to reinventing a prolog machine. In: Rocha, R., Son, T.C., Mears, C., Saeedloei, N. (eds.) Technical Communications of the 33rd International Conference on Logic Programming (ICLP 2017). OpenAccess Series in Informatics (OASIcs), vol. 58, pp. 10:1–10:16. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany (2018). https://doi.org/10.4230/OASIcs.ICLP.2017.10, http://drops.dagstuhl.de/opus/volltexte/2018/8453
Tarau, P., Boyer, M.: Elementary logic programs. In: Deransart, P., Maluszyński, J. (eds.) PLILP 1990. LNCS, vol. 456, pp. 159–173. Springer, Heidelberg (1990). https://doi.org/10.1007/BFb0024183
Turner, D.A.: A new implementation technique for applicative languages. Softw.: Pract. Exp. 9(1), 31–49 (1979)
Vandenbroucke, A., Schrijvers, T.: Disjunctive Delimited Control (2020). https://arxiv.org/abs/2009.04909
Warren, D.: An abstract Prolog instruction set. Technical Note 309, SRI International, Stanford, Ca (1983)
Wielemaker, J., Schrijvers, T., Triska, M., Lager, T.: SWI-prolog. Theory Pract. Log. Program. 12, 67–96 (2012). https://doi.org/10.1017/S1471068411000494
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Tarau, P. (2021). A Family of Unification-Oblivious Program Transformations and Their Applications. In: Morales, J.F., Orchard, D. (eds) Practical Aspects of Declarative Languages. PADL 2021. Lecture Notes in Computer Science(), vol 12548. Springer, Cham. https://doi.org/10.1007/978-3-030-67438-0_1
Download citation
DOI: https://doi.org/10.1007/978-3-030-67438-0_1
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-67437-3
Online ISBN: 978-3-030-67438-0
eBook Packages: Computer ScienceComputer Science (R0)