skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Seminaïve evaluation for a higher-order functional language

Published:20 December 2019Publication History
Skip Abstract Section

Abstract

One of the workhorse techniques for implementing bottom-up Datalog engines is seminaïve evaluation. This optimization improves the performance of Datalog's most distinctive feature: recursively defined predicates. These are computed iteratively, and under a naïve evaluation strategy, each iteration recomputes all previous values. Seminaïve evaluation computes a safe approximation of the difference between iterations. This can asymptotically improve the performance of Datalog queries.

Seminaïve evaluation is defined partly as a program transformation and partly as a modified iteration strategy, and takes advantage of the first-order nature of Datalog code. This paper extends the seminaïve transformation to higher-order programs written in the Datafun language, which extends Datalog with features like first-class relations, higher-order functions, and datatypes like sum types.

Skip Supplemental Material Section

Supplemental Material

a22-arntzenius.webm

References

  1. Foto Afrati and Christos H. Papadimitriou. 1993. The Parallel Complexity of Simple Logic Programs. J. ACM 40, 4 (Sep 1993), 891–916. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Natasha Alechina, Michael Mendler, Valeria de Paiva, and Eike Ritter. 2001. Categorical and Kripke Semantics for Constructive S4 Modal Logic. In Computer Science Logic, 15th International Workshop, CSL 2001. 10th Annual Conference of the EACSL, Paris, France, September 10-13, 2001, Proceedings (Lecture Notes in Computer Science), Laurent Fribourg (Ed.), Vol. 2142. Springer, 292–307. Google ScholarGoogle ScholarCross RefCross Ref
  3. Peter Alvaro, Neil Conway, Joseph M. Hellerstein, and William R. Marczak. 2011. Consistency Analysis in Bloom: a CALM and Collected Approach. In CIDR 2011, Fifth Biennial Conference on Innovative Data Systems Research, Asilomar, CA, USA, January 9-12, 2011, Online Proceedings. 249–260.Google ScholarGoogle Scholar
  4. Molham Aref, Balder ten Cate, Todd J. Green, Benny Kimelfeld, Dan Olteanu, Emir Pasalic, Todd L. Veldhuizen, and Geoffrey Washburn. 2015. Design and Implementation of the LogicBlox System. In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, Melbourne, Victoria, Australia, May 31 - June 4, 2015. 1371–1382.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Michael Arntzenius. 2017. Static differentiation of monotone fixed points. http://www.rntz.net/files/fixderiv.pdf . Unpublished note.Google ScholarGoogle Scholar
  6. Michael Arntzenius and Neelakantan R. Krishnaswami. 2016. Datafun: A Functional Datalog. In Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming (ICFP 2016). ACM, New York, NY, USA, 214–227. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. François Bancilhon. 1986. Naive Evaluation of Recursively Defined Relations. In On Knowledge Base Management Systems: Integrating Artificial Intelligence and Database Technologies, Michael L Brodie and John Mylopoulos (Eds.). Springer-Verlag New York, Inc., New York, NY, USA, 165–178. http://dl.acm.org/citation.cfm?id=8789.8804Google ScholarGoogle Scholar
  8. Francois Bancilhon, David Maier, Yehoshua Sagiv, and Jeffrey D Ullman. 1986. Magic Sets and Other Strange Ways to Implement Logic Programs (Extended Abstract). In Proceedings of the Fifth ACM SIGACT-SIGMOD Symposium on Principles of Database Systems (PODS ’86). ACM, New York, NY, USA, 1–15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Moritz Y. Becker, Cédric Fournet, and Andrew D. Gordon. 2010. SecPAL: Design and semantics of a decentralized authorization language. Journal of Computer Security 18, 4 (2010), 619–665.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. F. Blute, J. R. B. Cockett, and R. A. G. Seely. 2006. Differential categories. Mathematical Structures in Computer Science 16, 6 (2006), 1049–1083. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Yufei Cai, Paolo G. Giarrusso, Tillmann Rendel, and Klaus Ostermann. 2014. A Theory of Changes for Higher-order Languages: Incrementalizing λ-calculi by Static Differentiation. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA, 145–155. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Stefano Ceri, Georg Gottlob, and Letizia Tanca. 1989. What you Always Wanted to Know About Datalog (And Never Dared to Ask). IEEE Trans. Knowl. Data Eng. 1, 1 (1989), 146–166.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Evgeny Dantsin, Thomas Eiter, Georg Gottlob, and Andrei Voronkov. 2001. Complexity and Expressive Power of Logic Programming. Comput. Surveys 33, 3 (Sep 2001), 374–425. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Oege de Moor, Damien Sereni, Mathieu Verbaere, Elnar Hajiyev, Pavel Avgustinov, Torbjörn Ekman, Neil Ongkingco, and Julian Tibble. 2007. .QL: Object-Oriented Queries Made Easy. In Generative and Transformational Techniques in Software Engineering II, International Summer School, GTTSE 2007, Braga, Portugal, July 2-7, 2007. Revised Papers. 78–133.Google ScholarGoogle Scholar
  15. Thomas Ehrhard and Laurent Regnier. 2003. The differential lambda-calculus. Theoretical Computer Science 309, 1 (2003), 1 – 41. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. George Fourtounis and Yannis Smaragdakis. 2019. Deep Static Modeling of invokedynamic. In ECOOP (LIPIcs), Vol. 109. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik.Google ScholarGoogle Scholar
  17. Paolo G. Giarrusso, Yann Régis-Gianas, and Philipp Schuster. 2019. Incremental \lambda -Calculus in Cache-Transfer Style - Static Memoization by Program Transformation. In ESOP (Lecture Notes in Computer Science), Vol. 11423. Springer, 553–580.Google ScholarGoogle Scholar
  18. Rich Hickey, Stuart Halloway, and Justin Gehtland. 2012. Datomic: The fully transactional, cloud-ready, distributed database. http://www.datomic.com . Accessed: 5 July 2019.Google ScholarGoogle Scholar
  19. Martin Hofmann. 1997. A Mixed Modal/Linear Lambda Calculus with Applications to Bellantoni-Cook Safe Recursion. In CSL (Lecture Notes in Computer Science), Vol. 1414. Springer, 275–294.Google ScholarGoogle Scholar
  20. Herbert Jordan, Bernhard Scholz, and Pavle Subotic. 2016. Soufflé: On Synthesis of Program Analyzers. In CAV (2) (Lecture Notes in Computer Science), Vol. 9780. Springer, 422–430.Google ScholarGoogle Scholar
  21. Magnus Madsen, Ming-Ho Yee, and Ondrej Lhoták. 2016. From Datalog to Flix: A Declarative Language for Fixed Points on Lattices. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2016, Santa Barbara, CA, USA, June 13-17, 2016, Chandra Krintz and Emery Berger (Eds.). ACM, 194–208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Frank Pfenning and Rowan Davies. 2001. A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science 11, 4 (2001), 511–540. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Max Schäfer and Oege de Moor. 2010. Type inference for datalog with complex type hierarchies. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010, Madrid, Spain, January 17-23, 2010. 145–156.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Yannis Smaragdakis and George Balatsouras. 2015. Pointer Analysis. Now Foundations and Trends. https://ieeexplore.ieee. org/document/8186778Google ScholarGoogle Scholar
  25. Philip Wadler. 1992. Comprehending Monads. Mathematical Structures in Computer Science 2, 4 (1992), 461–493.Google ScholarGoogle ScholarCross RefCross Ref
  26. John Whaley. 2007. Context-Sensitive Pointer Analysis using Binary Decision Diagrams. Ph.D. Dissertation. Stanford University.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. John Whaley and Monica S. Lam. 2004. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation 2004, Washington, DC, USA, June 9-11, 2004, William Pugh and Craig Chambers (Eds.). ACM, 131–144. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Seminaïve evaluation for a higher-order functional language

                      Recommendations

                      Comments

                      Login options

                      Check if you have access through your login credentials or your institution to get full access on this article.

                      Sign in

                      Full Access

                      PDF Format

                      View or Download as a PDF file.

                      PDF

                      eReader

                      View online with eReader.

                      eReader
                      About Cookies On This Site

                      We use cookies to ensure that we give you the best experience on our website.

                      Learn more

                      Got it!