A cost-effective estimation of uncaught exceptions in standard ML programs

  • Authors:
  • Kwangkeun Yi;Sukyoung Ryu

  • Affiliations:
  • Korea Advanced Institute of Science and Technology, Taejon, South Korea;Korea Advanced Institute of Science and Technology, Taejon, Korea

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2002

Quantified Score

Hi-index 5.23

Visualization

Abstract

We present a static analysis that detects potential runtime exceptions that are raised and never handled inside Standard ML (SML) programs. This analysis will predict abrupt termination of SML programs, which is SMLs only one "safety hole". Even though SML program's control flow and exception flow are in general mutually dependent, analyzing the two flows are safely decoupled. Program's control flow is firstly estimated by simple case analysis of call expressions. Using this call-graph information, program's exception flow is derived as set constraints, whose least model is our analysis result. Both of these two analyses are proven safe and the reasons behind each design decision are discussed. Our implementation of this analysis has been applied to realistic SML programs and shows a promising cost-accuracy performance. For the ML-Lex program, for example, the analysis takes 1.36 s and it reports 3 may-uncaught exceptions, which are exactly the exceptions that can really escape. Our final goal is to make the analysis overhead less than 10% of the compilation time (compiling the ML-Lex takes 6-7 s) and to analyze modules in isolation. Copyright 2002 Elsevier Science B.V.