Skip to main content
QUICK REVIEW

[Paper Review] Pushdown Control-Flow Analysis of Higher-Order Programs

Christopher Earl, Matthew Might|arXiv (Cornell University)|Jul 24, 2010
Formal Methods in VerificationComputer Science19 references35 citations
TL;DR

This paper introduces a pushdown control-flow analysis (PDCFA) framework for higher-order programs by abstracting a CESK machine with an unbounded stack, enabling precise, polyvariant analysis that avoids return-flow merging. The key contribution is a decidable, polynomial-time method for pushdown-based control-flow analysis via PDA construction and CFL-reachability, achieving both high precision and efficiency.

ABSTRACT

Context-free approaches to static analysis gain precision over classical approaches by perfectly matching returns to call sites---a property that eliminates spurious interprocedural paths. Vardoulakis and Shivers's recent formulation of CFA2 showed that it is possible (if expensive) to apply context-free methods to higher-order languages and gain the same boost in precision achieved over first-order programs. To this young body of work on context-free analysis of higher-order programs, we contribute a pushdown control-flow analysis framework, which we derive as an abstract interpretation of a CESK machine with an unbounded stack. One instantiation of this framework marks the first polyvariant pushdown analysis of higher-order programs; another marks the first polynomial-time analysis. In the end, we arrive at a framework for control-flow analysis that can efficiently compute pushdown generalizations of classical control-flow analyses.

Motivation & Objective

  • Address the fundamental problem of return-flow merging in finite-state control-flow analyses, which leads to spurious interprocedural paths and imprecise results.
  • Overcome the limitations of classical context-sensitive analyses (e.g., 0CFA) that rely on finite context stacks and inevitably merge return-flow information.
  • Develop a framework that preserves stack-based return context indefinitely, enabling precise analysis of higher-order programs without sacrificing decidability.
  • Achieve both polyvariant precision and polynomial-time complexity—solving key drawbacks of prior approaches like CFA2, which was monovariant and exponential.
  • Provide a decidable, scalable method for control-flow analysis by modeling the abstract machine as a pushdown automaton and using CFL-reachability to answer reachability queries.

Proposed method

  • Abstract the concrete CESK machine for A-normal form lambda-calculus by bounding the store but leaving the stack (continuation) unabstracted, resulting in an infinite-state system.
  • Construct an abstract interpretation of the CESK machine where control states are tracked via a Dyck state graph, representing valid sequences of control-flow transitions.
  • Transform the abstracted CESK machine into a pushdown automaton (PDA) that recognizes the language of legal control-state sequences.
  • Use CFL-reachability techniques—specifically, intersecting the PDA’s language with a regular language representing target configurations—to decide reachability and answer control-flow queries.
  • Optimize the analysis complexity by refining the PDA construction and leveraging epsilon-closure and state graph compression, reducing worst-case complexity from doubly exponential to polynomial.
  • Introduce a polyvariant variant of the analysis that tracks distinct calling contexts, enabling higher precision than monovariant approaches.

Experimental results

Research questions

  • RQ1Can a pushdown control-flow analysis eliminate return-flow merging in higher-order programs by preserving unbounded stack context?
  • RQ2Is it possible to design a decidable control-flow analysis for higher-order programs that operates in polynomial time while maintaining polyvariant precision?
  • RQ3How can pushdown automata and context-free language techniques be used to model and reason about control-flow in higher-order programs with unbounded stacks?
  • RQ4Can the abstract interpretation of a CESK machine with an unbounded stack yield a decidable and efficient analysis framework for control-flow analysis?
  • RQ5What is the relationship between pushdown control-flow analysis and existing techniques like CFA2, and how does it overcome their limitations in precision and performance?

Key findings

  • The proposed pushdown control-flow analysis framework achieves precise, polyvariant analysis by modeling the program stack as an unbounded pushdown system, eliminating return-flow merging.
  • The analysis is decidable because it reduces reachability queries to non-emptiness checks on the intersection of a PDA language and a regular language, a decidable problem.
  • By constructing a Dyck state graph and applying CFL-reachability, the method enables efficient analysis with worst-case time complexity of O(n⁶) in the monovariant case.
  • The framework supports both monovariant and polyvariant precision, with the latter being the first polyvariant pushdown analysis for higher-order programs.
  • The method achieves polynomial-time complexity in the best case, marking the first polynomial-time pushdown control-flow analysis for higher-order programs.
  • The approach generalizes classical control-flow analysis by preserving stack-based return context, enabling more accurate tracking of control and data flows than finite-state abstractions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.