Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Seminaïve evaluation for a higher-order functional language

Published: 20 December 2019 Publication History

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.

Supplementary Material

WEBM File (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.
[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.
[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.
[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.
[5]
Michael Arntzenius. 2017. Static differentiation of monotone fixed points. http://www.rntz.net/files/fixderiv.pdf . Unpublished note.
[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.
[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.8804
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[15]
Thomas Ehrhard and Laurent Regnier. 2003. The differential lambda-calculus. Theoretical Computer Science 309, 1 (2003), 1 – 41.
[16]
George Fourtounis and Yannis Smaragdakis. 2019. Deep Static Modeling of invokedynamic. In ECOOP (LIPIcs), Vol. 109. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik.
[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.
[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.
[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.
[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.
[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.
[22]
Frank Pfenning and Rowan Davies. 2001. A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science 11, 4 (2001), 511–540.
[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.
[24]
Yannis Smaragdakis and George Balatsouras. 2015. Pointer Analysis. Now Foundations and Trends. https://ieeexplore.ieee. org/document/8186778
[25]
Philip Wadler. 1992. Comprehending Monads. Mathematical Structures in Computer Science 2, 4 (1992), 461–493.
[26]
John Whaley. 2007. Context-Sensitive Pointer Analysis using Binary Decision Diagrams. Ph.D. Dissertation. Stanford University.
[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.

Cited By

View all
  • (2024)Deriving with Derivatives: Optimizing Incremental Fixpoints for Higher-Order Flow AnalysisProceedings of the ACM on Programming Languages10.1145/36746508:ICFP(728-755)Online publication date: 15-Aug-2024
  • (2024)Convergence of datalog over (Pre-) SemiringsJournal of the ACM10.1145/364302771:2(1-55)Online publication date: 10-Apr-2024
  • (2024)Verifying a C Implementation of Derecho’s Coordination Mechanism Using VST and CoqNASA Formal Methods10.1007/978-3-031-60698-4_6(99-117)Online publication date: 4-Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 4, Issue POPL
January 2020
1984 pages
EISSN:2475-1421
DOI:10.1145/3377388
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 December 2019
Published in PACMPL Volume 4, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Datafun
  2. Datalog
  3. functional languages
  4. incremental computation
  5. relational languages
  6. seminaïve evaluation

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)104
  • Downloads (Last 6 weeks)18
Reflects downloads up to 30 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Deriving with Derivatives: Optimizing Incremental Fixpoints for Higher-Order Flow AnalysisProceedings of the ACM on Programming Languages10.1145/36746508:ICFP(728-755)Online publication date: 15-Aug-2024
  • (2024)Convergence of datalog over (Pre-) SemiringsJournal of the ACM10.1145/364302771:2(1-55)Online publication date: 10-Apr-2024
  • (2024)Verifying a C Implementation of Derecho’s Coordination Mechanism Using VST and CoqNASA Formal Methods10.1007/978-3-031-60698-4_6(99-117)Online publication date: 4-Jun-2024
  • (2023)Bring Your Own Data Structures to DatalogProceedings of the ACM on Programming Languages10.1145/36228407:OOPSLA2(1198-1223)Online publication date: 16-Oct-2023
  • (2020)Formulog: Datalog for SMT-based static analysisProceedings of the ACM on Programming Languages10.1145/34282094:OOPSLA(1-31)Online publication date: 13-Nov-2020
  • (2020)A systematic approach to deriving incremental type checkersProceedings of the ACM on Programming Languages10.1145/34281954:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2020)Fixpoints for the masses: programming with first-class Datalog constraintsProceedings of the ACM on Programming Languages10.1145/34281934:OOPSLA(1-28)Online publication date: 13-Nov-2020

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media