Logical Reasoning for Higher-Order Functions with Local State

We introduce an extension of Hoare logic for call-by-value higher-order functions with ML-like local reference generation. Local references may be generated dynamically and exported outside their scope, may store higher-order functions and may be used to construct complex mutable data structures. This primitive is captured logically using a predicate asserting reachability of a reference name from a possibly higher-order datum and quantifiers over hidden references. We explore the logic's descriptive and reasoning power with non-trivial programming examples combining higher-order procedures and dynamically generated local state. Axioms for reachability and local invariant play a central role for reasoning about the examples.

[1]  Antoine Meyer,et al.  A logic of reachable patterns in linked data-structures , 2006, J. Log. Algebraic Methods Program..

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

[3]  Martín Abadi,et al.  A Logic of Object-Oriented Programs , 1997, Verification: Theory and Practice.

[4]  Luca Cardelli,et al.  A Spatial Logic for Concurrency , 2001, TACS.

[5]  Donald Sannella,et al.  Program specification and development in standard ML , 1985, POPL.

[6]  John Longley,et al.  Reasoning About CBV Functional Programs in Isabelle/HOL , 2004, TPHOLs.

[7]  Zhong Shao,et al.  Certified assembly programming with embedded code pointers , 2006, POPL '06.

[8]  P. J. Landin,et al.  A correspondence between ALGOL 60 and Church's Lambda-notations: Part II , 1965, CACM.

[9]  Robert W. Floyd,et al.  Assigning meaning to programs , 1967 .

[10]  Jerzy Tiuryn,et al.  Dynamic logic , 2001, SIGA.

[11]  C. A. R. Hoare,et al.  Proof of correctness of data representations , 1972, Acta Informatica.

[12]  Shuvendu K. Lahiri,et al.  Verifying properties of well-founded linked lists , 2006, POPL '06.

[13]  Andrew M. Pitts,et al.  A First Order Theory of Names and Binding , 2001 .

[14]  Luca Cardelli,et al.  A spatial logic for concurrency (part I) , 2003, Inf. Comput..

[15]  Benjamin C. Pierce,et al.  A bisimulation for dynamic sealing , 2004, Theor. Comput. Sci..

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

[17]  Jan Schwinghammer,et al.  Separation Logic for Higher-Order Store , 2006, CSL.

[18]  Till Mossakowski,et al.  A generic complete dynamic logic for reasoning about purity and effects , 2010, Formal Aspects of Computing.

[19]  Thomas Streicher,et al.  About Hoare Logics for Higher-Order Store , 2005, ICALP.

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

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

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

[23]  Ian David Bede Stark,et al.  Names and higher-order functions , 1994 .

[24]  David A. Naumann,et al.  Observational purity and encapsulation , 2005, Theor. Comput. Sci..

[25]  Robin Milner,et al.  An Algebraic Definition of Simulation Between Programs , 1971, IJCAI.

[26]  Robin Milner,et al.  Definition of standard ML , 1990 .

[27]  Kohei Honda,et al.  Elementary structures in process theory (1): Sets with renaming , 2000, Mathematical Structures in Computer Science.

[28]  Richard Bornat,et al.  Local reasoning, separation and aliasing , 2003 .

[29]  Andrew M. Pitts,et al.  Nominal Logic: A First Order Theory of Names and Binding , 2001, TACS.

[30]  David Harel,et al.  Proving the Correctness of Regular Deterministic Programs: A Unifying Survey Using Dynamic Logic , 1980, Theor. Comput. Sci..

[31]  Carolyn L. Talcott,et al.  Inferring the Equivalence of Functional Programs That Mutate Data , 1992, Theor. Comput. Sci..

[32]  Carolyn L. Talcott,et al.  References, local variables and operational reasoning , 1992, [1992] Proceedings of the Seventh Annual IEEE Symposium on Logic in Computer Science.

