Abstract
Hoare Type Theory (HTT) combines a dependently typed, higher-order language with monadically-encapsulated, stateful computations. The type system incorporates pre- and post-conditions, in a fashion similar to Hoare and Separation Logic, so that programmers can modularly specify the requirements and effects of computations within types.
This paper extends HTT with quantification over abstract predicates (i.e., higher-order logic), thus embedding into HTT the Extended Calculus of Constructions. When combined with the Hoare-like specifications, abstract predicates provide a powerful way to define and encapsulate the invariants of private state that may be shared by several functions, but is not accessible to their clients. We demonstrate this power by sketching a number of abstract data types that demand ownership of mutable memory, including an idealized custom memory manager.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: An overview. In: Barthe, G., et al. (eds.) CASSIS 2004. LNCS, vol. 3362, Springer, Heidelberg (2005)
Barnett, M., Naumann, D.: Friends need a bit more: Maintaining invariants over shared state. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, Springer, Heidelberg (2004)
Benton, N.: Abstracting Allocation: The New new Thing. In: Ésik, Z. (ed.) CSL 2006. LNCS, vol. 4207, Springer, Heidelberg (2006)
Berger, M., Honda, K., Yoshida, N.: A logical analysis of aliasing in imperative higher-order functions. In: ICFP’05, pp. 280–293 (2005)
Biering, B., Birkedal, L., Torp-Smith, N.: BI hyperdoctrines, Higher-Order Separation Logic, and Abstraction. ITU-TR-2005-69, IT University, Copenhagen (2005)
Burdy, L., et al.: An overview of JML tools and applications. International Journal on Software Tools for Technology Transfer 7(3), 212–232 (2005)
DeLine, R., Fahndrich, M.: Enforcing high-level protocols in low-level software. In: PLDI’01, pp. 59–69 (2001)
Detlefs, D.L., et al.: Extended static checking. Compaq Systems Research Center, Research Report 159 (December 1998)
Evans, D., Larochelle, D.: Improving security using extensible lightweight static analysis. IEEE Software 19(1), 42–51 (2002)
Filliâtre, J.-C.: Verification of non-functional programs using interpretations in type theory. Journal of Functional Programming 13(4), 709–745 (2003)
Harrison, J.: Inductive definitions: automation and application. In: Schubert, E.T., Alves-Foss, J., Windley, P. (eds.) HUG 1995. LNCS, vol. 971, Springer, Heidelberg (1995)
Jim, T., et al.: Cyclone: A safe dialect of C. In: USENIX Annual Technical Conference (2002)
Krishnaswami, N.: Separation logic for a higher-order typed language. In: SPACE’06 (2006)
Luo, Z.: An Extended Calculus of Constructions. PhD thesis, U. of Edinburgh (1990)
Mandelbaum, Y., Walker, D., Harper, R.: An effective theory of type refinements. In: ICFP’03, pp. 213–226 (2003)
The Coq development team: The Coq proof assistant reference manual. LogiCal Project, Version 8.0 (2004)
McBride, C.: Dependently Typed Functional Programs and their Proofs. PhD thesis, University of Edinburgh (1999)
Mitchell, J.C.: Foundations for Programming Languages. MIT Press, Cambridge (1996)
Moggi, E.: Notions of computation and monads. Information and Computation 93(1), 55–92 (1991)
Morrisett, G., et al.: From System F to typed assembly language. TOPLAS 21(3), 527–568 (1999)
Nanevski, A., et al.: Abstract predicates and mutable ADTs in Hoare Type Theory. TR-14-06, Harvard University (July 2006), Available at http://www.eecs.harvard.edu/~aleks/papers/hoarelogic/htthol.pdf
Nanevski, A., Morrisett, G., Birkedal, L.: Polymorphism and separation in Hoare Type Theory. In: ICFP’06, pp. 62–73 (2006)
Ni, Z., Shao, Z.: Certified assembly programming with embedded code pointers. In: POPL’06, pp. 320–333 (2006)
O’Hearn, P.W., Yang, H., Reynolds, J.C.: Separation and information hiding. In: POPL’04, pp. 268–280 (2004)
Pierce, B.C., Turner, D.N.: Local type inference. TOPLAS 22(1), 1–44 (2000)
Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: LICS’02, pp. 55–74 (2002)
Shao, Z., et al.: A type system for certified binaries. TOPLAS 27(1), 1–45 (2005)
Watkins, K., et al.: A concurrent logical framework: The propositional fragment. In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, Springer, Heidelberg (2004)
Xi, H.: Applied Type System (extended abstract). In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, Springer, Heidelberg (2004)
Xi, H., Pfenning, F.: Dependent types in practical programming. In: POPL’99 (1999)
Yoshida, N., Honda, K., Berger, M.: Logical reasoning for higher-order functions with local state. Personal communication (August 2006)
Xi, H., Zhu, D.: Safe Programming with Pointers Through Stateful Views. In: Hermenegildo, M.V., Cabeza, D. (eds.) PADL 2004. LNCS, vol. 3350, pp. 83–97. Springer, Heidelberg (2005)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Nanevski, A., Ahmed, A., Morrisett, G., Birkedal, L. (2007). Abstract Predicates and Mutable ADTs in Hoare Type Theory. In: De Nicola, R. (eds) Programming Languages and Systems. ESOP 2007. Lecture Notes in Computer Science, vol 4421. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71316-6_14
Download citation
DOI: https://doi.org/10.1007/978-3-540-71316-6_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-71314-2
Online ISBN: 978-3-540-71316-6
eBook Packages: Computer ScienceComputer Science (R0)