skip to main content

Logarithm and program testing

Published:12 January 2022Publication History
Skip Abstract Section

Abstract

Randomized property-based testing has gained much attention recently, but most frameworks stop short at polymorphic properties. Although Bernardy et al. have developed a theory to reduce a wide range of polymorphic properties to monomorphic ones, it relies upon ad-hoc embedding-projection pairs to massage the types into a particular form. This paper skips the embedding-projection pairs and presents a mechanical monomorphization for a general class of polymorphic functions, a step towards automatic testing for polymorphic properties. The calculation of suitable types for monomorphization turns out to be logarithm.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

5-min talk on the paper.

References

  1. Michael Abbott, Thorsten Altenkirch, and Neil Ghani. 2003. Categories of containers. In International Conference on Foundations of Software Science and Computation Structures. 23–38. https://doi.org/10.1007/3-540-36576-1_2 Google ScholarGoogle ScholarCross RefCross Ref
  2. Thorsten Altenkirch, Neil Ghani, Peter Hancock, Conor McBride, and Peter Morris. 2015. Indexed containers. Journal of Functional Programming, 25, e5. https://doi.org/10.1017/S095679681500009X Google ScholarGoogle ScholarCross RefCross Ref
  3. Jean-Philippe Bernardy. 2017. A dual view of testing of (polymorphic) programs. https://jyp.github.io/posts/polytest-two.htmlGoogle ScholarGoogle Scholar
  4. Jean-Philippe Bernardy, Patrik Jansson, and Koen Claessen. 2010. Testing Polymorphic Properties. In Programming Languages and Systems. Springer Berlin Heidelberg, Berlin, Heidelberg. 125–144. isbn:978-3-642-11957-6 https://doi.org/10.1007/978-3-642-11957-6_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Richard Bird and Lambert Meertens. 1998. Nested datatypes. In International Conference on Mathematics of Program Construction. 52–67. https://doi.org/10.1007/BFb0054285 Google ScholarGoogle ScholarCross RefCross Ref
  6. Koen Claessen and John Hughes. 2000. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming (ICFP ’00). ACM, New York, NY, USA. 268–279. isbn:1-58113-202-6 https://doi.org/10.1145/351240.351266 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. CMU 15-210 Staff. 2018. The SEQUENCE signature. http://www.cs.cmu.edu/afs/cs/academic/class/15210-f15/www/docs/sig/sequence/SEQUENCE.htmlGoogle ScholarGoogle Scholar
  8. Peter Hancock. 2019. Personal communication, along with some notes.Google ScholarGoogle Scholar
  9. Ralf Hinze and Ross Paterson. 2006. Finger trees: a simple general-purpose data structure. Journal of functional programming, 16, 2 (2006), 197–217. https://doi.org/10.1017/S0956796805005769 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Kuen-Bang Hou (Favonia) and Zhuyang Wang. 2021. Replication Package for Article: Logarithm and Program Testing. https://doi.org/10.1145/3462305 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Jane Street Group. 2018. Ppxlib - Meta-programming for OCaml. https://github.com/ocaml-ppx/ppxlibGoogle ScholarGoogle Scholar
  12. C Barry Jay. 1995. A semantics for shape. Science of Computer Programming, 25, 2-3 (1995), 251–283. https://doi.org/10.1016/0167-6423(95)00015-1 Selected Papers of ESOP’94, the 5th European Symposium on Programming Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. John C Reynolds. 1983. Types, abstraction and parametric polymorphism. In Information Processing 83, Proceedings of the IFIP 9th World Computer Congres. 513–523.Google ScholarGoogle Scholar
  14. Colin Runciman, Matthew Naylor, and Fredrik Lindblad. 2008. Smallcheck and Lazy Smallcheck: Automatic Exhaustive Testing for Small Values. In Proceedings of the First ACM SIGPLAN Symposium on Haskell (Haskell ’08). ACM, New York, NY, USA. 37–48. isbn:978-1-60558-064-7 https://doi.org/10.1145/1411286.1411292 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Janis Voigtländer. 2008. Much Ado About Two (Pearl): A Pearl on Parallel Prefix Computation. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’08). ACM, New York, NY, USA. 29–35. isbn:978-1-59593-689-9 https://doi.org/10.1145/1328438.1328445 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Philip Wadler. 1989. Theorems for Free!. In Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture (FPCA ’89). ACM, New York, NY, USA. 347–359. isbn:0-89791-328-0 https://doi.org/10.1145/99370.99404 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Zhuyang Wang. 2021. PolyCheck: Testing Polymorphic Functions. https://github.com/hawnzug/polycheckGoogle ScholarGoogle Scholar
  18. Li-yao Xia. 2017. A terminal view of testing polymorphic functions. https://blog.poisson.chat/posts/2017-06-29-terminal-monomorphization.htmlGoogle ScholarGoogle Scholar
  19. Li-yao Xia. 2017. Test Polymorphic Functions with Metamorph. https://github.com/Lysxia/metamorphGoogle ScholarGoogle Scholar

Index Terms

  1. Logarithm and program testing

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!