Automated Theorem Prover Assisted Program Calculations

Calculational Style of Programming, while very appealing, has several practical difficulties when done manually. Due to the large number of proofs involved, the derivations can be cumbersome and errorprone. To address these issues, we have developed automated theorem provers assisted program and formula transformation rules, which when coupled with the ability to extract context of a subformula, help in shortening and simplifying the derivations. We have implemented this approach in a Calculational Assistant for Programming from Specifications (CAPS). With the help of simple examples, we show how the calculational assistant helps in taking the drudgery out of the derivation process while ensuring correctness.

[1]  Jim Grundy A method of program refinement , 1993 .

[2]  Jim Grundy,et al.  A Window Inference Tool for Refinement , 1992, Refine.

[3]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[4]  K. Rustan M. Leino,et al.  Verified Calculations , 2013, VSTTE.

[5]  Andrei Voronkov,et al.  Automated Deduction—CADE-18 , 2002, Lecture Notes in Computer Science.

[6]  Carroll Morgan,et al.  Programming from specifications , 1990, Prentice Hall International Series in computer science.

[7]  Rajeev Alur,et al.  A Temporal Logic of Nested Calls and Returns , 2004, TACAS.

[8]  Jim Welsh,et al.  A tool for developing correct programs by refinement , 1996 .

[9]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[10]  Sumit Gulwani,et al.  Synthesis of loop-free programs , 2011, PLDI '11.

[11]  David Aspinall,et al.  Formalising Java's Data Race Free Guarantee , 2007, TPHOLs.

[12]  Anna Philippou,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2018, Lecture Notes in Computer Science.

[13]  Sanjit A. Seshia,et al.  Combinatorial sketching for finite programs , 2006, ASPLOS XII.

[14]  Michael J. Butler,et al.  Program Derivation Using the Refinement Calculator , 1996, TPHOLs.

[15]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[16]  Edsger W. Dijkstra,et al.  A method of programming , 1988 .

[17]  Frank Wolter,et al.  Monodic fragments of first-order temporal logics: 2000-2001 A.D , 2001, LPAR.

[18]  Edsger W. Dijkstra,et al.  Guarded commands, nondeterminacy and formal derivation of programs , 1975, Commun. ACM.

[19]  Christoph Weidenbach,et al.  SPASS version 2.0 , 2002 .

[20]  Frank Piessens,et al.  The VeriFast program verifier , 2008 .

[21]  John Staples,et al.  Formalizing a Hierarchical Structure of Practical Mathematical Reasoning , 1993, J. Log. Comput..

[22]  Jean-Christophe Filliâtre,et al.  Why3 - Where Programs Meet Provers , 2013, ESOP.

[23]  Anne Kaldewaij,et al.  Programming - the derivation of algorithms , 1990, Prentice Hall international series in computer science.

[24]  Ralph-Johan Back,et al.  Refinement Calculus: A Systematic Introduction , 1998 .

[25]  Ralph-Johan Back,et al.  Structured calculational proof , 1996, Formal Aspects of Computing.

[26]  Mark A. Hillebrand,et al.  VCC: A Practical System for Verifying Concurrent C , 2009, TPHOLs.

[27]  K. Rustan M. Leino,et al.  Dafny: An Automatic Program Verifier for Functional Correctness , 2010, LPAR.

[28]  Rajeev Alur,et al.  Syntax-guided synthesis , 2013, 2013 Formal Methods in Computer-Aided Design.

[29]  Sumit Gulwani,et al.  From program verification to program synthesis , 2010, POPL '10.

[30]  Joakim von Wright Extending Window Inference , 1998, TPHOLs.