Advertisement

Recursive Functions on Lazy Lists via Domains and Topologies

  • Andreas Lochbihler
  • Johannes Hölzl
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8558)

Abstract

The usual definition facilities in theorem provers cannot handle all recursive functions on lazy lists; the filter function is a prime counterexample. We present two new ways of directly defining functions like filter by exploiting their dual nature as producers and consumers. Borrowing from domain theory and topology, we define them as a least fixpoint (producer view) and as a continuous extension (consumer view). Both constructions yield proof principles that allow elegant proofs. We expect that the approach extends to codatatypes with finite truncations.

Keywords

Recursive Function Continuous Extension Recursive Call Domain Theory Proof Rule 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Agerholm, S.: LCF examples in HOL. In: Melham, T.F., Camilleri, J. (eds.) HUG 1994. LNCS, vol. 859, pp. 1–16. Springer, Heidelberg (1994)CrossRefGoogle Scholar
  2. 2.
    Agerholm, S.: Non-primitive recursive function definitions. In: Schubert, E.T., Alves-Foss, J., Windley, P. (eds.) HUG 1995. LNCS, vol. 971, pp. 17–31. Springer, Heidelberg (1995)CrossRefGoogle Scholar
  3. 3.
    Benton, N., Kennedy, A., Varming, C.: Some domain theory and denotational semantics in Coq. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 115–130. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  4. 4.
    Bertot, Y.: Filters on coInductive streams, an application to Eratosthenes’ sieve. In: Urzyczyn, P. (ed.) TLCA 2005. LNCS, vol. 3461, pp. 102–115. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  5. 5.
    Blanchette, J.C., Hölzl, J., Lochbihler, A., Panny, L., Popescu, A., Traytel, D.: Truly modular (co)datatypes for Isabelle/HOL. In: Klein, G., Gamboa, R. (eds.) ITP 2014. LNCS (LNAI), vol. 8558, pp. 93–110. Springer, Heidelberg (2014)Google Scholar
  6. 6.
    Breitner, J., Huffman, B., Mitchell, N., Sternagel, C.: Certified HLints with Isabelle/HOLCF-Prelude. In: Haskell and Rewriting Techniques, HART (2013)Google Scholar
  7. 7.
    Charguéraud, A.: The optimal fixed point combinator. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010. LNCS, vol. 6172, pp. 195–210. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  8. 8.
    Devillers, M., Griffioen, D., Müller, O.: Possibly infinite sequences in theorem prov- ers: A comparative study. In: Gunter, E.L., Felty, A.P. (eds.) TPHOLs 1997. LNCS, vol. 1275, pp. 89–104. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  9. 9.
    Friedrich, S.: Topology. Archive of Formal Proofs, Formal proof development (2004), http://afp.sf.net/entries/Topology.shtml
  10. 10.
    Di Gianantonio, P., Miculan, M.: A unifying approach to recursive and co-recursive definitions. In: Geuvers, H., Wiedijk, F. (eds.) TYPES 2002. LNCS, vol. 2646, pp. 148–161. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  11. 11.
    Hölzl, J., Immler, F., Huffman, B.: Type classes and filters for mathematical analysis in Isabelle/HOL. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 279–294. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  12. 12.
    Huffman, B.: HOLCF’11: A Definitional Domain Theory for Verifying Functional Programs. PhD thesis, Portland State University (2012)Google Scholar
  13. 13.
    Krauss, A.: Partial and nested recursive function definitions in higher-order logic. J. Autom. Reasoning 44(4), 303–336 (2010)CrossRefMATHMathSciNetGoogle Scholar
  14. 14.
    Krauss, A.: Recursive definitions of monadic functions. In: PAR 2010. EPTCS, vol. 43, pp. 1–13 (2010)Google Scholar
  15. 15.
    Lester, D.R.: Topology in PVS: continuous mathematics with applications. In: AFM 2007, pp. 11–20. ACM (2007)Google Scholar
  16. 16.
    Lochbihler, A.: Coinductive. Archive of Formal Proofs, Formal proof development (2010), http://afp.sf.net/entries/Coinductive.shtml
  17. 17.
    Lochbihler, A.: Making the Java memory model safe. ACM Trans. Program. Lang. Syst. 35(4), 12:1–12:65 (2014)Google Scholar
  18. 18.
    Matthews, J.: Recursive function definition over coinductive types. In: Bertot, Y., Dowek, G., Hirschowitz, A., Paulin, C., Théry, L. (eds.) TPHOLs 1999. LNCS, vol. 1690, pp. 73–90. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  19. 19.
    Müller, O., Nipkow, T., von Oheimb, D., Slotosch, O.: HOLCF = HOL + LCF. J. Funct. Program. 9, 191–223 (1999)CrossRefMATHGoogle Scholar
  20. 20.
    Paulson, L.C.: Mechanizing coinduction and corecursion in higher-order logic. J. Logic Comput. 7(2), 175–204 (1997)CrossRefMATHMathSciNetGoogle Scholar
  21. 21.
    Slind, K.: Function definition in higher-order logic. In: von Wright, J., Harrison, J., Grundy, J. (eds.) TPHOLs 1996. LNCS, vol. 1125, pp. 381–397. Springer, Heidelberg (1996)CrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Andreas Lochbihler
    • 1
  • Johannes Hölzl
    • 2
  1. 1.Institute of Information SecurityETH ZurichSwitzerland
  2. 2.Institut für InformatikTU MünchenGermany

Personalised recommendations