Abstract
Huffman’s algorithm is a procedure for constructing a binary tree with minimum weighted path length. Our Isabelle/HOL proof closely follows the sketches found in standard algorithms textbooks, uncovering a few snags in the process. Another distinguishing feature of our formalization is the use of custom induction rules to help Isabelle’s automatic tactics, leading to very short proofs for most of the lemmas.
Similar content being viewed by others
References
Aho, A.V., Hopcroft, J.E., Ullman, J.D.: Data Structures and Algorithms. Addison-Wesley, Reading (1983)
Berghofer, S., Nipkow, T.: Random testing in Isabelle/HOL. In: Cuellar, J., Liu, Z. (eds.) Software Engineering and Formal Methods (SEFM 2004), pp. 230–239. IEEE Computer Society, Los Alamitos (2004)
Bird, R., Wadler, P.: Introduction to Functional Programming. Prentice Hall International Series in Computer Science. Prentice Hall, Hemel Hempstead (1988)
Blanchette, J.C.: An Isabelle/HOL formalization of the textbook proof of Huffman’s algorithm. Archive of Formal Proofs. http://afp.sourceforge.net/entries/Huffman.shtml (2008)
Bulwahn, L., Krauss, A.: Finding lexicographic orders for termination proofs in Isabelle/HOL. In: Schneider, K., Brandt, J. (eds.) Theorem Proving in Higher Order Logics (TPHOLs 2007). Lecture Notes in Computer Science, vol. 4732, pp. 38–53. Springer, Heidelberg (2007)
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. MIT, Cambridge (2001)
Gordon, M.J.C., Melham, T.F. (eds.): Introduction to HOL: A Theorem Proving Environment for Higher Order Logic. Cambridge University Press, Cambridge (1993)
Haftmann, F., Nipkow, T.: A code generator framework for Isabelle/HOL. In: Schneider, K., Brandt, J. (eds.) Theorem Proving in Higher Order Logics (TPHOLs 2007). Lecture Notes in Computer Science, vol. 4732, pp. 128–143. Springer, Heidelberg (2007)
Huffman, D.A.: A method for the construction of minimum-redundancy codes. In: Proc. IRE 40(9), pp. 1098–1101 (1952)
Knuth, D.E.: The Art of Computer Programming, Vol. 1: Fundamental Algorithms, 3rd edn. Addison-Wesley, Reading (1997)
Krauss, A.: Automating Recursive Definitions and Termination Proofs in Higher-Order Logic. Ph.D. thesis (submitted), Dept. of Informatics, T. U. München (2009)
Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML (Revised Edn.). MIT, Cambridge (1997)
Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL: A Proof Assistant for Higher-order Logic. Lecture Notes in Computer Science, vol. 2283. Springer, Heidelberg (2002) (Updated version http://isabelle.in.tum.de/doc/tutorial.pdf, 2008)
Théry, L.: A correctness proof of Huffman algorithm. http://coq.inria.fr/contribs/Huffman.html (2003). Accessed 24 September 2008
Théry, L.: Formalising Huffman’s algorithm. Tech. report TRCS 034, Dept. of Informatics, Univ. of L’Aquila (2004)
Author information
Authors and Affiliations
Corresponding author
Additional information
This work was supported by the DFG grant NI 491/11-1.
Rights and permissions
About this article
Cite this article
Blanchette, J.C. Proof Pearl: Mechanizing the Textbook Proof of Huffman’s Algorithm. J Autom Reasoning 43, 1–18 (2009). https://doi.org/10.1007/s10817-009-9116-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10817-009-9116-y