Shape Checking of Array Programs
Abstract
Authors CBJ and M. Sekanina
Shape
theory provides a framework for the study of data types in which shape
and data can be manipulated separately. This paper is concerned with
shape checking, i.e. the detection of shape errors, such as array
bound errors, without handling the data. It can be seen as a form of
partial evaluation in which data computations are ignored.
We construct a simply-typed lambda-calculus that supports a vector
type constructor, whose iteration yields types of arrays. It is
expressive enough to construct all of the usual array operations. All
shape errors in a term t can be detected by evaluating its shape #t
which proceeds by first eliminating all the data, and then evaluating
in the usual way. Evaluation of #t will terminate if that of t does.
|