Skip to main content
Article thumbnail
Location of Repository

Verification of Refactorings in Isabelle/HOL

By Nik Sultana


Refactorings are source-to-source behaviour-preserving program transformations that are used for improving program structure. Programmers refactor code to adapt it when new functionality is added or when the code is being repaired -- refactoring serves to keep the code ``clean'' and more maintainable. Refactoring can also be used as an exploratory technique for understanding source code. The process of refactoring has been automated through the implementation of tools; these tools assist programmers by handling the consistent application of behaviour-preserving changes to the code. It is desirable that the implementations of refactorings are correct: bugs might otherwise be introduced in refactored programs. The correctness, i.e. behaviour-preservation, of refactoring is traditionally probed by testing the refactored program and not the refactoring implementation directly. Recently, automated testing techniques have been used to test implementations of refactorings directly, but the coverage of testing is partial at best. The verification of refactorings is more challenging but determines whether a refactoring is behaviour-preserving for all possible programs. We study the verification of refactorings using the proof assistant Isabelle/HOL for untyped and typed lambda-calculi. Some of the issues encountered during verification are technical rather than purely theoretical: they relate to the embedding of the programming language in the proof environment. The reasons for our choice of techniques are discussed. We also discuss other practical considerations such as the readability of mechanised refactorings, and the avoidance of computationally expensive refactorings

Topics: QA76
OAI identifier:

Suggested articles


  1. (2007). A Head-to-Head Comparison of de Bruijn Indices and Names’, doi
  2. (1999). A new approach to abstract syntax involving binders, doi
  3. (2004). A survey of software refactoring’, doi
  4. (2004). Algebraic Reasoning for Object-Oriented Programming’, doi
  5. (2007). Automated testing of refactoring engines, doi
  6. (1978). Can programming be liberated from the von Neumann style?: a functional style and its algebra of programs’, doi
  7. (2006). Changing programs correctly: Refactoring with specifications, doi
  8. (2006). Changing software correctly, doi
  9. (2007). Coinductive Verification of Program Optimizations Using Similarity Relations’, doi
  10. (1990). Explicit substitutions, doi
  11. (1996). Five axioms of alpha-conversion, doi
  12. (2006). Formal Specification and Verification of Java Refactorings’, doi
  13. (2005). Formalizing refactorings with graph transformations’, doi
  14. (2000). From LCF to HOL: a short history’, Proof, language and interaction: essays in honour of Robin Milner,
  15. (2004). Functional pearl: i am not a number–i am a free variable’, doi
  16. (1994). Functional Programming and Input/Output, Cambridge Univ Pr.
  17. (1993). Introduction to HOL: a theorem proving environment for higher order logic, doi
  18. (1994). Isabelle: A Generic Theorem Prover, doi
  19. (2002). Isabelle/HOL: A Proof Assistant for Higher-Order Logic, doi
  20. (1997). Lambda Calculi Plus Letrec, Vrije Universiteit, Faculteit der Wiskunde en Informatica.
  21. (1994). Lambda Calculi: A Guide for Computer Scientists, doi
  22. (1994). Lambda Calculi: A Guide for Computer Scientists, Clarendon Press. doi
  23. (1968). Lambda-Calculus Models of Programming Languages, doi
  24. (1972). Lambda-calculus notation with nameless dummies: a tool for automatic formula manipulation with application to the Church-Rosser theorem’, doi
  25. (2005). Latex sugar for isabelle documents, Distributed with the Isabelle system.
  26. (2001). Logic and Automation for Algebra of Programming, Master’s thesis,
  27. (1987). Logic and Computation: interactive proof with Cambridge LCF, doi
  28. (2005). Mechanized metatheory for the masses: The POPLmark challenge’, doi
  29. (2007). Mechanized metatheory model-checking, doi
  30. (2004). Obfuscation of Abstract Data Types, PhD thesis,
  31. (2005). Point-free Program Transformation’, doi
  32. (2005). Program Refactoring in the Presence of Preprocessor Directives,
  33. (1991). Program Restructuring as an Aid to Software Maintenance, PhD thesis,
  34. (2000). Proof General: A generic tool for proof development’, Tools and Algorithms for the Construction and Analysis of Systems (TACAS) doi
  35. (2003). Proofs, Programs and Executable Specifications in Higher Order Logic, doi
  36. (1993). Pure type systems formalized, in doi
  37. (2006). Refactoring Haskell Programs, doi
  38. (1992). Refactoring Object-Oriented Frameworks, PhD thesis,
  39. (2005). Refactoring Towards a Layered Architecture’, doi
  40. (2007). Refactoring via Program Slicing and Sliding, PhD thesis, doi
  41. (2004). Refactorings as Formal Refinements,
  42. (1992). Semantics of Programming Languages: Structures and Techniques, doi
  43. (2002). Software restructuring: implementing a code abstraction transformation’,
  44. (2004). Static composition of refactorings’, doi
  45. (2007). Testing Erlang Refactorings with QuickCheck, doi
  46. (1997). The Definition of Standard ML, doi
  47. (2001). The early history of automated deduction’, doi
  48. (1981). The Lambda Calculus, its Syntax and Semantics, NorthHolland. doi
  49. (1990). The lazy lambda calculus’, doi
  50. (2007). Towards a mechanized metatheory of standard ML’, doi
  51. (2004). Transformation in HaRe,
  52. (2007). Using CafeOBJ to Mechanise Refactoring Proofs and Application’, doi
  53. (2003). Verifying CPS transformations in Isabelle/HOL, doi

To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.