A type system for safe memory management and its proof of correctness

  • Authors:
  • Manuel Montenegro;Ricardo Peña;Clara Segura

  • Affiliations:
  • Univ. Complutense de Madrid, Madrid, Spain;Univ. Complutense de Madrid, Madrid, Spain;Univ. Complutense de Madrid, Madrid, Spain

  • Venue:
  • Proceedings of the 10th international ACM SIGPLAN conference on Principles and practice of declarative programming
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a destruction-aware type system for the functional language Safe, which is a first-order eager language with facilities for programmer controlled destruction and copying of data structures. It provides also regions, i.e. disjoint parts of the heap, where the program allocates data structures. The runtime system does not need a garbage collector and all allocation/deallocation actions are done in constant time. The language is equipped with several analyses and inference algorithms so that regions, sharing information and types are automatically inferred by the compiler. Here, we concentrate on the correctness of the type system with respect to the operational semantics of the language. In particular, we prove that, in spite of sharing and of the use of implicit and explicit memory deallocation operations, all well-typed programs will be free of dangling pointers at runtime. The paper ends up with some examples of well-typed programs.