Shallow Expressions

Simon Foster 📧

May 16, 2025

Abstract

Most verification techniques use expressions, for example when assigning to variables or forming assertions over the state. Deep embeddings provide such expressions using a datatype, which allows queries over the syntax, such as calculating the free variables, and performing substitutions. Shallow embeddings, in contrast, model expressions as query functions over the state type, and are more amenable to automating verification tasks. The goal of this library is provide an intuitive implementation of shallow expressions, which nevertheless provides many of the benefits of a deep embedding. We harness the Optics library to provide an algebraic semantics for state variables, and use syntax translations to provide an intuitive lifted expression syntax. Furthermore, we provide a variety of meta-logic-style queries on expressions, such as dependencies on a state variable, and substitution of a variable for an expression. We also provide proof methods, based on the simplifier, to automate the associated proof tasks.

License

BSD License

Topics

Related publications

  • Huerta y Munive, J. J., Foster, S., Gleirscher, M., Struth, G., Pardillo Laursen, C., & Hickman, T. (2024). IsaVODEs: Interactive Verification of Cyber-Physical Systems at Scale. Journal of Automated Reasoning, 68(4). https://doi.org/10.1007/s10817-024-09709-2
  • Foster, S., Baxter, J., Cavalcanti, A., Woodcock, J., & Zeyda, F. (2020). Unifying semantic foundations for automated verification tools in Isabelle/UTP. Science of Computer Programming, 197, 102510. https://doi.org/10.1016/j.scico.2020.102510

Session Shallow_Expressions

Depends on