Advertisement

Functional Procedures in Higher-Order Logic

  • Linas Laibinis
  • Joakim von Wright
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1869)

Abstract

In this paper we present an approach for modelling functional procedures (as they occur in imperative programming languages) in a weakest precondition framework. Functional procedures are called inside expressions, but the body of a functional procedure is built using standard specification/programming syntax, including nondeterminism, sequential composition, conditionals and loops. We integrate our theory of functional procedures into the existing mechanisation of the refinement calculus in the HOL system. To make formal reasoning possible, we derive correctness rules for functional procedures and their calls. We also show how recursive functional procedures can be handled according to our approach. Finally, we provide a nontrivial example of reasoning about a recursive procedure for binary search.

Keywords

Function Call Choice Operator Weak Precondition Predicate Transformer Hoare Logic 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    R.J. Back and J. von Wright Refinement Calculus: A Systematic introduction. Springer-Verlag, 1998.Google Scholar
  2. 2.
    G. Collins. A Proof Tool for Reasoning about Functional Programs. In Proc. 1996 International Workshop on Higher Order Logic Theorem Proving, Lecture Notes in Computer Science 1125, Turku, Finland, August 1996. Springer-Verlag.Google Scholar
  3. 3.
    M.J. Butler and J. Grundy and T. Långbacka and R. Rukšėnas and J. von Wright The Refinement Calculator: Proof Support for Program Refinement. Proc. FMP’97 — Formal Methods Pacific, Wellington, New Zealand, July 1997. Springer-Verlag.Google Scholar
  4. 4.
    E.W. Dijkstra A Discipline of Programming. Prentice-Hall international, 1976.Google Scholar
  5. 5.
    L. Laibinis. Mechanising procedures in HOL. Technical Report No.253, Turku Centre for Computer Science, 1999.Google Scholar
  6. 6.
    B. Mahony. Expression Refinement in Higher Order Logic. In Proc. 1998 International Refinement Workshop and Formal Methods Pacific, Discrete Mathematics and Theoretical Computer Science, Springer-Verlag, 1998.Google Scholar
  7. 7.
    J.M. Morris. Non-deterministic expressions and predicate transformers. Information Processing Letters, 61(5):241–246, 1997.CrossRefGoogle Scholar
  8. 8.
    M. Norrish. C formalised in HOL. PhD thesis, University of Cambridge, 1998.Google Scholar
  9. 9.
    M. Schwenke and K. Robinson. What If? In Second Australian Refinement Workshop, 1992.Google Scholar
  10. 10.
    K. Slind. Function Definition in Higher-Order Logic. In Proc. 1996 International Workshop on Higher Order Logic Theorem Proving, Lecture Notes in Computer Science 1125, Turku, Finland, August 1996. Springer-Verlag.Google Scholar
  11. 11.
    J. von Wright. Verifying Modular Programs in HOL. Technical Report No.324, Computer Laboratory of University of Cambridge, 1994.Google Scholar
  12. 12.
    J. von Wright. Program Refinement by Theorem Prover. Proc. 6th Refinement Workshop, London, January 1994. Springer-Verlag.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Linas Laibinis
    • 1
  • Joakim von Wright
    • 1
  1. 1.Åbo Akademi University and Turku Centre for Computer Science (TUCS)TurkuFinland

Personalised recommendations