Book Chapter10.1007/978-3-540-85373-2_7
Lazy Contract Checking for Immutable Data Structures
Robert Bruce Findler,Shu-Yu Guo,Anne Rogers +2 more
- 01 Apr 2008
- pp 111-128
TL;DR: This paper explores 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, and proposes an extension to the implementation that admits more expressive contracts by loosening the strict asymptotic guarantees and only preserving the amortized asymPTotic complexity.
read more
Abstract: 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 subtype 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 contracts allow subtyping and thus preserve the potential for abstraction. Unlike eagerly-checked contracts, our contracts do not affect the asymptotic behavior of the program.
This paper presents our implementation of these ideas, an optimization in our implementation, performance measurements, and a discussion of an extension to our implementation that admits more expressive contracts by loosening the strict asymptotic guarantees and only preserving the amortized asymptotic complexity.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
A spectrum of type soundness and performance
Ben Greenman,Matthias Felleisen +1 more
- 30 Jul 2018
TL;DR: A uniform semantic framework is presented that explains all three fundamentally different ways of thinking about the integrity of programs that combine statically typed and dynamically typed code, and adds a systematic performance comparison for a single implementation platform.
43
Model Check What You Can, Runtime Verify the Rest.
Timothy L. Hinrichs,A. Prasad Sistla,Lenore D. Zuck +2 more
- 01 Jan 2014
TL;DR: This position paper argues that the formal verification community would be well-served by developing theory, algorithms, implementations, and applications that combine model checking and runtime verification into a single, seamless technology.
Eager and delayed contract monitoring for call-by-value and call-by-name evaluation☆
TL;DR: This work investigates the properties of contract monitoring for languages with contracts and effects using a monadic semantics, study three combinations of evaluation orders and contract monitoring styles and verifies algebraic laws.
13
The interaction of contracts and laziness
Markus Degen,Peter Thiemann,Stefan Wehr +2 more
- 23 Jan 2012
TL;DR: The main result is that contract monitoring for lazy functional languages cannot be complete and meaning preserving at the same time, although both properties can be achieved in isolation.
13
Profiling for laziness
Stephen Chang,Matthias Felleisen +1 more
- 08 Jan 2014
TL;DR: A profiling-based technique is presented that captures and automates expertise for the insertion of laziness annotations into strict programs by equiping a formal semantics with a metric that measures waste in an evaluation.
8
References
•Book
Introduction to Algorithms
Thomas H. Cormen,Charles E. Leiserson,Ronald L. Rivest +2 more
- 01 Jan 1990
TL;DR: The updated new edition of the classic Introduction to Algorithms is intended primarily for use in undergraduate or graduate courses in algorithms or data structures and presents a rich variety of algorithms and covers them in considerable depth while making their design and analysis accessible to all levels of readers.
24.8K
A technique for software module specification with examples
TL;DR: This paper presents an approach to writing specifications for parts of software systems sufficiently precise and complete that other pieces of software can be written to interact with the piece specified without additional information.
•Book
Purely functional data structures
Chris Okasaki
- 01 Jan 1998
TL;DR: This work describes several techniques for designing functional data structures, and numerous original data structures based on these techniques, including multiple variations of lists, queues, double-ended queues, and heaps, many supporting more exotic features such as random access or efficient catenation.
756
The essence of compiling with continuations
Cormac Flanagan,Amr Sabry,Bruce F. Duba,Matthias Felleisen +3 more
- 01 Jun 1993
TL;DR: The combined effect of the three phases is equivalent to a source-to-source transformation that simulates the compaction phase and fully developed CPS compilers do not need to employ the CPS transformation but can achieve the same results with a simple source-level transformation.
Related Papers (5)
Robert Bruce Findler,Matthias Felleisen +1 more
- 17 Sep 2002
Philip Wadler,Robert Bruce Findler +1 more
- 28 Mar 2009
Robert Bruce Findler,Matthias Blume +1 more
- 24 Apr 2006
Michael Greenberg,Benjamin C. Pierce,Stephanie Weirich +2 more
- 17 Jan 2010