Automated Algebraic Reasoning for Collections and Local Variables with Lenses [chapter]

Simon Foster, James Baxter
2020 Lecture Notes in Computer Science  
Lenses are a useful algebraic structure for giving a unifying semantics to program variables in a variety of store models. They support efficient automated proof in the Isabelle/UTP verification framework. In this paper, we expand our lens library with (1) dynamic lenses, that support mutable indexed collections, such as arrays, and (2) symmetric lenses, which allow partitioning of a state space into disjoint local and global regions to support variable scopes. From this basis, we provide an
more » ... iched program model in Isabelle/UTP for collection variables and variable blocks. For the latter, we adopt an approach first used by Back and von Wright, and derive weakest precondition and Hoare calculi. We demonstrate several examples, including verification of insertion sort.
doi:10.1007/978-3-030-43520-2_7 fatcat:fa6r2gjjofa4zkiz4sfvcjexya