SHErrLoc

Abstract

We introduce a general way to locate programmer mistakes that are detected by static analyses. The program analysis is expressed in a general constraint language that is powerful enough to model type checking, information flow analysis, dataflow analysis, and points-to analysis. Mistakes in program analysis result in unsatisfiable constraints. Given an unsatisfiable system of constraints, both satisfiable and unsatisfiable constraints are analyzed to identify the program expressions most likely to be the cause of unsatisfiability. The likelihood of different error explanations is evaluated under the assumption that the programmer’s code is mostly correct, so the simplest explanations are chosen, following Bayesian principles. For analyses that rely on programmer-stated assumptions, the diagnosis also identifies assumptions likely to have been omitted. The new error diagnosis approach has been implemented as a tool called SHErrLoc, which is applied to three very different program analyses, such as type inference for a highly expressive type system implemented by the Glasgow Haskell Compiler—including type classes, Generalized Algebraic Data Types (GADTs), and type families. The effectiveness of the approach is evaluated using previously collected programs containing errors. The results show that when compared to existing compilers and other tools, SHErrLoc consistently identifies the location of programmer errors significantly more accurately, without any language-specific heuristics.

Document Details

Document Type
Pub Defense Publication
Publication Date
Aug 17, 2017
Source ID
10.1145/3121137

Entities

People

  • Andrew C. Myers
  • Danfeng Zhang
  • Dimitrios Vytiniotis
  • Simon Peyton-jones

Organizations

  • Air Force Office of Scientific Research
  • Cornell University
  • Microsoft
  • National Science Foundation
  • Office of Naval Research
  • Pennsylvania State University

Tags

Fields of Study

  • Computer science

Readers

  • Artificial Intelligence
  • Computational Linguistics
  • Regression Analysis.

Technology Areas

  • AI & ML
  • AI & ML - Bayesian Inference