Formal Aspects of Computing

, Volume 29, Issue 3, pp 495–530 | Cite as

Assumption propagation through annotated programs

Original Article
  • 55 Downloads

Abstract

In the correct-by-construction programming methodology, programs are incrementally derived from their formal specifications, by repeatedly applying transformations to partially derived programs. At an intermediate stage in a derivation, users may have to make certain assumptions to proceed further. To ensure that the assumptions hold true at that point in the program, certain other assumptions may need to be introduced upstream as loop invariants or preconditions. Typically these other assumptions are made in an ad hoc fashion and may result in unnecessary rework, or worse, complete exclusion of some of the alternative solutions. In this work, we present rules for propagating assumptions through annotated programs. We show how these rules can be integrated in a top-down derivation methodology to provide a systematic approach for propagating the assumptions, materializing them with executable statements at a place different from the place of introduction, and strengthening of loop invariants with minimal additional proof efforts.

Keywords

Assumption propagation Annotated programs Program derivation Correct-by-construction 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. BL96.
    Butler M, Långbacka T (1996) Program derivation using the refinement calculator. In: Theorem proving in higher order logics: 9th international conference, LNCS, vol 1125. Springer Verlag, Berlin, pp 93–108Google Scholar
  2. BM06.
    Backhouse R, Michaelis D (2006) Exercises in quantifier manipulation. In: Mathematics of program construction. Springer, Berlin, pp 69–81Google Scholar
  3. BT07.
    Barrett C, Tinelli C (2007) CVC3. In: Damm W, Hermanns H (eds) CAV, LNCS, vol 4590. Springer, Berlin, pp 298–302Google Scholar
  4. BvW98.
    Back R-J, von Wright J (1998) Refinement calculus: a systematic introduction. Graduate texts in computer science. Springer, New YorkGoogle Scholar
  5. CC.
    Bobot F, Conchon S, Contejean E, Iguernelala M, Lescuyer S, Mebsout A (2008) The alt-ergo automated theorem proverGoogle Scholar
  6. CD14.
    Chaudhari DL, Damani O (2014) Automated theorem prover assisted program calculations. In: Albert E, Sekerinski E (eds) Integrated formal methods, Lecture Notes in Computer Science. Springer, Switzerland, pp 205–220Google Scholar
  7. CD15.
    Chaudhari DL, Damani OP (2015) Combining top-down and bottom-up techniques in program derivation. In: Logic-Based program synthesis and transformation—25th international symposium, LOPSTR 2015, Siena, Italy, July 13–15, 2015. Revised Selected Papers, pp 244–258Google Scholar
  8. CHN+96.
    Carrington D, Hayes I, Nickson R, Watson GN, Welsh J (1996) A tool for developing correct programs by refinement. Technical reportGoogle Scholar
  9. Coh90.
    Cohen E (1990) Programming in the 1990s—an introduction to the calculation of programs. Texts and Monographs in Computer Science. Springer, New YorkGoogle Scholar
  10. Dij75.
    Dijkstra EW (1975) Guarded commands, nondeterminacy and formal derivation of programs. Commun ACM 18(8): 453–457MathSciNetCrossRefMATHGoogle Scholar
  11. Dij76.
    Dijkstra EW (1976) A discipline of programming. Prentice Hall, Englewood CliffsMATHGoogle Scholar
  12. DMB08.
    De Moura L, Bjørner N (2008) Z3: an efficient smt solver. In: Tools and algorithms for the construction and analysis of systems. Springer, BerlinGoogle Scholar
  13. DS90.
    Dijkstra EW, Scholten CS (1990) Predicate calculus and program semantics. Springer, BerlinCrossRefMATHGoogle Scholar
  14. FP13.
    Filliâtre J-C, Paskevich A (2013) Why3—where programs meet provers. In: ESOP’13 22nd European Symposium on Programming, LNCS, vol 7792, Rome. Springer, BerlinGoogle Scholar
  15. Fra99.
    Michael, Franssen Cocktail.: A tool for deriving correct programs. In Workshop on Automated Reasoning, 1999.Google Scholar
  16. Gri87.
    Gries D (1987) The science of programming, 1st edn. Springer, New York, Inc., SecaucusGoogle Scholar
  17. Gro98.
    Groves L (1998) Adapting program derivations using program conjunction. In: International Refinement Workshop And Formal Methods Pacific, vol 98. Citeseer, pp 145–164Google Scholar
  18. Hoa69.
    Hoare CAR (1969) An axiomatic basis for computer programming. CACM Commun ACM, p 12Google Scholar
  19. Kal90.
    Kaldewaij A (1990) Programming: the derivation of algorithms. Prentice-Hall, Inc.MATHGoogle Scholar
  20. LvW97.
    Laibinis L, von Wright J (1997) Context handling in the refinement calculus framework. Technical Report TUCS-TR-118, Turku Centre for Computer Science, Finland, August 21Google Scholar
  21. Mor90.
    Morgan C (1990) Programming from Specifications. Prentice-Hall, Inc., Englewood CliffsMATHGoogle Scholar
  22. OXC04.
    Oliveira M, Xavier M, Cavalcanti A (2004) Refine and gabriel: support for refinement and tactics. In: Software engineering and formal methods, 2004. SEFM 2004. Proceedings of the Second International Conference on. IEEE, pp 310–319Google Scholar
  23. WBH+02.
    Weidenbach C, Brahm U, Hillenbrand T, Keen E, Theobalt C, Topic D (2002) SPASS version 2.0. In: Voronkov A (ed) Automated deduction—CADE-18, Lecture notes in computer science, vol 2392. Springer, Berlin, pp 275–279Google Scholar

Copyright information

© British Computer Society 2016

Authors and Affiliations

  1. 1.Indian Institute of Technology BombayMumbaiIndia

Personalised recommendations