Hostname: page-component-76fb5796d-x4r87 Total loading time: 0 Render date: 2024-04-27T02:04:38.948Z Has data issue: false hasContentIssue false

A logical analysis of aliasing in imperative higher-order functions

Published online by Cambridge University Press:  01 July 2007

MARTIN BERGER
Affiliation:
Department of Computing, Imperial College London, London, England
KOHEI HONDA
Affiliation:
Department of Computer Science, Queen Mary, University of London, London, England
NOBUKO YOSHIDA
Affiliation:
Department of Computing, Imperial College London, London, England
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

We present a compositional programme logic for call-by-value imperative higher-order functions with general forms of aliasing, which can arise from the use of reference names as function parameters, return values, content of references and parts of data structures. The programme logic extends our earlier logic for alias-free imperative higher-order functions with new operators which serve as building blocks for clean structural reasoning about programms and data structures in the presence of aliasing. This has been an open issue since the pioneering work by Cartwright–Oppen and Morris twenty-five years ago. We illustrate usage of the logic for description and reasoning through concrete examples including a higher-order polymorphic Quicksort. The logical status of the new operators is clarified by translating them into (in)equalities of reference names.

Type
Article
Copyright
Copyright © Cambridge University Press 2007

References

Ahmed, A., Morrisett, G. & Fluet, M. (2005) L3: A linear language with locations. In Proceedings of TLCA'05. LNCS, vol. 3461, pp. 293307.Google Scholar
Apt, K. R. (1981). Ten years of Hoare logic: a survey. TOPLAS, 3, 431483.CrossRefGoogle Scholar
Berger, M., Honda, K. & Yoshida, N. (2005). A logical analysis of aliasing in imperative higher-order functions. In Proceedings of ICFP'05, pp. 280–293.CrossRefGoogle Scholar
Bornat, R. (2000). Proving Pointer Programmes in Hoare Logic. In Proceedings of Mathematics of Programme Construction. LNCS, vol. 1837. Springer-Verlag, pp. 102106.CrossRefGoogle Scholar
Cartwright, R. & Oppen, D. C. (1978). Unrestricted procedure calls in Hoare's logic. Proceedings of POPL, pp. 131–140.Google Scholar
Cartwright, R. & Oppen, D. C. (1981). The logic of aliasing. Acta Inf., 15, 365384.CrossRefGoogle Scholar
Cousot, P. (1999). Methods and logics for proving programmes. Handbook of Theoretical Computer Science, vol. B, pp. 243993.Google Scholar
Enderton, H. B. (2001). A Mathematical Introduction to Logic. Academic Press.Google Scholar
Filliâtre, J.-C. & Magaud, N. (1999). Certification of sorting algorithms in the system Coq. Proceedings of Theorem Proving in Higher Order Logics.Google Scholar
Floyd, R. W. (1967). Assigning meaning to programmes. In Proceedings of Symp. in Applied Mathematics, vol. 19, pp. 1931.CrossRefGoogle Scholar
Greif, I. & Meyer, A. R. (1981). Specifying the semantics of while programmes: A tutorial and critique of a paper by Hoare and Lauer. ACM Trans. Programme. Lang. Syst. 3 (4), 484507.CrossRefGoogle Scholar
Gries, D. & Levin, G. (1980). Assignment and procedure call proof rules. ACM Trans. Programme. Lang. Syst. 2 (4), 564579.CrossRefGoogle Scholar
Grossman, D., Morrisett, G., Jim, T., Hicks, M., Wang, Y. & Cheney, J. (2002). Region-based memory management in cyclone. In Proceedings of PLDI'02 pp. 282–293.CrossRefGoogle Scholar
Gunter, C. A. (1995). Semantics of Programming Languages. MIT Press.Google Scholar
Hamid, N. A. & Shao, Z. (2004, September). Interfacing Hoare Logic and Type Systems for Foundational Proof-Carrying Code. In Proceedings of TPHOL'04. LNCS, vol. 3223, pp. 118135.Google Scholar
Hennessy, M. & Milner, R. (1985). Algebraic laws for non-determinism and concurrency. JACM, 32 (1), 137–61.CrossRefGoogle Scholar
Hoare, T. (1969). An axiomatic basis of computer crogramming. CACM, 12, 576580.CrossRefGoogle Scholar
Hoare, T. & Jifeng, H. (1998). Unifying Theories of Programming. Prentice-Hall International.Google Scholar
Honda, K. (2004). From process logic to programme logic. In Proceedings of ICFP'04. ACM Press, pp. 163–174. A long version available from www.dcs.qmul.ac.uk/~kohei/logics.Google Scholar
Honda, K. & Yoshida, N. (2004). A compositional logic for polymorphic higher-order functions. In Proceedings of PPDP'04.CrossRefGoogle Scholar
Honda, K, Yoshida, N. & Berger, M. (2005). An observationally complete programme logic for imperative higher-order functions. In Proceedings of LICS'05, pp. 270–279. Full version available from: www.dcs.qmul.ac.uk/~kohei/logics.Google Scholar
Honda, K.Berger, M. & Yoshida, N. (2006). Descriptive and relative completeness of logics for higher-order functions. Proceedings of ICALP'06, pp. 360-371.CrossRefGoogle Scholar
Janssen, T. M. V. & van Emde Boas, Peter. (1977). On the proper treatment of referencing, dereferencing and assignment. Proceedings of ICALP'77, pp. 282–300.CrossRefGoogle Scholar
Kernighan, B. W., & Ritchie, D. M. (1988). The C Programming Language, 2nd ed. Englewood Cliffs, NJ: Prentice-Hall.Google Scholar
Kulczycki, G. W., Sitaraman, M., Ogden, W. F., & Leavens, G. T. (2003). Reasoning about procedure calls with repeated arguments and the reference-value distinction. Tech. rept. TR ♯02-13a. Dept. of Comp. Sci., Iowa State Univ.Google Scholar
Leino, K., Rustan, M. & Nelson, G. (2002). Data abstraction and information hiding. ACM Trans. Programme. Lang. Syst., 24 (5), 491553.CrossRefGoogle Scholar
Luckham, D. C. & Suzuki, N. (1979). Verification of array, record, and pointer operations in Pascal. ACM Trans. Programme. Lang. Syst. 1 (2), 226244.CrossRefGoogle Scholar
Mason, I. & Talcott, C. (1991). Equivalence in functional languages with effects. JFP, 1 (3), 287327.Google Scholar
McCarthy, J. L. (1962). Towards a mathematical science of computation. Proceedings of IFIP Congress, pp. 21–28.Google Scholar
Mendelson, E. (1987). Introduction to Mathematical Logic. Wadsworth Inc.CrossRefGoogle Scholar
Milner, R. (1978). A theory of type polymorphism in programming. J. Comp. Syst. Sci., 17, 348375.CrossRefGoogle Scholar
Milner, R.Parrow, J. & Walker, D. (1992). A calculus of mobile processes, Parts I and II. Info. & Comp., 100 (1), 177.CrossRefGoogle Scholar
Morris, J. M. (1982a). A general axiom of assignment. Pages 25–34 of: Bauer, Friedrich L., Dijkstra, Edsger W., and Hoare, Tony, editors. Theoretical Foundations of Programming Methodology, Lecture Notes of an International Summer School. Reidel, 1982.Google Scholar
Morris, J. M. (1982b). A general axiom of assignment/assignment and linked data structures/a proof of the Schorr–Waite algorithm. Pages 25–52 of: Friedrich, L. Bauer, Dijkstra, Edsger W., and Hoare, Tony, editors. Theoretical Foundations of Programming Methodology, Lecture Notes of an International Summer School. Reidel, 1982.Google Scholar
Morris, J. M. (1982c). A proof of the Schorr–Waite algorithm. Pages 44–52 of: Bauer, Friedrich L., Dijkstra, Edsger W., and Hoare, Tony, editors. Theoretical Foundations of Programming Methodology, Lecture Notes of an International Summer School. Reidel, 1982.Google Scholar
Morris, J. M. (1982d). Assignment and linked data structures. Pages 35–43 of: Bauer, Friedrich L., Dijkstra, Edsger W., and Hoare, Tony, editors. Theoretical Foundations of Programming Methodology, Lecture Notes of an International Summer School. Reidel, 1982.Google Scholar
Morrisett, G., Walker, D., Crary, K. & Glew, N. (1999). From system F to typed assembly language. ACM Trans. Programme. Lang. Syst. 21 (3), 527568.CrossRefGoogle Scholar
Müller, P., Poetzsch-Heffter, A. & Leavens, G. T. (2003). Modular specification of frame properties in JML. Concurr. Comput. Pract. Exp. 15, 117154.CrossRefGoogle Scholar
Nanevski, A., Morrisett, G. & Birkedal, L. (2006). Polymorphism and separation in Hoare type theory. ICFP06. ACM Press, pp. 6273.CrossRefGoogle Scholar
O'Hearn, P., Yang, H. & Reynolds, J. C. (2004). Separation and information hiding. Proceedings of POPL'04, pp. 268–280.Google Scholar
Peyton Jones, S., Ramsey, N. & Reig, F. (1999). C-: a Portable Assembly Language that supports garbage collection. Proceedings of PPDP, pp. 1–28.CrossRefGoogle Scholar
Pierce, B. C. (2002). Type Systems and Programming Languages. MIT Press.Google Scholar
Pitts, A. M., & Stark, I. D. B. (1998). Operational Reasoning for Functions with Local State. Pages 227–273 of: HOOTS'98.Google Scholar
Reynolds, J. C. (2002). Separation logic: a logic for shared mutable data structures. Proceedings of LICS'02.CrossRefGoogle Scholar
Shao, Z. (1997). An Overview of the FLINT/ML Compiler. Proceedings of Workshop on Types in Compilation (TIC'97).Google Scholar
Trakhtenbrot, B., Halpern, J. & Meyer, A. (1984). From Denotational to Operational and Axiomatic Semantics for ALGOL-like Languages: an Overview. Pages 474–500 of: Proceedings of CMU Workshop on Logic of Programmes LNCS, vol. 164.Google Scholar
Wing, J. M. (1987). Writing Larch interface language specifications. ACM Trans. Programme. Lang. Syst. 9 (1), 124.CrossRefGoogle Scholar
Yoshida, N.Honda, K. & Berger, M. (2007). Logical reasoning for higher-order functions with local state. Pages 361–377 of: Proceedings of Fossac, LNCS vol. 4423.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.