Incrementalizing lattice-based program analyses in Datalog

Program analyses detect errors in code, but when code changes frequently as in an IDE, repeated re-analysis from-scratch is unnecessary: It leads to poor performance unless we give up on precision and recall. Incremental program analysis promises to deliver fast feedback without giving up on precision or recall by deriving a new analysis result from the previous one. However, Datalog and other existing frameworks for incremental program analysis are limited in expressive power: They only support the powerset lattice as representation of analysis results, whereas many practically relevant analyses require custom lattices and aggregation over lattice values. To this end, we present a novel algorithm called DRedL that supports incremental maintenance of recursive lattice-value aggregation in Datalog. The key insight of DRedL is to dynamically recognize increasing replacements of old lattice values by new ones, which allows us to avoid the expensive deletion of the old value. We integrate DRedL into the analysis framework IncA and use IncA to realize incremental implementations of strong-update points-to analysis and string analysis for Java. As our performance evaluation demonstrates, both analyses react to code changes within milliseconds.

[1]  Umut A. Acar,et al.  Efficient Bayesian Inference for Dynamically Changing Graphs , 2007, NIPS.

[2]  Michael Francis Atiyah,et al.  Introduction to commutative algebra , 1969 .

[3]  Lori L. Pollock,et al.  Incremental call graph reanalysis for object-oriented software maintenance , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[4]  Thomas W. Reps,et al.  A categorized bibliography on incremental computation , 1993, POPL '93.

[5]  Michael Peyton Jones,et al.  QL: Object-oriented Queries on Relational Data , 2016, ECOOP.

[6]  Inderpal Singh Mumick,et al.  The Stanford Data Warehousing Project , 1995 .

[7]  Carlo Zaniolo,et al.  Optimizing recursive queries with monotonic aggregates in DeALS , 2015, 2015 IEEE 31st International Conference on Data Engineering.

[8]  Ákos Horváth,et al.  EMF-IncQuery: An integrated development environment for live model queries , 2015, Sci. Comput. Program..

[9]  Sebastian Erdweg,et al.  IncA: A DSL for the definition of incremental program analyses , 2016, 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE).

[10]  Letizia Tanca,et al.  What you Always Wanted to Know About Datalog (And Never Dared to Ask) , 1989, IEEE Trans. Knowl. Data Eng..

[11]  Manuel V. Hermenegildo,et al.  Optimized Algorithms for Incremental Analysis of Logic Programs , 1996, SAS.

[12]  Mira Mezini,et al.  i3QL: language-integrated live data views , 2014, OOPSLA.

[13]  Ondrej Lhoták,et al.  Points-to analysis with efficient strong updates , 2011, POPL '11.

[14]  Monica S. Lam,et al.  Cloning-based context-sensitive pointer alias analysis using binary decision diagrams , 2004, PLDI '04.

[15]  Peter J. Stuckey,et al.  Incremental analysis of constraint logic programs , 2000, TOPL.

[16]  Patrick Cousot,et al.  Basic concepts of abstract interpretation , 2004, IFIP Congress Topical Sessions.

[17]  Yannis Smaragdakis,et al.  Using Datalog for Fast and Easy Program Analysis , 2010, Datalog.

[18]  Surajit Chaudhuri,et al.  Maintenance of Materialized Views: Problems, Techniques, and Applications. , 1995 .

[19]  Ondrej Lhoták,et al.  The Soot framework for Java program analysis: a retrospective , 2011 .

[20]  Barbara G. Ryder,et al.  An incremental flow- and context-sensitive pointer aliasing analysis , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[21]  Eric Bodden,et al.  Reviser: efficiently updating IDE-/IFDS-based data-flow analyses in response to incremental program changes , 2014, ICSE.

[22]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[23]  Daniel P. Miranker TREAT: a better match algorithm for AI production systems , 1987, AAAI 1987.

[24]  Michael Eichberg,et al.  Automatic Incrementalization of Prolog Based Static Analyses , 2007, PADL.

[25]  C. R. Ramakrishnan,et al.  Incremental and demand-driven points-to analysis using logic programming , 2005, PPDP.

[26]  Ken Kennedy,et al.  Efficient computation of flow insensitive interprocedural summary information , 1984, SIGPLAN '84.

[27]  Usman Ismail Incremental Call Graph Construction for the Eclipse IDE , 2009 .

[28]  Grzegorz Rozenberg,et al.  Handbook of Graph Grammars and Computing by Graph Transformations, Volume 1: Foundations , 1997 .

[29]  Pramod Bhatotia,et al.  Incoop: MapReduce for incremental computations , 2011, SoCC.

[30]  Carlo Zaniolo,et al.  Extending the power of datalog recursion , 2012, The VLDB Journal.

[31]  Sebastian Erdweg,et al.  Efficient development of consistent projectional editors using grammar cells , 2016, SLE.

[32]  Shan Shan Huang,et al.  Datalog and Recursive Query Processing , 2013, Found. Trends Databases.

[33]  Ondrej Lhoták,et al.  From Datalog to flix: a declarative language for fixed points on lattices , 2016, PLDI.

[34]  David Maier,et al.  Logic and lattices for distributed programming , 2012, SoCC '12.

[35]  Yi Lu,et al.  An Incremental Points-to Analysis with CFL-Reachability , 2013, CC.

[36]  Markus Völter,et al.  Towards User-Friendly Projectional Editors , 2014, SLE.

[37]  Eric Bodden,et al.  Boomerang: Demand-Driven Flow- and Context-Sensitive Pointer Analysis for Java , 2016, ECOOP.

[38]  Agostino Cortesi,et al.  Static Analysis of String Values , 2011, ICFEM.

[39]  Mary Lou Soffa,et al.  An Incremental Version of Iterative Data Flow Analysis , 1989, IEEE Trans. Software Eng..

[40]  Thomas W. Reps,et al.  Precise interprocedural dataflow analysis via graph reachability , 1995, POPL '95.

[41]  F. Kenneth Zadeck,et al.  Incremental data flow analysis in a structured program editor , 1984, SIGPLAN '84.

[42]  Charles L. Forgy,et al.  Rete: a fast algorithm for the many pattern/many object pattern match problem , 1991 .

[43]  Boon Thau Loo,et al.  Recursive Computation of Regions and Connectivity in Networks , 2009, 2009 IEEE 25th International Conference on Data Engineering.

[44]  V. S. Subrahmanian,et al.  Maintaining views incrementally , 1993, SIGMOD Conference.

[45]  Yavor Nenov,et al.  Incremental Update of Datalog Materialisation: the Backward/Forward Algorithm , 2015, AAAI.

[46]  Kenneth A. Ross,et al.  Monotonic aggregation in deductive databases , 1992, J. Comput. Syst. Sci..

[47]  Michael Philippsen,et al.  Move-optimized source code tree differencing , 2016, 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE).