A logical analysis of aliasing in imperative higher-order functions

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.

[1]  Kohei Honda,et al.  From process logic to program logic , 2004, ICFP '04.

[2]  Joseph Y. Halpern,et al.  From Denotational to Operational and Axiomatic Semantics for ALGOL-like Languages: an Overview , 1983, Logic of Programs.

[3]  Joseph M. Morris Assignment and Linked Data Structures , 1982 .

[4]  K. Rustan M. Leino,et al.  Data abstraction and information hiding , 2002, TOPL.

[5]  Peter van Emde Boas,et al.  On the Proper Treatment or Referencing, Dereferencing and Assignment , 1977, ICALP.

[6]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[7]  Carolyn L. Talcott,et al.  1 Equivalence in Functional Languages with E ectsIan , 2007 .

[8]  John C. Reynolds,et al.  Separation logic: a logic for shared mutable data structures , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[9]  Robert Cartwright,et al.  Unrestricted procedure calls in Hoare's logic , 1978, POPL '78.

[10]  Herbert B. Enderton,et al.  A mathematical introduction to logic , 1972 .

[11]  Nobuko Yoshida,et al.  A logical analysis of aliasing in imperative higher-order functions , 2005, ICFP '05.

[12]  Gary T. Leavens,et al.  Modular specification of frame properties in JML , 2003, Concurr. Comput. Pract. Exp..

[13]  Karl Crary,et al.  From system F to typed assembly language , 1999 .

[14]  Nobuko Yoshida,et al.  Descriptive and Relative Completeness of Logics for Higher-Order Functions , 2006, ICALP.

[15]  Robin Milner,et al.  Algebraic laws for nondeterminism and concurrency , 1985, JACM.

[16]  Nobuko Yoshida,et al.  Logical Reasoning for Higher-Order Functions with Local State , 2007, Log. Methods Comput. Sci..

[17]  Carl A. Gunter Semantics of programming languages: structures and techniques , 1993, Choice Reviews Online.

[18]  Joseph M. Morris A General Axiom of Assignment , 1982 .

[19]  Nobuko Yoshida,et al.  A compositional logic for polymorphic higher-order functions , 2004, PPDP '04.

[20]  J. Gregory Morrisett,et al.  L3: A Linear Language with Locations , 2007, Fundam. Informaticae.

[21]  John McCarthy,et al.  Towards a Mathematical Science of Computation , 1962, IFIP Congress.

[22]  Robin Milner,et al.  A Calculus of Mobile Processes, II , 1992, Inf. Comput..

[23]  I. Stark,et al.  Operational reasoning for functions with local state , 1999 .

[24]  Peter W. O'Hearn,et al.  Separation and information hiding , 2004, POPL.

[25]  James Cheney,et al.  Region-based memory management in cyclone , 2002, PLDI '02.

[26]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[27]  Brian W. Kernighan,et al.  The C Programming Language , 1978 .

[28]  Joseph M. Morris A Proof of the Schorr-Waite Algorithm , 1982 .

[29]  Robert Cartwright,et al.  The logic of aliasing , 1981, Acta Informatica.

[30]  David Gries,et al.  Assignment and Procedure Call Proof Rules , 1980, TOPL.

[31]  Jeannette M. Wing Writing Larch interface language specifications , 1987, TOPL.

[32]  Elliott Mendelson,et al.  Introduction to mathematical logic (3. ed.) , 1987 .

[33]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[34]  Lars Birkedal,et al.  Polymorphism and separation in hoare type theory , 2006, ICFP '06.

[35]  Albert R. Meyer,et al.  Specifying the Semantics of while Programs: A Tutorial and Critique of a Paper by Hoare and Lauer , 1981, TOPL.

[36]  Gregory Kulczycki,et al.  Reasoning about Procedure Calls with Repeated Arguments and the Reference-Value Distinction , 2003 .

[37]  Simon L. Peyton Jones,et al.  C--: A Portable Assembly Language that Supports Garbage Collection , 1999, PPDP.

[38]  Richard Bornat,et al.  Proving Pointer Programs in Hoare Logic , 2000, MPC.

[39]  Nobuko Yoshida,et al.  An observationally complete program logic for imperative higher-order functions , 2005, 20th Annual IEEE Symposium on Logic in Computer Science (LICS' 05).

[40]  David C. Luckham,et al.  Verification of Array, Record, and Pointer Operations in Pascal , 1979, TOPL.

[41]  Krzysztof R. Apt,et al.  Ten Years of Hoare's Logic: A Survey—Part I , 1981, TOPL.