Abstract
In the implementation of procedures, developers often assume that the input satisfies certain properties; for example, binary search assumes the array to be sorted. Such requirements on the input can be formally expressed as preconditions of procedures. If a second-order procedure p (e.g., map or ffoldl) is called with a first-order procedure f that has a precondition, the question arises whether p will call f only with arguments that satisfy the precondition of f. In this paper, we propose a method to statically analyze if all procedure calls in a given second-order program satisfy the respective preconditions. In particular, we consider indirect calls of procedures that are passed as an argument to a second-order procedure.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Aderhold, M.: Verification of Second-Order Functional Programs. Doctoral dissertation, TU Darmstadt (2009)
Aderhold, M.: Automated synthesis of induction axioms for programs with second-order recursion. In: Giesl, J., Hähnle, R. (eds.) IJCAR 2010. LNCS (LNAI), vol. 6173, pp. 263–277. Springer, Heidelberg (2010)
Andrews, P.B.: An Introduction to Mathematical Logic and Type Theory: To Truth Through Proof. Kluwer Academic Publishers, Dordrecht (2002)
Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: An overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005)
Boyer, R.S., Goldschlag, D.M., Kaufmann, M., Moore, J.S.: Functional instantiation in first-order logic. In: Lifschitz, V. (ed.) Papers in Honor of John McCarthy, pp. 7–26. Academic Press, London (1991)
Gries, D., Schneider, F.B.: Avoiding the undefined by underspecification. In: van Leeuwen, J. (ed.) Computer Science Today: Recent Trends and Developments. LNCS, vol. 1000, pp. 366–373. Springer, Heidelberg (1995)
Hunt Jr., W.A., Kaufmann, M., Krug, R.B.: Meta reasoning in ACL2. In: Hurd, J., Melham, T. (eds.) TPHOLS 2005. LNCS, vol. 3603, pp. 163–178. Springer, Heidelberg (2005)
Kaufmann, M., Manolios, P., Moore, J.S.: Computer-Aided Reasoning: An Approach. Kluwer Academic Publishers, Dordrecht (2000)
Meyer, B.: Eiffel: The Language. Prentice Hall International, London (1992)
Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL — A Proof Assistant for Higher-Order Logic, Springer, Heidelberg (June 2010)
Owre, S., Shankar, N., Rushby, J.M., Stringer-Calvert, D.W.J.: PVS Language Reference, Computer Science Laboratory, SRI International (November 2001)
Peyton Jones, S. (ed.): Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press (2003)
Sabel, D., Schmidt-Schauß, M.: Reconstruction of a logic for inductive proofs of properties of functional programs. Frank report 39, J. W. Goethe-Universität, Frankfurt am Main, Germany (June 2010)
Schlosser, A., Walther, C., Gonder, M., Aderhold, M.: Context dependent procedures and computed types in \({\checkmark}\)eriFun. In: Proc. of 1st Workshop Programming Languages meet Program Verification. ENTCS, vol. 174, pp. 61–78 (2007)
Walther, C.: Semantik und Programmverifikation. Teubner-Wiley, Leipzig (2001)
Walther, C., Aderhold, M., Schlosser, A.: The \(\mathcal{L}\) 1.0 Primer. Technical Report VFR 06/01, TU Darmstadt (2006)
Walther, C., Schweitzer, S.: About \({\checkmark}\)eriFun. In: Baader, F. (ed.) CADE 2003. LNCS (LNAI), vol. 2741, pp. 322–327. Springer, Heidelberg (2003)
Walther, C., Schweitzer, S.: Verification in the classroom. Journal of Automated Reasoning 32(1), 35–73 (2004)
Walther, C., Schweitzer, S.: Reasoning about incompletely defined programs. In: Sutcliffe, G., Voronkov, A. (eds.) LPAR 2005. LNCS (LNAI), vol. 3835, pp. 427–442. Springer, Heidelberg (2005)
Xu, D.N., Peyton Jones, S., Claessen, K.: Static contract checking for Haskell. In: Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pp. 41–52. ACM, New York (2009)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Aderhold, M. (2010). Second-Order Programs with Preconditions. In: Siegler, S., Wasser, N. (eds) Verification, Induction, Termination Analysis. Lecture Notes in Computer Science(), vol 6463. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-17172-7_8
Download citation
DOI: https://doi.org/10.1007/978-3-642-17172-7_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-17171-0
Online ISBN: 978-3-642-17172-7
eBook Packages: Computer ScienceComputer Science (R0)