[33]  Lars Birkedal,et al.  BI Hyperdoctrines and Higher-Order Separation Logic , 2005, ESOP.

[34]  Samson Abramsky,et al.  A fully abstract game semantics for general references , 1998, Proceedings. Thirteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.98CB36226).

[35]  ScienceYale UniversityNew Haven An Overview of the Flint/ml Compiler , 1997 .

[36]  Hans Hermes,et al.  Introduction to mathematical logic , 1973, Universitext.

[37]  Till Mossakowski,et al.  A Generic Complete Dynamic Logic for Reasoning About Purity and Effects , 2008, FASE.

[38]  Mitchell Wand,et al.  Small bisimulations for reasoning about higher-order imperative programs , 2006, POPL '06.

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

[40]  Tobias Nipkow,et al.  Proving Pointer Programs in Higher-Order Logic , 2003, CADE.

[41]  Albert R. Meyer,et al.  Towards fully abstract semantics for local variables , 1988, POPL '88.

[42]  Eugenio Moggi A Semantics for Evaluation Logic , 1995, Fundam. Informaticae.

[43]  Lars Birkedal,et al.  Abstract Predicates and Mutable ADTs in Hoare Type Theory , 2007, ESOP.

[44]  Andrew M. Pitts Reasoning about local variables with operationally-based logical relations , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[45]  Albert L. Baker,et al.  Enhancing the Pre- and Postcondition Technique for More Expressive Specifications , 1999, World Congress on Formal Methods.

[46]  Hongseok Yang,et al.  Semantics of Separation-Logic Typing and Higher-Order Frame Rules , 2005, LICS.

[47]  Hongseok Yang,et al.  Semantics of separation-logic typing and higher-order frame rules , 2005, 20th Annual IEEE Symposium on Logic in Computer Science (LICS' 05).

[48]  Carolyn L. Talcott,et al.  A Variable Typed Logic of Effects , 1995, Inf. Comput..

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

[50]  Jeannette M. Wing,et al.  Thoughts on a Larch/ML and a New Application for LP , 1992, Larch.

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

[52]  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).

[53]  J. LandinP. Correspondence between ALGOL 60 and Church's Lambda-notation , 1965 .

[54]  Eugenio Moggi,et al.  A general semantics for Evaluation Logic , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[55]  Greg Nelson,et al.  Verifying reachability invariants of linked structures , 1983, POPL '83.

[56]  Jean-Christophe Filliâtre,et al.  Verification of non-functional programs using interpretations in type theory , 2003, J. Funct. Program..

[57]  Luca Cardelli,et al.  Comparing Object Encodings , 1997, Inf. Comput..

[58]  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.

[59]  Dale Miller,et al.  A proof theory for generic judgments , 2005, TOCL.

[60]  Andrew M. Pitts,et al.  A New Approach to Abstract Syntax with Variable Binding , 2002, Formal Aspects of Computing.

[61]  John C. Reynolds,et al.  Idealized ALGOL and its specification logic , 1997 .

[62]  Andrew M. Pitts,et al.  A new approach to abstract syntax involving binders , 1999, Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158).

[63]  Tomasz Kowaltowski Axiomatic approach to side effects and general jumps , 2004, Acta Informatica.

[64]  Kohei Honda,et al.  Processes and Games , 2004, Electron. Notes Theor. Comput. Sci..

[65]  Hendrik Pieter Barendregt,et al.  Introduction to generalized type systems , 1991, Journal of Functional Programming.

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

[67]  Benjamin C. Pierce,et al.  Simple type-theoretic foundations for object-oriented programming , 1994, Journal of Functional Programming.

[68]  Robert D. Tennent,et al.  Semantics of programming languages , 1991, Prentice Hall International Series in Computer Science.

[69]  David von Oheimb Hoare logic for Java in Isabelle/HOL , 2001, Concurr. Comput. Pract. Exp..

[70]  John C. Reynolds,et al.  Separation Logic for a Higher-Order Typed Language , 2005 .