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.
Supplemental Material
- Foto Afrati and Christos H. Papadimitriou. 1993. The Parallel Complexity of Simple Logic Programs. J. ACM 40, 4 (Sep 1993), 891–916. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
- 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 Scholar
Digital Library
- Michael Arntzenius. 2017. Static differentiation of monotone fixed points. http://www.rntz.net/files/fixderiv.pdf . Unpublished note.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Thomas Ehrhard and Laurent Regnier. 2003. The differential lambda-calculus. Theoretical Computer Science 309, 1 (2003), 1 – 41. Google Scholar
Digital Library
- George Fourtounis and Yannis Smaragdakis. 2019. Deep Static Modeling of invokedynamic. In ECOOP (LIPIcs), Vol. 109. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- Frank Pfenning and Rowan Davies. 2001. A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science 11, 4 (2001), 511–540. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Yannis Smaragdakis and George Balatsouras. 2015. Pointer Analysis. Now Foundations and Trends. https://ieeexplore.ieee. org/document/8186778Google Scholar
- Philip Wadler. 1992. Comprehending Monads. Mathematical Structures in Computer Science 2, 4 (1992), 461–493.Google Scholar
Cross Ref
- John Whaley. 2007. Context-Sensitive Pointer Analysis using Binary Decision Diagrams. Ph.D. Dissertation. Stanford University.Google Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Seminaïve evaluation for a higher-order functional language
Recommendations
Pycket: a tracing JIT for a functional language
ICFP '15We present Pycket, a high-performance tracing JIT compiler for Racket. Pycket supports a wide variety of the sophisticated features in Racket such as contracts, continuations, classes, structures, dynamic binding, and more. On average, over a standard ...
Pycket: a tracing JIT for a functional language
ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional ProgrammingWe present Pycket, a high-performance tracing JIT compiler for Racket. Pycket supports a wide variety of the sophisticated features in Racket such as contracts, continuations, classes, structures, dynamic binding, and more. On average, over a standard ...
From Datalog to flix: a declarative language for fixed points on lattices
PLDI '16We present Flix, a declarative programming language for specifying and solving least fixed point problems, particularly static program analyses. Flix is inspired by Datalog and extends it with lattices and monotone functions. Using Flix, implementors ...






Comments