Sciweavers

IFL
2007
Springer

Lazy Contract Checking for Immutable Data Structures

13 years 10 months ago
Lazy Contract Checking for Immutable Data Structures
Existing contract checkers for data structures force programmers to choose between poor alternatives. Contracts are either built into the functions that construct the data structure, meaning that each object can only be used with a single contract and that a data structure with an invariant cannot be viewed as a of the data structure without the invariant (thus inhibiting abstraction) or contracts are checked eagerly when an operation on the data structure is invoked, meaning that many redundant checks are performed, potentially even changing the program’s asymptotic complexity. We explore the idea of adding a small, controlled amount of laziness to contract checkers so that the contracts on a data structure are only checked as the program inspects the data structure. Unlike contracts on the constructors, our lazy s allow subtyping and thus preserve the potential for abstraction. Unlike eagerly-checked contracts, our contracts do not affect the asymptotic behavior of the program. Thi...
Robert Bruce Findler, Shu-yu Guo, Anne Rogers
Added 08 Jun 2010
Updated 08 Jun 2010
Type Conference
Year 2007
Where IFL
Authors Robert Bruce Findler, Shu-yu Guo, Anne Rogers
Comments (0)