TitleRely-guarantee references for refinement types over aliased mutable data
Publication TypeConference Paper
Year of Publication2013
AuthorsGordon CS, Ernst MD, Grossman D
Conference NamePLDI 2013: Proceedings of the ACM SIGPLAN 2013 Conference on Programming Language Design and Implementation
Pagination73–84
Date or Month PublishedJune
Conference LocationSeattle, WA, USA
AbstractReasoning about side effects and aliasing is the heart of verifying imperative programs. Unrestricted side effects through one reference can invalidate assumptions about an alias. We present a new type system approach to reasoning about safe assumptions in the presence of aliasing and side effects, unifying ideas from reference immutability type systems and rely-guarantee program logics. Our approach, \emphrely-guarantee references, treats multiple references to shared objects similarly to multiple threads in rely-guarantee program logics. We propose statically associating rely and guarantee conditions with individual references to shared objects. Multiple aliases to a given object may coexist only if the guarantee condition of each alias implies the rely condition for all other aliases. We demonstrate that existing reference immutability type systems are special cases of rely-guarantee references. \par In addition to allowing precise control over state modification, rely-guarantee references allow types to depend on mutable data while still permitting flexible aliasing. Dependent types whose denotation is stable over the actions of the rely and guarantee conditions for a reference and its data will not be invalidated by any action through any alias. We demonstrate this with refinement (subset) types that may depend on mutable data. As a special case, we derive the first reference immutability type system with dependent types over immutable data. \par We show soundness for our approach and describe experience using rely-guarantee references in a dependently-typed monadic DSL in Coq.
Downloadshttps://homes.cs.washington.edu/~mernst/pubs/rely-guarantee-ref-tr130302... technical report https://github.com/csgordon/rgref/ implementation https://homes.cs.washington.edu/~mernst/pubs/rely-guarantee-ref-pldi2013... PDF https://homes.cs.washington.edu/~mernst/pubs/rely-guarantee-ref-pldi2013... slides (PDF)
Citation KeyGordonEG2013