Abstract
We apply current theorem proving technology to certified code in the domain of abstract algebra. More concretely, based on a formal proof of the Basic Perturbation Lemma (a central result in homological algebra) in the prover Isabelle/HOL, we apply various code generation techniques, which lead to certified implementations of the associated algorithm in ML. In the formal proof, algebraic structures occurring in the Basic Perturbation Lemma are represented in a way, which is not directly amenable to code generation with the available tools. Interestingly, this representation is required in the proof, while for the algorithm simpler data structures are sufficient. Our approach is to establish a link between the non-executable setting of the proof and the executable representation in the algorithm, which is to be generated. This correspondence is established within the logical framework of Isabelle/HOL—that is, it is formally proved correct. The generated code is applied to and illustrated with a number of examples.
Similar content being viewed by others
References
Aransay J, Ballarin C, Rubio J (2004) Four approaches to automated reasoning with differential algebraic structures. In: Buchberger B, Campbell JA (eds) AISC 2004, 7th International conference on artificial intelligence and symbolic computation, Linz, Austria, September 2004. Lecture notes in artificial intelligence vol 3249. Springer, Heidelberg, pp 222–235
Aransay J, Ballarin C, Rubio J (2005) Extracting computer algebra programs from statements. In: Moreno-Díaz R, Pichler F, Quesada-Arencibia A (eds) EUROCAST 2005, 10th international conference on computer aided systems theory, Las Palmas de Gran Canaria, Spain, February 2005. Lecture notes in computer science, vol 3643. Springer, Hidelberg, pp 159–168
Aransay J, Ballarin C, Rubio J (2008) A mechanized proof of the Basic Perturbation Lemma. J Autom Reason 40(4): 271–292
Aransay J (2006) Mechanized reasoning in homological algebra. PhD thesis, Universidad de La Rioja, http://www.unirioja.es/servicios/sp/tesis/tesis34.shtml
Aransay J (2008) Code generation from the Basic Perturbation Lemma in Isabelle/HOL, http://www.unirioja.es/cu/jearansa/BPL/code_generation/index.html
Ballarin C (2004) Locales and locale expressions in Isabelle/Isar. In: Berardi S, Coppo M, Damiani F (eds) TYPES 2003, 3rd international workshop on types for proofs and programs, Torino, Italy, May 2003. Lecture notes in computer science, vol 3085. Springer, Heidelberg, pp 34–50
Ballarin C (2006) Interpretation of locales in Isabelle: Theories and proof contexts. In: Borwein JM, Farmer WM (eds), MKM 2006, 5th international conference on mathematical knowledge management, wokingham, UK, August 2006. Lecture notes in artificial intelligence, vol. 4108. Springer, Heidelberg, pp 31–43
Berghofer S (2003) Program extraction in simply-typed higher order logic. In: Geuvers H, Wiedijk F (eds) TYPES 2002, 2nd international workshop on types for proofs and programs, Berg en Dal, The Netherlands, April 2002. Lecture Notes in Computer Science, vol 2646. Springer, Heidelberg, pp 21–38
Berghofer S (2003) Proofs, programs and executable specifications in higher order logic. PhD thesis, Technische Universität München
Barnes DW, Lambe LA (1991) Fixed point approach to Homological Perturbation Theory. Proc Am Math Soc 112(3): 881–892
Coquand T, Spiwack A (2007) Towards constructive homological algebra in type theory. In: Miner R, Kauers M, Kerber M, Windsteiger W (eds) 14th Symposium, Calculemus 2007, 6th International Conference, MKM 2007, Hagenberg, Austria, June 2007. Lecture notes in computer science, vol 4573. Springer, Heidelberg, pp 40–54
Domínguez C, Lambán L, Rubio J (2007) Object-oriented institutions to specify symbolic computation systems. Rairo Theor Inf Appl 41: 191–214
Dousson X, Sergeraert F, Siret Y (1999) The Kenzo program. http://www-fourier.ujf-grenoble.fr/~sergerar/Kenzo/, April 1999
Gonthier G, Mahboubi A, Rideau L, Tassi E, Théry L (2007) A modular formalisation of finite group theory. In: Schneider K, Brandt J (eds) TPHOLs’07, 20th international conference on theorem proving in higher-order logics, Kaiserslautern, Germany, September 2007. Lecture notes in computer science, vol 4732. Springer, Heidelberg, pp 86–101
Gugenheim VKAM (1972) On the chain complex of a fibration. Ill J Math 16(3): 398–414
Haftmann F (2007) Code generation from Isabelle/HOL theories. Technical report, Technische Universität München, http://isabelle.in.tum.de/doc/codegen.pdf
Haftmann F (2007) Haskell-style type classes with Isabelle/Isar. Technical report, Technische Universität München, http://isabelle.in.tum.de/doc/classes.pdf
Hales T, The flyspeck project. http://code.google.com/p/flyspeck/
Haftmann F, Nipkow T (2007) A code generator framework for Isabelle/HOL. Technical Report 364/07, Department of Computer Science, University of Kaiserslautern
Jones S, Jones M, Meijer E (1997) Type classes: an exploration of the design space. In: Proceedings of the Haskell Workshop, Amsterdam
Kammüller F, Paulson LC (1999) A formal proof of Sylow’s Theorem—an experiment in Abstract Algebra with Isabelle/HOL. J Autom Reason 23(3): 235–264
Krauss A (2007) Defining recursive functions in Isabelle/HOL. http://isabelle.in.tum.de/dist/Isabelle/doc/functions.pdf
Lambán L, Pascual V, Rubio J (2003) An object-oriented interpretation of the EAT system. Appl Algebra Eng Commun Comput 14(3): 187–215
Nipkow T, Paulson LC, Wenzel M (2002) Isabelle/HOL: a proof assistant for higher order logic. Lecture notes in computer science, vol 2283. Springer, Heidelberg
Naraschewski W, Wenzel M (1998) Object-oriented verification based on record subtyping in higher-order logic. In: Grundy J, Newey M (eds) TPHOLs’98, 11th international conference on theorem proving in higher-order logics, Canberra, Australia, September 1998. Lecture notes in computer science, vol 1479. Springer, Heidelberg, pp 349–366
Obua S (2005) Proving bounds for real linear programs in Isabelle/HOL. In: Hurd J, Melham T (eds) TPHOLs’05, 18th international conference on theorem proving in higher-order logics 2007, Oxford, UK, August 2005. Lecture notes in computer science, vol 3603. Springer, Heidelberg, pp 227–244
Obua S (2007) Proof pearl: looping around the orbit. In: Schneider K, Brandt J (eds) TPHOLs’07, 20th international conference on theorem proving in higher-order logics 2007, Kaiserslautern, Germany, September 2007. Lecture notes in computer science, vol. 4732. Springer, Heidelberg, pp 223–231
Obua S (2008) Flyspeck II: the basic linear programs. PhD thesis, Technishe Universität München
Owens S, Slind K (2008) Adapting functional programs to higher order logic. Higher Order Symb Comput 21(4): 377–409
Rubio J, Sergeraert F (1997) Constructive algebraic topology. Lecture notes summer school in fundamental algebraic topology, Institut Fourier, http://www-fourier.ujf-grenoble.fr/~sergerar/Summer-School/
Wadler P, Blott S (1989) How to make ad-hoc polymorphism less ad-hoc. In: Conference record of the 16th annual ACM symposium on principles of programming languages. ACM, New York, pp 60–76
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by M. Broy
This work has been partially supported by Ministerio de Educación y Ciencia, project MTM2006-06513.
Rights and permissions
About this article
Cite this article
Aransay, J., Ballarin, C. & Rubio, J. Generating certified code from formal proofs: a case study in homological algebra. Form Asp Comp 22, 193–213 (2010). https://doi.org/10.1007/s00165-009-0120-0
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-009-0120-0