skip to main content
10.1145/1069774.1069785acmconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
Article

Incremental and demand-driven points-to analysis using logic programming

Published: 11 July 2005 Publication History

Abstract

Several program analysis problems can be cast elegantly as a logic program. In this paper we show how recently-developed techniques for incremental evaluation of logic programs can be refined and used for deriving practical implementations of incremental program analyzers. Incremental program analyzers compute the changes to the analysis information due to small changes in the input program rather than re-analyzing the program. Demand-driven analyzers compute only the information requested by the client analysis/optimization. We describe a framework based on logic programming for implementing program analyses that combines incremental and demand driven techniques. We show the effectiveness of this approach by building a practical incremental and demand-driven context insensitive points-to analysis and evaluating this implementation for analyzing C programs with 10-70K lines of code. Experiments show that our technique can compute the changes to analysis information due to small changes in the input program in, on the average, 6% of the time it takes to reanalyze the program from scratch, and with little space overhead.

References

[1]
G. Agrawal, J. Li, and Q. Su. Evaluating a demand driven technique for call graph construction. In Computational Complexity, volume 2916 of LNCS, pages 29--45. Springer-Verlag, 2002.]]
[2]
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: principles, techniques, and tools, pages 585--718. Addison-Wesley, 1986.]]
[3]
L. O. Anderson. Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, Unversity of Copenhagen, 1994.]]
[4]
D. C. Atkinson and W. G. Griswold. Effective whole-program analysis in the presence of pointers. In Foundations of Software Engineering, pages 46--55, 1998.]]
[5]
S. Bates and S. Horwitz. Incremental program testing using program dependence graphs. In Principles of Programming Languages, pages 384--396. ACM Press, 1993.]]
[6]
M. Burke. An interval-based approach to exhaustive and incremental interprocedural data-flow analysis. ACM Trans. Program. Lang. Syst., 12(3):341--395, 1990.]]
[7]
M. G. Burke and B. G. Ryder. A critical analysis of incremental iterative data flow analysis algorithms. IEEE Trans. Softw. Eng., 16(7):723--728, 1990.]]
[8]
M. Carroll and B. G. Ryder. An incremental algorithm for software analysis. In ACM software engg. symp. on practical software development environments, pages 171--179, 1987.]]
[9]
M. D. Carroll and B. G. Ryder. Incremental data flow analysis via dominator and attribute update. In Principles of Programming Languages, pages 274--284. ACM Press, 1988.]]
[10]
W. Chen and D. S. Warren. Tabled evaluation with delaying for general logic programs. JACM, 43(1):20--74, 1996.]]
[11]
S. Dawson, C. R. Ramakrishnan, and D. S. Warren. Practical program analysis using general purpose logic programming systems --- a case study. In Programming Language Design and Implementation, pages 117--126. ACM Press, 1996.]]
[12]
E. Duesterwald, R. Gupta, and M. L. Soffa. A demand-driven analyzer for data flow testing at the integration level. In International Conference on Software Engineering, pages 575--584, 1996.]]
[13]
E. Duesterwald, R. Gupta, and M. L. Soffa. A practical framework for demand-driven interprocedural data flow analysis. ACM Trans. Program. Lang. Syst., 19(6):992--1030, 1997.]]
[14]
M. Fähndrich, J. S. Foster, Z. Su, and A. Aiken. Partial Online Cycle Elimination in Inclusion Constraint Graphs. In Programming Language Design and Implementation, pages 85--96. ACM Press, 1998.]]
[15]
M. Fähndrich, J. Rehof, and M. Das. Scalable context-sensitive flow analysis using instantiation constraints. In Programming Language Design and Implementation, pages 253--263. ACM Press, 2000.]]
[16]
J. S. Foster, M. Fähndrich, and A. Aiken. Polymorphic versus Monomorphic Flow-insensitive Points-to Analysis for C. In Static Analysis Symposium, volume 1824 of LNCS, pages 175--198, 2000.]]
[17]
A. Gupta, I. S. Mumick, and V. S. Subrahmanian. Maintaining views incrementally. In SIGMOD, pages 157--166, 1993.]]
[18]
S. Guyer and C. Lin. Client-driven pointer analysis. In Static Analysis Symposium, pages 214--236, 2003.]]
[19]
N. Heintze and O. Tardieu. Demand-driven pointer analysis. In Programming Language Design and Implementation, pages 24--34. ACM Press, 2001.]]
[20]
N. Heintze and O. Tardieu. Ultra-fast aliasing analysis using CLA: A million lines of c code in a second. In Programming Language Design and Implementation, pages 254--263. ACM Press, 2001.]]
[21]
M. Hind. Pointer analysis: Haven't we solved this problem yet? In Workshop on Program Analysis for Software Tools and Engineering (PASTE), 2001.]]
[22]
S. Horwitz, T. Reps, and M. Sagiv. Demand interprocedural dataflow analysis. In Foundations of Software Engineering, pages 104--115, 1995.]]
[23]
W. Landi and B. G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In Programming Language Design and Implementation, volume~27, pages 235--248. ACM Press, 1992.]]
[24]
D. Liang and M. J. Harrold. Efficient computation of parameterized pointer information for interprocedural analyses. In Static Analysis Symposium, pages 279--298. Springer-Verlag, 2001.]]
[25]
T. J. Marlowe and B. G. Ryder. An efficient hybrid algorithm for incremental data flow analysis. In Principles of Programming Languages, pages 184--196. ACM Press, 1990.]]
[26]
G. C. Necula, S. McPeak, S. P. Rahul, and W. Weimer. Cil: Intermediate language and tools for analysis and transformation of C programs. In Compiler Construction, pages 213--228. Springer-Verlag, 2002.]]
[27]
L. L. Pollock and M. L. Soffa. An incremental version of iterative data flow analysis. IEEE Trans. Softw. Eng., 15(12):1537--1549, 1989.]]
[28]
L. L. Pollock and M. L. Soffa. Incremental global reoptimization of programs. ACM Trans. Program. Lang. Syst., 14(2):173--200, 1992.]]
[29]
R. Ramakrishnan. Magic Templates: A spellbinding approach to logic programming. In JICSLP, 1988.]]
[30]
P. Rao, C. R. Ramakrishnan, and I. V. Ramakrishnan. A thread in time saves tabling time. In Joint International Conference/Symposium on Logic Programming. MIT Press, 1996.]]
[31]
T. W. Reps. Demand interprocedural program analysis using logic databases. In Workshop on Programming with Logic Databases, ILPS, pages 163--196, 1993.]]
[32]
B. G. Ryder and M. C. Paull. Incremental data-flow analysis algorithms. ACM Trans. Program. Lang. Syst., 10(1):1--50, 1988.]]
[33]
D. Saha and C. R. Ramakrishnan. Incremental and demand-driven points-to analysis using logic programming. Downloads are available at www.lmc.cs.sunysb.edu/~dsaha/incr_pta.]]
[34]
D. Saha and C. R. Ramakrishnan. Incremental evaluation of tabled logic programs. In International Conference on Logic Programming, volume 2916 of LNCS, pages 389--406, 2003.]]
[35]
O. V. Sokolsky and S. A. Smolka. Incremental model checking in the modal mu-calculus. In CAV, volume 818 of LNCS, pages 351--363, 1994.]]
[36]
B. Steensgaard. Points-to analysis in almost linear time. In Principles of Programming Languages, pages 32--41. ACM Press, 1996.]]
[37]
Z. Su, M. Fahndrich, and A. Aiken. Projection merging: Reducing redundancies in inclusion constraint graphs. In Principles of Programming Languages, pages 81--95. ACM Press, 2000.]]
[38]
H. Tamaki and T. Sato. OLDT resolution with tabulation. In International Conference on Logic Programming, pages 84--98, 1986.]]
[39]
J. D. Ullman. Principles of Database and Knowledge-base Systems, Volume II. Computer Science Press, 1989.]]
[40]
F. Vivien and M. C. Rinard. Incrementalized pointer and escape analysis. In Programming Language Design and Implementation, pages 35--46. ACM Press, 2001.]]
[41]
D. S. Warren. Memoing for logic programs. Communications of the ACM, 35(3):93--111, 1992.]]
[42]
J. Whaley and M. S. Lam. Cloning-based context-sensitive pointer alias analysis using binary decision diagrams. In Programming Language Design and Implementation, pages 131--144. ACM Press, 2004.]]
[43]
XSB. The XSB logic programming system. Available from http://xsb.sourceforge.net.]]
[44]
J. Yur, B. G. Ryder, and W. Landi. An incremental flow- and context-sensitive pointer aliasing analysis. In International Conference on Software Engineering, pages 442--451, 1999.]]
[45]
J. Yur, B. G. Ryder, W. Landi, and P. Stocks. Incremental analysis of side effects for C software system. In International Conference on Software Engineering, pages 422--432, 1997.]]

