A Practical Approach to Partiality – A Proof Based Approach

  • Farhad Mehta
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5256)


Partial functions are frequently used when specifying and reasoning about computer programs. Using partial functions entails reasoning about potentially ill-defined expressions. In this paper we show how to formally reason about partial functions without abandoning the well understood domain of classical two-valued predicate calculus. In order to achieve this, we extend standard predicate calculus with the notion of well-definedness which is currently used to filter out potentially ill-defined statements from proofs. The main contribution of this paper is to show how the standard predicate calculus can be extended with a new set of derived proof rules that can be used to preserve well-definedness in order to make proofs involving partial functions less tedious to perform.


Logical Operator Function Symbol Partial Function Predicate Calculus Proof Obligation 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Rigorous Open Development Environment for Complex Systems (RODIN) official website,
  2. 2.
    Abrial, J.-R.: The B-Book: Assigning programs to meanings. Cambridge (1996)Google Scholar
  3. 3.
    Abrial, J.-R.: Modeling in Event B: System and Softtware Design. Cambridge (to appear, 2007)Google Scholar
  4. 4.
    Abrial, J.-R., Mussat, L.: On using conditional definitions in formal theories. In: Bert, D., Bowen, J., Henson, M., Robinson, K. (eds.) B 2002 and ZB 2002. LNCS, vol. 2272, pp. 242–269. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  5. 5.
    Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: An overview. In: Construction and Analysis of Safe, Secure, and Interoperable Smart Devices, pp. 49–69 (2005)Google Scholar
  6. 6.
    Barringer, H., Cheng, J.H., Jones, C.B.: A logic covering undefinedness in program proofs. Acta Inf. 21, 251–269 (1984)MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    Behm, P., Burdy, L., Meynadier, J.-M.: Well defined B. In: Bert, D. (ed.) B 1998. LNCS, vol. 1393, pp. 29–45. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  8. 8.
    Berezin, S., Barrett, C., Shikanian, I., Chechik, M., Gurfinkel, A., Dill, D.L.: A practical approach to partial functions in CVC LiteGoogle Scholar
  9. 9.
    Chalin, P.: Logical foundations of program assertions: What do practitioners want? In: SEFM, pp. 383–393 (2005)Google Scholar
  10. 10.
    Darvas, Á., Mehta, F., Rudich, A.: Efficient well-definedness checking. In: International Joint Conference on Automated Reasoning (IJCAR). LNCS. Springer, Heidelberg (to appear, 2008)Google Scholar
  11. 11.
    Fitzgerald, J.S., Jones, C.B.: The connection between two ways of reasoning about partial functions. Technical Report CS-TR-1044, School of Computing Science. Newcastle University (August 2007)Google Scholar
  12. 12.
    Gordon, M.J.C., Melham, T.F.: Introduction to HOL: a theorem proving environment for higher order logic. Cambridge University Press, New York (1993)MATHGoogle Scholar
  13. 13.
    Gries, D., Schneider, F.B.: Avoiding the undefined by underspecification. In: van Leeuwen, J. (ed.) Computer Science Today. LNCS, vol. 1000, pp. 366–373. Springer, Heidelberg (1995)CrossRefGoogle Scholar
  14. 14.
    Jones, C.B.: Systematic software development using VDM, 2nd edn. Prentice-Hall, Inc., Englewood Cliffs (1990)MATHGoogle Scholar
  15. 15.
    Jones, C.B.: Reasoning about partial functions in the formal development of programs. Electr. Notes Theor. Comput. Sci. 145, 3–25 (2006)CrossRefMATHGoogle Scholar
  16. 16.
    Kleene, S.C.: Introduction to metamathematics. Bibl. Matematica. North-Holland, Amsterdam (1952)MATHGoogle Scholar
  17. 17.
    Mehta, F.D.: Proofs for the Working Engineer. PhD thesis, ETH Zurich (2008)Google Scholar
  18. 18.
    Nipkow, T., Paulson, L., Wenzel, M.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)MATHGoogle Scholar
  19. 19.
    Owre, S., Rushby, J.M., Shankar, N.: PVS: A prototype verification system, January 15 (2001)Google Scholar
  20. 20.
    Owre, S., Shankar, N.: The formal semantics of PVS (March 1999),
  21. 21.
    Rudich, A., Darvas, Á., Müller, P.: Checking well-formedness of pure-method specifications. In: Formal Methods (FM). LNCS. Springer, Heidelberg (2008)Google Scholar
  22. 22.
    Sutcliffe, G., Suttner, C.B.: The TPTP (Thousands of Problems for Theorem Provers) Problem Library: CNF Release v1.2.1. Journal of Automated Reasoning 21(2), 177–203 (1998)MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Farhad Mehta
    • 1
  1. 1.Systransis AG − Transport Information SystemsBahnhofplatzSwitzerland

Personalised recommendations