An update calculus for expressing type-safe program updates

  • Authors:
  • Martin Erwig;Deling Ren

  • Affiliations:
  • Oregon State University, School of EECS, Corvallis, OR 97331, USA;Oregon State University, School of EECS, Corvallis, OR 97331, USA

  • Venue:
  • Science of Computer Programming
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

The dominant share of software development costs is spent on software maintenance, particularly the process of updating programs in response to changing requirements. Currently, such program changes tend to be performed using text editors, an unreliable method that often causes many errors. In addition to syntax and type errors, logical errors can be easily introduced since text editors cannot guarantee that changes are performed consistently over the whole program. All these errors can cause a correct and perfectly running program to become instantly unusable. It is not surprising that this situation exists because the ''text-editor method'' reveals a low-level view of programs that fails to reflect the structure of programs. We address this problem by pursuing a programming-language-based approach to program updates. To this end we discuss in this paper the design and requirements of an update language for expressing update programs. We identify as the essential part of any update language a scope update that performs coordinated update of the definition and all uses of a symbol. As the underlying basis for update languages, we define an update calculus for updating lambda calculus programs. We develop a type system for the update calculus that infers the possible type changes that can be caused by an update program. We demonstrate that type-safe update programs that fulfill certain structural constraints preserve the type correctness of lambda terms. The update calculus can serve as a basis for higher-level update languages, such as for Haskell or Java.