A Language-Independent Proof System for Mutual Program Equivalence

Two programs are mutually equivalent if they both diverge or they both terminate with the same result. In this paper we introduce a language-independent proof system for mutual equivalence, which is parametric in the operational semantics of two languages and in a state-similarity relation. We illustrate it on two programs in two different languages (an imperative one and a functional one), that both compute the Collatz sequence.

[1]  Moshe Y. Vardi,et al.  Formal Verification of Backward Compatibility of Microcode , 2005, CAV.

[2]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

[3]  Friederike Nickl,et al.  Pushouts of Order-Sorted Algebraic Specifications , 1996, AMAST.

[4]  Shuvendu K. Lahiri,et al.  SYMDIFF: A Language-Agnostic Semantic Diff Tool for Imperative Programs , 2012, CAV.

[5]  Ofer Strichman,et al.  Regression Verification: Proving the Equivalence of Similar Programs , 2009, CAV.

[6]  Chucky Ellison,et al.  Matching Logic: An Alternative to Hoare/Floyd Logic , 2010, AMAST.

[7]  Sorin Craciunescu,et al.  Recurrence with affine level mappings is P-time decidable for binary CLP ( R ) Technical note , 2006 .

[8]  Xavier Leroy,et al.  Formal verification of a realistic compiler , 2009, CACM.

[9]  Sagar Chaki,et al.  Regression verification for multi-threaded programs (with extensions to locks and dynamic thread creation) , 2012, Formal Methods in System Design.

[10]  Dorel Lucanu,et al.  Program equivalence by circular reasoning , 2013, Formal Aspects of Computing.

[11]  Andrew M. Pitts,et al.  Operational Semantics and Program Equivalence , 2000, APPSEM.

[12]  Grigore Rosu,et al.  A language-independent proof system for full program equivalence , 2016, Formal Aspects of Computing.

[13]  Sorin Lerner,et al.  Proving optimizations correct using parameterized program equivalence , 2009, PLDI '09.

[14]  Grigore Rosu,et al.  Checking reachability using matching logic , 2012, OOPSLA '12.

[15]  George C. Necula,et al.  Translation validation for an optimizing compiler , 2000, PLDI '00.

[16]  R. Diaconescu Institution-independent model theory , 2008 .

[17]  Hartmut Ehrig,et al.  Fundamentals of Algebraic Specification 1: Equations and Initial Semantics , 1985 .