Operationally-based Program Equivalence Proofs using LCTRSs

01/27/2020
by   Ştefan Ciobâcă, et al.
0

We propose an operationally-based deductive proof method for program equivalence. It is based on encoding the language semantics as logically constrained term rewriting systems (LCTRSs) and the two programs as terms. The main feature of our method is its flexibility. We illustrate this flexibility in two applications, which are novel. For the first application, we show how to encode low-level details such as stack size in the language semantics and how to prove equivalence between two programs operating at different levels of abstraction. For our running example, we show how our method can prove equivalence between a recursive function operating with an unbounded stack and its tail-recursive optimized version operating with a bounded stack. This type of equivalence checking can be used to ensure that new, undesirable behavior is not introduced by a more concrete level of abstraction. For the second application, we show how to formalize read-sets and write-sets of symbolic expressions and statements by extending the operational semantics in a conservative way. This enables the relational verification of program schemas, which we exploit to prove correctness of compiler optimizations, some of which cannot be proven by existing tools. Our method requires an extension of standard LCTRSs with axiomatized symbols. We also present a prototype implementation that proves the feasibility of both applications that we propose.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/23/2023

A Frame Stack Semantics for Sequential Core Erlang

We present a small-step, frame stack style, semantics for sequential Cor...
research
10/21/2021

Certifying C program correctness with respect to CompCert with VeriFast

VeriFast is a powerful tool for verification of various correctness prop...
research
01/27/2023

Stack-Aware Hyperproperties

A hyperproperty relates executions of a program and is used to formalize...
research
02/19/2021

Tail Modulo Cons

OCaml function calls consume space on the system stack. Operating system...
research
02/22/2019

On Transforming Functions Accessing Global Variables into Logically Constrained Term Rewriting Systems

In this paper, we show a new approach to transformations of an imperativ...
research
09/22/2021

Self-Supervised Learning to Prove Equivalence Between Programs via Semantics-Preserving Rewrite Rules

We target the problem of synthesizing proofs of semantic equivalence bet...
research
01/26/2018

Relational Equivalence Proofs Between Imperative and MapReduce Algorithms

MapReduce frameworks are widely used for the implementation of distribut...

Please sign up or login with your details

Forgot password? Click here to reset