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

Incrementalizing lattice-based program analyses in Datalog

Published: 24 October 2018 Publication History

Abstract

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.

Supplementary Material

WEBM File (a139-szabo.webm)

References

[1]
Steven Arzt and Eric Bodden. 2014. Reviser: Efficiently Updating IDE-/IFDS-based Data-flow Analyses in Response to Incremental Program Changes. In Proceedings of the 36th International Conference on Software Engineering (ICSE 2014). ACM, New York, NY, USA, 288–298.
[2]
Michael Francis Atiyah and Ian Grant Macdonald. 1994. Introduction to commutative algebra. Westview press.
[3]
Pavel Avgustinov, Oege de Moor, Michael Peyton Jones, and Max Schäfer. 2016. QL: Object-oriented Queries on Relational Data. In LIPIcs-Leibniz International Proceedings in Informatics, Vol. 56. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.
[4]
Pramod Bhatotia, Alexander Wieder, Rodrigo Rodrigues, Umut A. Acar, and Rafael Pasquin. 2011. Incoop: MapReduce for Incremental Computations. In Proceedings of the 2Nd ACM Symposium on Cloud Computing (SOCC ’11). ACM, New York, NY, USA, Article 7, 14 pages.
[5]
S. Ceri, G. Gottlob, and L. Tanca. 1989. What You Always Wanted to Know About Datalog (And Never Dared to Ask). IEEE Trans. on Knowl. and Data Eng. 1, 1 (March 1989), 146–166.
[6]
Neil Conway, William R. Marczak, Peter Alvaro, Joseph M. Hellerstein, and David Maier. 2012. Logic and Lattices for Distributed Programming. In Proceedings of the Third ACM Symposium on Cloud Computing (SoCC ’12). ACM, New York, NY, USA, Article 1, 14 pages.
[7]
Keith D. Cooper and Ken Kennedy. 1984. Efficient Computation of Flow Insensitive Interprocedural Summary Information. In Proceedings of the 1984 SIGPLAN Symposium on Compiler Construction (SIGPLAN ’84). ACM, New York, NY, USA, 247–258.
[8]
Giulia Costantini, Pietro Ferrara, and Agostino Cortesi. 2011. Static Analysis of String Values. In Proceedings of the 13th International Conference on Formal Methods and Software Engineering (ICFEM’11). Springer-Verlag, Berlin, Heidelberg, 505–521. http://dl.acm.org/citation.cfm?id=2075089.2075132
[9]
Patrick Cousot and Radhia Cousot. 2004. Basic Concepts of Abstract Interpretation. Springer US, Boston, MA, 359–366.
[10]
Georg Dotzler and Michael Philippsen. 2016. Move-optimized Source Code Tree Differencing. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering (ASE 2016). ACM, New York, NY, USA, 660–671.
[11]
Michael Eichberg, Matthias Kahl, Diptikalyan Saha, Mira Mezini, and Klaus Ostermann. 2007. Automatic Incrementalization of Prolog Based Static Analyses. In Proceedings of the 9th International Conference on Practical Aspects of Declarative Languages (PADL’07). Springer-Verlag, Berlin, Heidelberg, 109–123.
[12]
Charles L. Forgy. 1982. Rete: A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem. Artif. Intell. 19, 1 (Sept. 1982), 17–37.
[13]
Todd J. Green, Shan Shan Huang, Boon Thau Loo, and Wenchao Zhou. 2013. Datalog and Recursive Query Processing. Found. Trends databases 5, 2 (Nov. 2013), 105–195.
[14]
Ashish Gupta and Inderpal Singh Mumick. 1995. Maintenance of Materialized Views: Problems, Techniques, and Applications. IEEE Data Eng. Bull. 18, 2 (1995), 3–18. http://sites.computer.org/debull/95JUN- CD.pdf
[15]
Ashish Gupta, Inderpal Singh Mumick, and V. S. Subrahmanian. 1993. Maintaining Views Incrementally. In Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data (SIGMOD ’93). ACM, New York, NY, USA, 157–166.
[16]
Eric N. Hanson and Mohammed S. Hasan. 1993. Gator: An Optimized Discrimination Network for Active Database Rule Condition Testing. Technical Report TR93-036. Univ. of Florida.
[17]
Manuel Hermenegildo, German Puebla, Kim Marriott, and Peter J. Stuckey. 2000. Incremental Analysis of Constraint Logic Programs. ACM Trans. Program. Lang. Syst. 22, 2 (March 2000), 187–223.
[18]
Usman Ismail. 2009. Incremental call graph construction for the Eclipse IDE. Technical Report CS-2009-07. University of Waterloo.
[19]
Uday Khedker. 1995. A Generalised Theory of Bit Vector Data Flow Analysis. Ph.D. Dissertation. Department of Computer Science and Engineering, IIT Bombay.
[20]
Patrick Lam, Eric Bodden, Ondrej Lhoták, and Laurie Hendren. 2011. The Soot framework for Java program analysis: a retrospective. In Cetus Users and Compiler Infastructure Workshop (CETUS 2011), Vol. 15. 35.
[21]
Ondrej Lhoták and Kwok-Chiang Andrew Chung. 2011. Points-to Analysis with Efficient Strong Updates. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’11). ACM, New York, NY, USA, 3–16.
[22]
M. Liu, N. E. Taylor, W. Zhou, Z. G. Ives, and B. T. Loo. 2009. Recursive Computation of Regions and Connectivity in Networks. In 2009 IEEE 25th International Conference on Data Engineering. 1108–1119.
[23]
Yi Lu, Lei Shang, Xinwei Xie, and Jingling Xue. 2013. An Incremental Points-to Analysis with CFL-Reachability. In Proceedings of the 22Nd International Conference on Compiler Construction (CC’13). Springer-Verlag, Berlin, Heidelberg, 61–81.
[24]
Magnus Madsen, Ming-Ho Yee, and Ondřej 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 ’16). ACM, New York, NY, USA, 194–208.
[25]
Mirjana Mazuran, Edoardo Serra, and Carlo Zaniolo. 2013. Extending the power of datalog recursion. 22 (08 2013).
[26]
Daniel P. Miranker. 1987. TREAT: A Better Match Algorithm for AI Production Systems; Long Version. (1987).
[27]
Ralf Mitschke, Sebastian Erdweg, Mirko Köhler, Mira Mezini, and Guido Salvaneschi. 2014. i3QL: language-integrated live data views. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2014, part of SPLASH 2014, Portland, OR, USA, October 20-24, 2014, Andrew P. Black and Todd D. Millstein (Eds.). ACM, 417–432.
[28]
Boris Motik, Yavor Nenov, Robert Piro, and Ian Horrocks. 2015. Incremental Update of Datalog Materialisation: The Backward/Forward Algorithm. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence (AAAI’15). AAAI Press, 1560–1568. http://dl.acm.org/citation.cfm?id=2886521.2886537
[29]
Flemming Nielson, Hanne R. Nielson, and Chris Hankin. 2010. Principles of Program Analysis. Springer Publishing Company, Incorporated.
[30]
L. L. Pollock and M. L. Soffa. 1989. An Incremental Version of Iterative Data Flow Analysis. IEEE Trans. Softw. Eng. 15, 12 (Dec. 1989), 1537–1549.
[31]
Germán Puebla and Manuel Hermenegildo. 1996. Optimized algorithms for incremental analysis of logic programs. In Static Analysis: Third International Symposium, SAS ’96 Aachen, Germany, September 24–26, 1996 Proceedings, Radhia Cousot and David A. Schmidt (Eds.). Springer Berlin Heidelberg, 270–284.
[32]
G. Ramalingam and Thomas Reps. 1993. A Categorized Bibliography on Incremental Computation. In Proceedings of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’93). ACM, New York, NY, USA, 502–510.
[33]
Thomas Reps, Susan Horwitz, and Mooly Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Proceedings of the 22Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’95). ACM, New York, NY, USA, 49–61.
[34]
Kenneth A. Ross and Yehoshua Sagiv. 1992. Monotonic Aggregation in Deductive Databases. In Proceedings of the Eleventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS ’92). ACM, New York, NY, USA, 114–126.
[35]
Grzegorz Rozenberg (Ed.). 1997. Handbook of Graph Grammars and Computing by Graph Transformation: Volume I. Foundations. World Scientific Publishing Co., Inc., River Edge, NJ, USA.
[36]
Diptikalyan Saha and C. R. Ramakrishnan. 2005. Incremental and Demand-driven Points-to Analysis Using Logic Programming. In Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP ’05). ACM, New York, NY, USA, 117–128.
[37]
Robert Sedgewick and Kevin Wayne. 2011. Algorithms (4th ed.). Addison-Wesley Professional.
[38]
A. Shkapsky, M. Yang, and C. Zaniolo. 2015. Optimizing recursive queries with monotonic aggregates in DeALS. In 2015 IEEE 31st International Conference on Data Engineering. 867–878.
[39]
Yannis Smaragdakis and Martin Bravenboer. 2011. Using Datalog for Fast and Easy Program Analysis. In Proceedings of the First International Conference on Datalog Reloaded (Datalog’10). Springer-Verlag, Berlin, Heidelberg, 245–251.
[40]
Amie L. Souter and Lori L. Pollock. 2001. Incremental Call Graph Reanalysis for Object-Oriented Software Maintenance. In Proceedings of the IEEE International Conference on Software Maintenance (ICSM’01) (ICSM ’01). IEEE Computer Society, Washington, DC, USA, 682–.
[41]
Johannes Späth, Lisa Nguyen Quang Do, Karim Ali, and Eric Bodden. 2016. Boomerang: Demand-Driven Flow- and Context-Sensitive Pointer Analysis for Java. In 30th European Conference on Object-Oriented Programming (ECOOP 2016) (Leibniz International Proceedings in Informatics (LIPIcs)), Shriram Krishnamurthi and Benjamin S. Lerner (Eds.), Vol. 56. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 22:1–22:26.
[42]
Ozgur Sumer, Umut Acar, Alexander T Ihler, and Ramgopal R Mettu. 2008. Efficient bayesian inference for dynamically changing graphs. In Advances in Neural Information Processing Systems. 1441–1448.
[43]
Tamás Szabó, Sebastian Erdweg, and Markus Voelter. 2016. IncA: A DSL for the Definition of Incremental Program Analyses. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering (ASE 2016). ACM, New York, NY, USA, 320–331.
[44]
Zoltán Ujhelyi, Gábor Bergmann, Ábel Hegedüs, Ákos Horváth, Benedek Izsó, István Ráth, Zoltán Szatmári, and Dániel Varró. 2015. EMF-IncQuery: An integrated development environment for live model queries. Science of Computer Programming 98, Part 1, 0 (2015), 80 – 99.
[45]
Markus Voelter, Janet Siegmund, Thorsten Berger, and Bernd Kolb. 2014. Towards User-Friendly Projectional Editors. In Software Language Engineering, Benoît Combemale, DavidJ. Pearce, Olivier Barais, and JurgenJ. Vinju (Eds.). Lecture Notes in Computer Science, Vol. 8706. Springer International Publishing, 41–61.
[46]
Markus Voelter, Tamás Szabó, Sascha Lisson, Bernd Kolb, Sebastian Erdweg, and Thorsten Berger. 2016. Efficient Development of Consistent Projectional Editors Using Grammar Cells. In Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering (SLE 2016). ACM, New York, NY, USA, 28–40.
[47]
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 (PLDI ’04). ACM, New York, NY, USA, 131–144.
[48]
Jyh-shiarn Yur, Barbara G. Ryder, and William A. Landi. 1999. An Incremental Flow- and Context-sensitive Pointer Aliasing Analysis. In Proceedings of the 21st International Conference on Software Engineering (ICSE ’99). ACM, New York, NY, USA, 442–451.
[49]
Frank Kenneth Zadeck. 1984. Incremental data flow analysis in a structured program editor. Vol. 19. ACM.

