Specification and verification of closures

Ioannis T. Kassios, Péter Müller · Repository for Publications and Research Data (ETH Zurich) · 2010

Closures, first-class citizen procedures that are able to capture their lexical environment, increase the expressiveness of objectoriented languages such as C#, Scala, and various dynamic languages. However, closures make program specification and verification more difficult. For instance, a verification methodology must allow specifications to describe the behavior of one method relatively to the specification of another method passed as argument, and it must allow specifications to describe the behavior of a closure without exposing its captured state. This paper presents a modular specification and partial correctness verification methodology for closures. Our solution is based on first-order logic and, thus, well suited for automatic verification with SMT solvers. We present an encoding of our methodology in the Boogie program verifier. Using this encoding, we have verified a series of interesting examples that cover the main applications of closures such as delegation patterns and even the creation of custom control flow.

Read the paper · More papers on PaperTik