i-nth logo

Authors

Robin Abraham & Martin Erwig

Abstract

Spreadsheets are the most popular programming systems in use today. Since spreadsheets are visual, first-order functional languages, research into the foundations of spreadsheets is therefore a highly relevant topic for the principles and, in particular, the practice, of declarative programming.

Since the error rate in spreadsheets is very high and since those errors have significant impact, methods and tools that can help detect and remove errors from spreadsheets are very much needed.

Type systems have traditionally played a strong role in detecting errors in programming languages, and it is therefore reasonable to ask whether type systems could not be helpful in improving the current situation of spreadsheet programming.

In this paper we introduce a type system and a type inference algorithm for spreadsheets and demonstrate how this algorithm and the underlying typing concept can identify programming errors in spreadsheets.

In addition, we also demonstrate how the type inference algorithm can be employed to infer models, or specifications, for spreadsheets, which can be used to prevent future errors in spreadsheets.

Sample

Automatically inferred template
Automatically inferred template

To enable spreadsheet users to extract templates from their existing spreadsheets, we have developed the Parcel system, which uses cp-similarity.

Two cells are cp-similar if their formulas could have resulted from a copy/paste action from one of the cells to the other.

The template that is automatically inferred from an error-free version of the grade spreadsheet is shown in the figure.

Publication

2006, 8th ACM SIGPLAN international conference on principles and practice of declarative programming, July, pages 73-84

Full article

Type inference for spreadsheets