Cited By

View all
  • (2024)Homeostasis: Design and Implementation of a Self-Stabilizing CompilerACM Transactions on Programming Languages and Systems10.1145/364930846:2(1-58)Online publication date: 1-May-2024
  • (2024)Interactive Abstract Interpretation with Demanded SummarizationACM Transactions on Programming Languages and Systems10.1145/364844146:1(1-40)Online publication date: 15-Feb-2024
  • (2024)Clog: A Declarative Language for C Static Code CheckersProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641579(186-197)Online publication date: 17-Feb-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 2, Issue OOPSLA
November 2018
1656 pages
EISSN:2475-1421
DOI:10.1145/3288538
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution-ShareAlike International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 24 October 2018
Published in PACMPL Volume 2, Issue OOPSLA

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Datalog
  2. Domain-Specific Language
  3. Incremental Computing
  4. Language Workbench
  5. Lattice
  6. Static Analysis

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2024)Homeostasis: Design and Implementation of a Self-Stabilizing CompilerACM Transactions on Programming Languages and Systems10.1145/364930846:2(1-58)Online publication date: 1-May-2024
  • (2024)Interactive Abstract Interpretation with Demanded SummarizationACM Transactions on Programming Languages and Systems10.1145/364844146:1(1-40)Online publication date: 15-Feb-2024
  • (2024)Clog: A Declarative Language for C Static Code CheckersProceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction10.1145/3640537.3641579(186-197)Online publication date: 17-Feb-2024
  • (2024)A Modular Soundness Theory for the Blackboard Analysis ArchitectureProgramming Languages and Systems10.1007/978-3-031-57267-8_14(361-390)Online publication date: 6-Apr-2024
  • (2023)Interactive Debugging of Datalog ProgramsProceedings of the ACM on Programming Languages10.1145/36228247:OOPSLA2(745-772)Online publication date: 16-Oct-2023
  • (2023)Tai-e: A Developer-Friendly Static Analysis Framework for Java by Harnessing the Good Designs of ClassicsProceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3597926.3598120(1093-1105)Online publication date: 12-Jul-2023
  • (2023)Better Together: Unifying Datalog and Equality SaturationProceedings of the ACM on Programming Languages10.1145/35912397:PLDI(468-492)Online publication date: 6-Jun-2023
  • (2023)Change Pattern Detection for Optimising Incremental Static Analysis2023 IEEE 23rd International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM59687.2023.00016(49-60)Online publication date: 2-Oct-2023
  • (2023)DCLINK: Bridging Data Constraint Changes and Implementations in FinTech Systems2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE56229.2023.00170(914-925)Online publication date: 11-Sep-2023
  • (2023)Result Invalidation for Incremental Modular AnalysesVerification, Model Checking, and Abstract Interpretation10.1007/978-3-031-24950-1_14(296-319)Online publication date: 16-Jan-2023
  • Show More Cited By

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