Automating program analysis

  • Authors:
  • Timothy Hickey;Jacques Cohen

  • Affiliations:
  • Brandeis Univ., Waltham, MA;Brandeis Univ., Waltham, MA

  • Venue:
  • Journal of the ACM (JACM)
  • Year:
  • 1988

Quantified Score

Hi-index 0.00

Visualization

Abstract

The first part of the paper shows that previous theoretical work on the semantics of probabilistic programs (Kozen) and on the correctness of performance annotated programs (Ramshaw) can be used to automate the average-case analysis of simple programs containing assignments, conditionals, and loops. A performance compiler has been developed using this theoretical foundation. The compiler is described, and it is shown that special cases of symbolic simplifications of formulas play a major role in rendering the system usable. The performance compiler generates a system of recurrence equations derived from a given program whose efficiency one wishes to analyze. This generation is always possible, but the problem of solving the resulting equations may be complex. The second part of the paper presents an original method that generalizes the previous approach and is applicable to functional programs that make use of recursion and complex data structures. Several examples are presented, including an analysis of binary tree sort. A key feature of the analysis of such programs is that distributions on complex data structures are represented using attributed probabilistic grammars.