Skip to main content
Log in

Assumption propagation through annotated programs

  • Original Article
  • Published:
Formal Aspects of Computing

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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–108

  2. Backhouse R, Michaelis D (2006) Exercises in quantifier manipulation. In: Mathematics of program construction. Springer, Berlin, pp 69–81

  3. Barrett C, Tinelli C (2007) CVC3. In: Damm W, Hermanns H (eds) CAV, LNCS, vol 4590. Springer, Berlin, pp 298–302

  4. Back R-J, von Wright J (1998) Refinement calculus: a systematic introduction. Graduate texts in computer science. Springer, New York

  5. Bobot F, Conchon S, Contejean E, Iguernelala M, Lescuyer S, Mebsout A (2008) The alt-ergo automated theorem prover

  6. 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–220

  7. 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–258

  8. Carrington D, Hayes I, Nickson R, Watson GN, Welsh J (1996) A tool for developing correct programs by refinement. Technical report

  9. Cohen E (1990) Programming in the 1990s—an introduction to the calculation of programs. Texts and Monographs in Computer Science. Springer, New York

    Google Scholar 

  10. Dijkstra EW (1975) Guarded commands, nondeterminacy and formal derivation of programs. Commun ACM 18(8): 453–457

    Article  MathSciNet  MATH  Google Scholar 

  11. Dijkstra EW (1976) A discipline of programming. Prentice Hall, Englewood Cliffs

    MATH  Google Scholar 

  12. De Moura L, Bjørner N (2008) Z3: an efficient smt solver. In: Tools and algorithms for the construction and analysis of systems. Springer, Berlin

  13. Dijkstra EW, Scholten CS (1990) Predicate calculus and program semantics. Springer, Berlin

    Book  MATH  Google Scholar 

  14. 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, Berlin

  15. Michael, Franssen Cocktail.: A tool for deriving correct programs. In Workshop on Automated Reasoning, 1999.

  16. Gries D (1987) The science of programming, 1st edn. Springer, New York, Inc., Secaucus

  17. Groves L (1998) Adapting program derivations using program conjunction. In: International Refinement Workshop And Formal Methods Pacific, vol 98. Citeseer, pp 145–164

  18. Hoare CAR (1969) An axiomatic basis for computer programming. CACM Commun ACM, p 12

  19. Kaldewaij A (1990) Programming: the derivation of algorithms. Prentice-Hall, Inc.

    MATH  Google Scholar 

  20. 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 21

  21. Morgan C (1990) Programming from Specifications. Prentice-Hall, Inc., Englewood Cliffs

    MATH  Google Scholar 

  22. 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–319

  23. 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–279

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dipak L. Chaudhari.

Additional information

Augusto Sampaio and Moreno Falashi

This paper is an extended version of: Dipak L. Chaudhari and Om P. Damani. Combining top-down and bottom-up techniques in program derivation. In Logic-Based Program Synthesis and Transformation—25th International Symposium, LOPSTR 2015, Lecture Notes in Computer Science, vol 9527, pp 244–258 [CD15].

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chaudhari, D.L., Damani, O. Assumption propagation through annotated programs. Form Asp Comp 29, 495–530 (2017). https://doi.org/10.1007/s00165-016-0395-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00165-016-0395-x

Keywords

Navigation