Hiding Local State in Direct Style: A Higher-Order Anti-Frame Rule

Separation logic involves two dual forms of modularity: local reasoning makes part of the store invisible within a static scope, whereas hiding local state makes part of the store invisible outside a static scope. In the recent literature, both idioms are explained in terms of a higher-order frame rule. I point out that this approach to hiding local state imposes continuation-passing style, which is impractical. Instead, I introduce a higher-order anti-frame rule, which permits hiding local state in direct style. I formalize this rule in the setting of a type system, equipped with linear capabilities, for an ML-like programming language, and prove type soundness via a syntactic argument. Several applications illustrate the expressive power of the new rule.

[1]  Sylvain Lebresne,et al.  A System F with Call-by-Name Exceptions , 2008, ICALP.

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

[3]  Peter W. O'Hearn,et al.  Resources, concurrency, and local reasoning , 2007 .

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

[5]  Gavin M. Bierman,et al.  Separation logic and abstraction , 2005, POPL '05.

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

[7]  Peter W. O'Hearn,et al.  Strong Update, Disposal, and Encapsulation in Bunched Typing , 2006, MFPS.

[8]  Frank Pfenning,et al.  Intersection types and computational effects , 2000, ICFP '00.

[9]  Arthur Charguéraud,et al.  Functional translation of a calculus of capabilities , 2008, ICFP 2008.

[10]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

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

[12]  Hayo Thielecke Frame rules from answer types for code pointers , 2006, POPL '06.

[13]  Robert DeLine,et al.  Adoption and focus: practical linear types for imperative programming , 2002, PLDI '02.

[14]  David Walker,et al.  Alias Types , 2000, ESOP.

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