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, access via your institution.
References
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
Backhouse R, Michaelis D (2006) Exercises in quantifier manipulation. In: Mathematics of program construction. Springer, Berlin, pp 69–81
Barrett C, Tinelli C (2007) CVC3. In: Damm W, Hermanns H (eds) CAV, LNCS, vol 4590. Springer, Berlin, pp 298–302
Back R-J, von Wright J (1998) Refinement calculus: a systematic introduction. Graduate texts in computer science. Springer, New York
Bobot F, Conchon S, Contejean E, Iguernelala M, Lescuyer S, Mebsout A (2008) The alt-ergo automated theorem prover
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
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
Carrington D, Hayes I, Nickson R, Watson GN, Welsh J (1996) A tool for developing correct programs by refinement. Technical report
Cohen E (1990) Programming in the 1990s—an introduction to the calculation of programs. Texts and Monographs in Computer Science. Springer, New York
Dijkstra EW (1975) Guarded commands, nondeterminacy and formal derivation of programs. Commun ACM 18(8): 453–457
Dijkstra EW (1976) A discipline of programming. Prentice Hall, Englewood Cliffs
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
Dijkstra EW, Scholten CS (1990) Predicate calculus and program semantics. Springer, Berlin
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
Michael, Franssen Cocktail.: A tool for deriving correct programs. In Workshop on Automated Reasoning, 1999.
Gries D (1987) The science of programming, 1st edn. Springer, New York, Inc., Secaucus
Groves L (1998) Adapting program derivations using program conjunction. In: International Refinement Workshop And Formal Methods Pacific, vol 98. Citeseer, pp 145–164
Hoare CAR (1969) An axiomatic basis for computer programming. CACM Commun ACM, p 12
Kaldewaij A (1990) Programming: the derivation of algorithms. Prentice-Hall, Inc.
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
Morgan C (1990) Programming from Specifications. Prentice-Hall, Inc., Englewood Cliffs
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
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
Author information
Authors and Affiliations
Corresponding author
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
About this article
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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-016-0395-x