skip to main content
10.1145/1159803.1159812acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Polymorphism and separation in hoare type theory

Published: 16 September 2006 Publication History

Abstract

In previous work, we proposed a Hoare Type Theory (HTT) which combines effectful higher-order functions, dependent types and Hoare Logic specifications into a unified framework. However, the framework did not support polymorphism, and ailed to provide a modular treatment of state in specifications. In this paper, we address these shortcomings by showing that the addition of polymorphism alone is sufficient for capturing modular state specifications in the style of Separation Logic. Furthermore, we argue that polymorphism is an essential ingredient of the extension, as the treatment of higher-order functions requires operations not encodable via the spatial connectives of Separation Logic.

References

[1]
M. Abadi and K.R.M. Leino. A logic of object-oriented programs. In Verification: Theory and Practice, pages 11--41. Springer-Verlag, 2004.]]
[2]
M. Barnett, K.R.M. Leino, and W. Schulte. The Spec# programming system: An overview. In CASSIS 2004, Lecture Notes in Computer Science. Springer, 2004.]]
[3]
M. Berger, K. Honda, and N. Yoshida. A logical analysis of aliasing in imperative higher-order functions. In O. Danvy and B.C. Pierce, editors, International Conference on Functional Programming, ICFP'05, pages 280--293, Tallinn, Estonia, September 2005.]]
[4]
B. Biering, L. Birkedal, and N. Torp-Smith. BI hyperdoctrines, Higher-Order Separation Logic, and Abstraction. Technical Report ITU-TR-2005-69, IT University of Copenhagen, Copenhagen, Denmark, July 2005.]]
[5]
L. Birkedal, N. Torp-Smith, and J. C. Reynolds. Local reasoning about a copying garbage collector. In Symposium on Principles of Programming Languages, POPL'04, pages 220--231, Venice, Italy, 2004.]]
[6]
L. Birkedal, N. Torp-Smith, and H. Yang. Semantics of separationlogic typing and higher-order frame rules. In Symposium on Logic in Computer Science, LICS'05, pages 260--269, Chicago, Illinois, June 2005.]]
[7]
R. Cartwright and D. C. Oppen. Unrestricted procedure calls in Hoare's logic. In Symposium on Principles of Programming Languages, POPL'78, pages 131--140, 1978.]]
[8]
A. Church. A formulation of the simple theory of types. The Journal of Symbolic Logic, 5(2):56--68, Jun 1940.]]
[9]
S.A. Cook. Soundness and completeness of an axiom system for program verification. SIAM Journal of Computing, 7(1):70--90, 1978.]]
[10]
D.L. Detlefs, K.R.M. Leino, G. Nelson, and J.B. Saxe. Extended static checking. Compaq Systems Research Center, Research Report 159, December 1998.]]
[11]
D. Evans and D. Larochelle. Improving security using extensible lightweight static analysis. IEEE Software, 19(1):42--51, 2002.]]
[12]
C.A.R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576--580, 1969.]]
[13]
M. Hofmann. Extensional Concepts in Intensional Type Theory. PhD thesis, Department of Computer Science, University of Edinburgh, July 1995. Avaliable as Technical Report ECS-LFCS-95-327.]]
[14]
K. Honda, N. Yoshida, and M. Berger. An observationally complete program logic for imperative higher-order functions. In Symposium on Logic in Computer Science, LICS'05, pages 270--279, Chicago, Illinois, June 2005.]]
[15]
W.A. Howard. The formulae-as-types notion of construction. In To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, pages 479--490. Academic Press, 1980.]]
[16]
T. Jim, G. Morrisett, D. Grossman, M. Hicks, J. Cheney, and Y. Wang. Cyclone: A safe dialect of C. In USENIX Annual Technical Conference, pages 275--288, Monterey, Canada, June 2002.]]
[17]
S.L.P. Jones and P. Wadler. Imperative functional programming. In Symposium on Principles of Programming Languages, POPL'93, pages 71--84, Charleston, South Carolina, 1993.]]
[18]
N. Krishnaswami. Separation logic for a higher-order typed language. In Workshop on Semantics, Program Analysis and Computing Environments for Memory Management, SPACE'06, pages 73--82, 2006.]]
[19]
K.R.M. Leino, G. Nelson, and J.B. Saxe. ESC/Java User's Manual. Compaq Systems Research Center, October 2000. Technical Note 2000-002.]]
[20]
Y. Mandelbaum, D. Walker, and R. Harper. An effective theory of type refinements. In International Conference on Functional Programming, ICFP'03, pages 213--226, Uppsala, Sweden, September 2003.]]
[21]
P. Martin-Löf. On the meanings of the logical constants and the justifications of the logical laws. Nordic Journal of Philosophical Logic, 1 1):11--60, 1996.]]
[22]
C. McBride. Dependently Typed Functional Programs and their Proofs. PhD thesis, University of Edinburgh, 1999.]]
[23]
J.L. McCarthy. Towards a mathematical science of computation. In IFIP Congress, pages 21--28, 1962.]]
[24]
E. Moggi. Computational lambda-calculus and monads. In Symposium on Logic in Computer Science, LICS'89, pages 14--23, Asilomar, California, 1989.]]
[25]
E. Moggi. Notions of computation and monads. Information and Computation, 93(1):55--92, 1991.]]
[26]
A. Nanevski and G. Morrisett. Dependent type theory of stateful higher-order functions. Technical Report TR-24-05, Harvard University, December 2005.]]
[27]
A. Nanevski, G. Morrisett, and L. Birkedal. Polymorphism and Separation in Hoare Type Theory. Technical Report TR-10-06, Harvard University, April 2006. Available at http://www.eecs.harvard.edu/~aleks/papers/hoarelogic/httsep.pdf.]]
[28]
A. Nanevski, F. Pfenning, and B. Pientka. Contextual modal type theory. Under consideration for publication in the ACM Transactions on Computation Logic, September 2005.]]
[29]
G.C. Necula. Proof-carrying code. In Symposium on Principles of Programming Languages, POPL'97, pages 106--119, Paris, January 1997.]]
[30]
P. O'Hearn, J. Reynolds, and H. Yang. Local reasoning about programs that alter data structures. In International Workshop on Computer Science Logic, CSL'01, volume 2142 of Lecture Notes in Computer Science, pages 1--19. Springer, 2001.]]
[31]
P.W. O'Hearn, H. Yang, and J. C. Reynolds. Separation and information hiding. In Symposium on Principles of Programming Languages, POPL'04, pages 268--280, 2004.]]
[32]
L.C. Paulson. A formulation of the simple theory of types (for Isabelle). In International Conference in Computer Logic, COLOG'88, volume 417 of Lecture Notes in Computer Science, pages 246--274. Springer, 2000.]]
[33]
S. Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, April 2003.]]
[34]
F. Pfenning and R. Davies. A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science, 11(4):511--540, 2001.]]
[35]
B.C. Pierce and D.N. Turner. Local type inference. ACM Transactions on Programming Languages and Systems, 22(1):1--44, 2000.]]
[36]
J.C. Reynolds. Separation logic: A logic for shared mutable data structures. In Symposium on Logic in Computer Science, LICS'02, pages 55--74, 2002.]]
[37]
Z. Shao, V. Trifonov, B. Saha, and N. Papaspyrou. A type system for certified binaries. ACM Transactions on Programming Languages and Systems, 27(1):1--45, January 2005.]]
[38]
F. Smith, D. Walker, and G. Morrisett. Alias types. In G. Smolka, editor, European Symposium on Programming, ESOP'00, volume 1782 of Lecture Notes in Computer Science, pages 366--381, Berlin, Germany, 2000.]]
[39]
SRI International and DSTO. The HOL System: Description. University of Cambridge Computer Laboratory, July 1991.]]
[40]
P. Wadler. The marriage of effects and monads. In International Conference on Functional Programming, ICFP'98, pages 63--74, Baltimore, Maryland, 1998.]]
[41]
K. Watkins, I. Cervesato, F. Pfenning, and D. Walker. A concurrent logical framework: The propositional fragment. In S. Berardi, M. Coppo, and F. Damiani, editors, Types for Proofs and Programs, volume 3085 of Lecture Notes in Computer Science, pages 355--377. Springer, 2004.]]
[42]
H. Xi. Applied Type System (extended abstract). In TYPES'03, pages 394--408. Springer-Verlag LNCS 3085, 2004.]]
[43]
H. Xi, C. Chen, and G. Chen. Guarded recursive datatype constructors. In Symposium on Principles of Programming Languages, POPL'03, pages 224--235, New Orleans, January 2003.]]
[44]
D. Zhu and H. Xi. Safe programming with pointers through stateful views. In Practical Aspects of Declarative Languages, PADL'05, volume 3350 of Lecture Notes in Computer Science, pages 83--97, Long Beach, California, January 2005. Springer.]]