Cited By

View all
  • (2024)Falcon: A Fused Approach to Path-Sensitive Sparse Data Dependence AnalysisProceedings of the ACM on Programming Languages10.1145/36564008:PLDI(567-592)Online publication date: 20-Jun-2024
  • (2024)Interactive abstract interpretation: reanalyzing multithreaded C programs for cheapInternational Journal on Software Tools for Technology Transfer10.1007/s10009-024-00768-926:6(647-667)Online publication date: 25-Sep-2024
  • (2023)Incrementalizing Production CodeQL AnalysesProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3613860(1716-1726)Online publication date: 30-Nov-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PPDP '05: Proceedings of the 7th ACM SIGPLAN international conference on Principles and practice of declarative programming
July 2005
260 pages
ISBN:1595930906
DOI:10.1145/1069774
  • General Chair:
  • Pedro Barahona,
  • Program Chair:
  • Amy Felty
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 July 2005

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. demand-drive analysis
  2. incremental analysis
  3. logic programming
  4. pointer analysis

Qualifiers

  • Article

Conference

PPDP05
Sponsor:

Acceptance Rates

Overall Acceptance Rate 230 of 486 submissions, 47%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)20
  • Downloads (Last 6 weeks)1
Reflects downloads up to 15 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Falcon: A Fused Approach to Path-Sensitive Sparse Data Dependence AnalysisProceedings of the ACM on Programming Languages10.1145/36564008:PLDI(567-592)Online publication date: 20-Jun-2024
  • (2024)Interactive abstract interpretation: reanalyzing multithreaded C programs for cheapInternational Journal on Software Tools for Technology Transfer10.1007/s10009-024-00768-926:6(647-667)Online publication date: 25-Sep-2024
  • (2023)Incrementalizing Production CodeQL AnalysesProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3613860(1716-1726)Online publication date: 30-Nov-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)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
  • (2022)SHARP: fast incremental context-sensitive pointer analysis for JavaProceedings of the ACM on Programming Languages10.1145/35273326:OOPSLA1(1-28)Online publication date: 29-Apr-2022
  • (2022)Efficient algorithms for dynamic bidirected Dyck-reachabilityProceedings of the ACM on Programming Languages10.1145/34987246:POPL(1-29)Online publication date: 12-Jan-2022
  • (2020)Incremental Flow Analysis through Computational Dependency Reification2020 IEEE 20th International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM51674.2020.00008(25-36)Online publication date: Sep-2020
  • (2019)Higher-order Demand-driven Program AnalysisACM Transactions on Programming Languages and Systems10.1145/331034041:3(1-53)Online publication date: 2-Jul-2019
  • (2019)Rethinking Incremental and Parallel Pointer AnalysisACM Transactions on Programming Languages and Systems10.1145/329360641:1(1-31)Online publication date: 1-Mar-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media