## Local state in hoare logic for imperative higher-order functions (2007)

Venue: | in Appendix A.1. [A [Abs] -x ∧C]M :m [C ′ ] [A]λx.M :u [∀x.[C] u • x = m [C ′ ]] [Deref ] − [C[!x/u]]!x :u [C] [App] [C]M :m [C0] [C0]N :n [C1 ∧ [C1] m • n = u [C ′ ]] [C]MN :u [C ′ ] [Assign] [C]M :m [C ′ [m/!x][()/u]] [C]x := M :u [C ′ ] [Conseq-Kleyman |

Citations: | 3 - 1 self |

### BibTeX

@INPROCEEDINGS{Yoshida07localstate,

author = {Nobuko Yoshida and Kohei Honda and Martin Berger},

title = {Local state in hoare logic for imperative higher-order functions},

booktitle = {in Appendix A.1. [A [Abs] -x ∧C]M :m [C ′ ] [A]λx.M :u [∀x.[C] u • x = m [C ′ ]] [Deref ] − [C[!x/u]]!x :u [C] [App] [C]M :m [C0] [C0]N :n [C1 ∧ [C1] m • n = u [C ′ ]] [C]MN :u [C ′ ] [Assign] [C]M :m [C ′ [m/!x][()/u]] [C]x := M :u [C ′ ] [Conseq-Kleyman},

year = {2007},

publisher = {Spring}

}

### OpenURL

### Abstract

Abstract. We introduce an extension of Hoare logic for imperative higher-order functions with local state. Local state may be generated dynamically and exported outside its scope, may store higher-order functions, and may be used to construct complex shared mutable data structures. The induced behaviour is captured with a first order predicate which asserts reachability of reference names. The logic enjoys a strong match with the semantics of programs, in the sense that valid assertions characterise the standard contextual congruence. We explore the logic’s descriptive and reasoning power with nontrivial programming examples manipulating dynamically generated local state. Axioms for reachability play a central role for reasoning about the examples.