Skip to main content

A Family of Unification-Oblivious Program Transformations and Their Applications

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12548))

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.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://github.com/ptarau/LogicTransformers.

  2. 2.

    https://raw.githubusercontent.com/ptarau/LogicTransformers/main/tnf2okAssocUnif.py.

  3. 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

  1. Boehm, H., Weiser, M.: Garbage collection in an uncooperative environment. Softw. Pract. Exp. 18(9), 807–820 (1988)

    Article  Google Scholar 

  2. 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)

    Google Scholar 

  3. Clark, K.L., McCabe, F.G.: Micro-PROLOG - programming in logic. Prentice Hall international series in computer science, Prentice Hall (1984)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. 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)

    Google Scholar 

  6. Knuth, D.E.: The art of computer programming, Fundamental Algorithms, vol. I, 3rd edn. Addison-Wesley (1997). https://www.worldcat.org/oclc/312910844

  7. Kowalski, R., Emden, M.V.: The semantics of predicate logic as a programming language. JACM 23(4), 733–743 (1976)

    Article  MathSciNet  Google Scholar 

  8. Lloyd, J.W.: Foundations of Logic Programming, 1st edn. Springer, Cham (1984)

    Book  Google Scholar 

  9. 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

    Article  MathSciNet  MATH  Google Scholar 

  10. 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

  11. Russinoff, D.M.: A verified prolog compiler for the warren abstract machine. J. Log. Program. 13, 367–412 (1992)

    Article  MathSciNet  Google Scholar 

  12. 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

    Google Scholar 

  13. 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)

    Article  MathSciNet  Google Scholar 

  14. 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

  15. 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

    Chapter  Google Scholar 

  16. Turner, D.A.: A new implementation technique for applicative languages. Softw.: Pract. Exp. 9(1), 31–49 (1979)

    MATH  Google Scholar 

  17. Vandenbroucke, A., Schrijvers, T.: Disjunctive Delimited Control (2020). https://arxiv.org/abs/2009.04909

  18. Warren, D.: An abstract Prolog instruction set. Technical Note 309, SRI International, Stanford, Ca (1983)

    Google Scholar 

  19. Wielemaker, J., Schrijvers, T., Triska, M., Lager, T.: SWI-prolog. Theory Pract. Log. Program. 12, 67–96 (2012). https://doi.org/10.1017/S1471068411000494

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paul Tarau .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics