Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
432319 | The Journal of Logic and Algebraic Programming | 2008 | 15 Pages |
Abstract
We explore the power of relational semantics and equational reasoning in the style of Kleene algebra for analyzing programs with mutable, statically scoped local variables. We provide (i) a fully compositional relational semantics for a first-order programming language with constructs for local variable declaration and destructive update; and (ii) an equational proof system based on Kleene algebra with tests for proving the equivalence of programs in this language. We show that the proof system is sound and complete relative to the underlying equational theory without local variables. We illustrate the use of the system with several examples.
Related Topics
Physical Sciences and Engineering
Computer Science
Computational Theory and Mathematics