On the Representation of Imperative Programs in a Logical Framework

  • José Luis Freire Nistal
  • Enrique Freire Brañas
  • Antonio Blanco Ferro
  • David Cabrero Souto
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4739)


Research on formal verification of imperative programs using some form of representing them in a type theory has been done for years. Generally, the different approaches include a verification conditions generator, which from an annotated program including variants and invariants for while–loops and using a Hoare logic–like specification, produces some propositions to be proved in a logical framework, expressing the program correctness and termination.

In this paper we present a direct use of Coq [3] to model imperative programs. This method, and the fact that it is not possible to have not–ending programs in Coq, should allow a more deep understanding of imperative programs semantics [15], and people without big knowledge on type theory could use this theorem prover to verify imperative programs properties. This approach is based on using a fixed–point equality theorem [2] that represents the appropriate reduction rule to be used in our model.

In our approach no Hoare logic rules are used for verification of program specifications. This verification is achieved, in a pure constructive setting, directly with the type theory model.


Type Theory Reduction Rule Logical Framework Proof Assistant Inductive Type 
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.
    Aczel, P.: Introduction to Inductive definitions. In: Barwise, J. (ed.) Handbook of Mathematical Logic, North Holland (1997)Google Scholar
  2. 2.
    Balaa, A.: Fonctions récursives générales dans le calcul des constructions. PhD. Theése. Université de Nice–Sophia Antipolis (2002)Google Scholar
  3. 3.
    Bertot, I., Castéran, P.: Interactive Theorem Proving and Program Development. Springer, Heidelberg (2004)zbMATHGoogle Scholar
  4. 4.
    Bertot, I., Capretta, V., Barman, K.: Type–Theoretic Functional Semantics. In: Carreño, V.A., Muñoz, C.A., Tahar, S. (eds.) TPHOLs 2002. LNCS, vol. 2410, pp. 83–97. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  5. 5.
    Bove, A.: Simple General Recursion in Type Theory. Technical Report. Chalmers University of Technology, Goteborg (2000)Google Scholar
  6. 6.
    Coquand, T.: An Introduction to Type Theory. Notes of the FPCL summer school, Glasgow (1989)Google Scholar
  7. 7.
    Coquand, T., Pauling-Mohring, C.: Inductively defined types. In: Martin-Löf, P., Mints, G. (eds.) COLOG-1988. LNCS, vol. 417, Springer, Heidelberg (1990)Google Scholar
  8. 8.
    Filliâtre, J.-C.: Why: a multi-language multi-prover verification tool, Research Report, LRI, 1366 (March 2003)Google Scholar
  9. 9.
    Barthe, G., Forest, J., Pichardie, D., Rusu, V.: Defining and reasoning about recursive functions: a practical tool for the Coq proof assistantGoogle Scholar
  10. 10.
    Nipkow, T.: Winskell is (almost) right: Towards a mechanised semantics test–book. In: Chandru, V., Vinay, V. (eds.) Foundations of Software Technology and Theoretical Computer Science. LNCS, vol. 1180, Springer, Heidelberg (1996)Google Scholar
  11. 11.
    Pauling-Mohring, C.: Inductive Definitions in the System Coq–Rules and Properties. In: Bezem, M., Groote, J.F. (eds.) TLCA 1993. LNCS, vol. 664, Springer, Heidelberg (1993)Google Scholar
  12. 12.
    Nordström, B.: Terminating General Recursion. BIT, vol. 28 (1988)Google Scholar
  13. 13.
    Pfenning, F., Pauling-Mohring, C.: Inductively defined types in the Calculus of Constructions. In: Schmidt, D.A., Main, M.G., Melton, A.C., Mislove, M.W. (eds.) Mathematical Foundations of Programming Semantics. LNCS, vol. 442, Springer, Heidelberg (1990)CrossRefGoogle Scholar
  14. 14.
    Werner, B., Paulin Mohrin, C.: ENSTA: Course Notes (1995)Google Scholar
  15. 15.
    Winskell, G.: The Formal Semantics of Programming Languages, an introduction. Foundatios of computing. The MIT Press, Cambridge (1993)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • José Luis Freire Nistal
    • 1
  • Enrique Freire Brañas
    • 1
  • Antonio Blanco Ferro
    • 1
  • David Cabrero Souto
    • 1
  1. 1.University of A Coruña, Spain, University of A Coruña, LFCIA, Dept. of Computer Science, Faculty of Informatics, 15071 A CoruñaSpain

Personalised recommendations