Types from control flow analysis

  • Authors:
  • Flemming Nielson;Hanne Riis Nielson

  • Affiliations:
  • Informatics and Mathematical Modelling, Technical University of Denmark, Kongens Lyngby, Denmark;Informatics and Mathematical Modelling, Technical University of Denmark, Kongens Lyngby, Denmark

  • Venue:
  • Program analysis and compilation, theory and practice
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Control flow analysis is a powerful method for analysing which functions are applied to which arguments. However, many users find the information more understandable if the information is presented in the form of types rather than sets of function abstractions. We therefore show how to translate the result of the control flow analysis into the syntax of types (to be called observed types). To compare our approach with the more traditional approach using type systems (to be called inferred types) we develop the subtyping relations in both approaches; in particular we show that covariant subtyping is the appropriate choice for observed types whereas contravariant subtyping is appropriate choice for inferred types. This serves as a technical underpinning of our main thesis that observed types should merely record how the entity has been used in the program at hand whereas inferred types should indicate how the entity can be used in all possible contexts.