Proving the Equivalence of Higher-Order Terms by Means of Supercompilation

  • Ilya Klyuchnikov
  • Sergei Romanenko
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5947)


One of the applications of supercompilation is proving properties of programs. We focus in this paper on a specific task: proving term equivalence for a higher-order lazy functional language. The “classical” way to prove equivalence of two terms t1 and t2 is to write an equality function equals and to simplify the term (equals t1 t2). However, this works only when certain conditions are met. The paper presents another approach to proving term equivalence by means of supercompilation. In this approach we supercompile both terms and compare supercompiled terms syntactically. Some applications of the technique are discussed. In particular, one of these applications may lead to the development of a more powerful “higher-level” supercompiler.


Partial Evaluation Source Program Cache Coherence Protocol Functional Programming Language Equality Predicate 
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.
    Albert, E., Vidal, G.: The narrowing-driven approach to functional logic program specialization. New Generation Computing 20(1), 3–26 (2002)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Alpuente, M., Falaschi, M., Vidal, G.: Partial evaluation of functional logic programs. ACM Transactions on Programming Languages and Systems (TOPLAS) 20(4), 768–844 (1998)CrossRefGoogle Scholar
  3. 3.
    Cockett, R.: Deforestation, program transformation, and cut-elimination. Electronic Notes in Theoretical Computer Science 44(1), 88–127 (2001)CrossRefGoogle Scholar
  4. 4.
    Dybjer, P., Filinski, A.: Normalization and partial evaluation. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) APPSEM 2000. LNCS, vol. 2395, pp. 137–192. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  5. 5.
    Glück, R., Klimov, A.V.: Occam’s razor in metacompuation: the notion of a perfect process tree. In: Cousot, P., Filé, G., Falaschi, M., Rauzy, A. (eds.) WSA 1993. LNCS, vol. 724, pp. 112–123. Springer, Heidelberg (1993)Google Scholar
  6. 6.
    Hamilton, G.W.: Distillation: extracting the essence of programs. In: Proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation, pp. 61–70. ACM Press, New York (2007)CrossRefGoogle Scholar
  7. 7.
    Hamilton, G.W., Kabir, M.H.: Constructing programs from metasystem transition proofs. In: Proceedings of the First International Workshop on Metacomputation in Russia (2008)Google Scholar
  8. 8.
    Holst, C.K., Hughes, J.: Towards binding-time improvement for free. In: Functional Programming, Workshops in Computing, Glasgow. Springer, Heidelberg (1990)Google Scholar
  9. 9.
    Jonsson, P.A.: Positive supercompilation for a higher-order call-by-value language. Luleå University of Technology (2008)Google Scholar
  10. 10.
    Klimov, A.V.: A program specialization relation based on supercompilation and its properties. In: Proceedings of the First International Workshop on Metacomputation in Russia, pp. 54–78. Ailamazyan University of Pereslavl (2008)Google Scholar
  11. 11.
    Lisitsa, A., Nemytykh, A.P.: Reachability analysis in verification via supercompilation. International Journal of Foundations of Computer Science 19(4), 953–969 (2008)zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    Lisitsa, A.P., Nemytykh, A.P.: Verification as a parameterized testing (experiments with the scp4 supercompiler). Programming and Computer Software 33(1), 14–23 (2007)zbMATHCrossRefGoogle Scholar
  13. 13.
    Lisitsa, A.P., Webster, M.: Supercompilation for equivalence testing in metamorphic computer viruses detection. In: Proceedings of the First International Workshop on Metacomputation in Russia. Ailamazyan University of Pereslavl (2008)Google Scholar
  14. 14.
    Mitchell, N., Runciman, C.: A supercompiler for core haskell. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) IFL 2007. LNCS, vol. 5083, pp. 147–164. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  15. 15.
    Pitts, A.M.: Operationally-based theories of program equivalence. In: Semantics and Logics of Computation, pp. 241–298 (1997)Google Scholar
  16. 16.
    Romanenko, S.A.: Higher-order functions as a substitute for partial evaluation. In: Proceedings of the First International Workshop on Metacomputation in Russia. Ailamazyan University of Pereslavl (2008)Google Scholar
  17. 17.
    Sørensen, M.H., Glück, R., Jones, N.D.: A positive supercompiler. Journal of Functional Programming 6(6), 811–838 (1993)CrossRefGoogle Scholar
  18. 18.
    Turchin, V.F.: The Language Refal: The Theory of Compilation and Metasystem Analysis. Department of Computer Science, Courant Institute of Mathematical Sciences, New York University (1980)Google Scholar
  19. 19.
    Turchin, V.F.: The concept of a supercompiler. ACM Transactions on Programming Languages and Systems (TOPLAS) 8(3), 292–325 (1986)zbMATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    Turchin, V.F.: Metacomputation: Metasystem transitions plus supercompilation. In: Danvy, O., Thiemann, P., Glück, R. (eds.) Dagstuhl Seminar 1996. LNCS, vol. 1110, pp. 481–509. Springer, Heidelberg (1996)Google Scholar
  21. 21.
    Turner, D.A.: Total functional programming. Journal of Universal Computer Science 10(7), 751–768 (2004)MathSciNetGoogle Scholar
  22. 22.
    Wadler, P.: Theorems for free! In: FPCA 1989: Proceedings of the fourth international conference on Functional programming languages and computer architecture, pp. 347–359. ACM, New York (1989)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Ilya Klyuchnikov
    • 1
  • Sergei Romanenko
    • 1
  1. 1.Keldysh Institute of Applied MathematicsRussian Academy of Sciences 

Personalised recommendations