Cited By

View all
  • (2023)Temporal Verification with Answer-Effect Modification: Dependent Temporal Type-and-Effect System with Delimited ContinuationsProceedings of the ACM on Programming Languages10.1145/35712647:POPL(2079-2110)Online publication date: 11-Jan-2023
  • (2022)Taming transitive redundancy for context-free language reachabilityProceedings of the ACM on Programming Languages10.1145/35633436:OOPSLA2(1556-1582)Online publication date: 31-Oct-2022
  • (2022)A concurrent program logic with a future and historyProceedings of the ACM on Programming Languages10.1145/35633376:OOPSLA2(1378-1407)Online publication date: 31-Oct-2022
  • Show More Cited By

Index Terms

  1. Polymorphism and separation in hoare type theory

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      ICFP '06: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming
      September 2006
      308 pages
      ISBN:1595933093
      DOI:10.1145/1159803
      • General Chair:
      • John Reppy,
      • Program Chair:
      • Julia Lawall
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 41, Issue 9
        Proceedings of the 2006 ICFP conference
        September 2006
        296 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1160074
        Issue’s Table of Contents
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 16 September 2006

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. hoare logic
      2. separation logic
      3. type theory

      Qualifiers

      • Article

      Conference

      ICFP06
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 333 of 1,064 submissions, 31%

      Upcoming Conference

      ICFP '25
      ACM SIGPLAN International Conference on Functional Programming
      October 12 - 18, 2025
      Singapore , Singapore

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)27
      • Downloads (Last 6 weeks)1
      Reflects downloads up to 17 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)Temporal Verification with Answer-Effect Modification: Dependent Temporal Type-and-Effect System with Delimited ContinuationsProceedings of the ACM on Programming Languages10.1145/35712647:POPL(2079-2110)Online publication date: 11-Jan-2023
      • (2022)Taming transitive redundancy for context-free language reachabilityProceedings of the ACM on Programming Languages10.1145/35633436:OOPSLA2(1556-1582)Online publication date: 31-Oct-2022
      • (2022)A concurrent program logic with a future and historyProceedings of the ACM on Programming Languages10.1145/35633376:OOPSLA2(1378-1407)Online publication date: 31-Oct-2022
      • (2022)UniRec: a unimodular-like framework for nested recursions and loopsProceedings of the ACM on Programming Languages10.1145/35633336:OOPSLA2(1264-1290)Online publication date: 31-Oct-2022
      • (2022)Coeffects for sharing and mutationProceedings of the ACM on Programming Languages10.1145/35633196:OOPSLA2(870-898)Online publication date: 31-Oct-2022
      • (2022)Specification-guided component-based synthesis from effectful librariesProceedings of the ACM on Programming Languages10.1145/35633106:OOPSLA2(616-645)Online publication date: 31-Oct-2022
      • (2022)Concurrent sizeProceedings of the ACM on Programming Languages10.1145/35633006:OOPSLA2(345-372)Online publication date: 31-Oct-2022
      • (2022)How to safely use extensionality in Liquid HaskellProceedings of the 15th ACM SIGPLAN International Haskell Symposium10.1145/3546189.3549919(13-26)Online publication date: 6-Sep-2022
      • (2022)Dependently-typed data plane programmingProceedings of the ACM on Programming Languages10.1145/34987016:POPL(1-28)Online publication date: 12-Jan-2022
      • (2021)On algebraic abstractions for concurrent separation logicsProceedings of the ACM on Programming Languages10.1145/34342865:POPL(1-32)Online publication date: 4-Jan-2021
      • Show More Cited By

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media