Abstract
Although quantification over functions in QuickCheck properties has been supported from the beginning, displaying and shrinking them as counter examples has not. The reason is that in general, functions are infinite objects, which means that there is no sensible show function for them, and shrinking an infinite object within a finite number of steps seems impossible. This paper presents a general technique with which functions as counter examples can be shrunk to finite objects, which can then be displayed to the user. The approach turns out to be practically usable, which is shown by a number of examples. The two main limitations are that higher-order functions cannot be dealt with, and it is hard to deal with terms that contain functions as subterms.
- J. Bernardy, P. Jansson, and K. Claessen. Testing polymorphic properties. In Proc. of European Symposium on Programming (ESOP). Springer LNCS, 2010. Google Scholar
Digital Library
- K. Claessen and J. Hughes. QuickCheck: A lightweight tool for random testing of Haskell programs. In Proc. of International Conference on Functional Programming (ICFP). ACM SIGPLAN, 2000. Google Scholar
Digital Library
- C. Elliott. Functional implementations of continuous modeled animation. In Proc. of PLILP/ALP. Springer LNCS, 1998. Google Scholar
Digital Library
- M. Escardo. Infinite sets that admit fast exhaustive search. In Proc. of Logic in Computer Science (LICS). IEEE, 2007. Google Scholar
Digital Library
- R. Hinze. Generalizing generalized tries. J. Funct. Program., 10(4): 327--351, July 2000. ISSN 0956-7968. Google Scholar
Digital Library
- C. Runciman, M. Naylor, and F. Lindblad. SmallCheck and Lazy SmallCheck - automatic exhaustive testing for small values. In Proc. of Haskell Symposium. ACM SIGPLAN, 2008. Google Scholar
Digital Library
Index Terms
Shrinking and showing functions: (functional pearl)
Recommendations
Shrinking and showing functions: (functional pearl)
Haskell '12: Proceedings of the 2012 Haskell SymposiumAlthough quantification over functions in QuickCheck properties has been supported from the beginning, displaying and shrinking them as counter examples has not. The reason is that in general, functions are infinite objects, which means that there is no ...
Shrink fast correctly!
PPDP '17: Proceedings of the 19th International Symposium on Principles and Practice of Declarative ProgrammingFunction inlining, case-folding, projection-folding, and dead-variable elimination are important code transformations in virtually every functional-language compiler. When one of these reductions strictly reduces the size of the program (e.g., when the ...
A further study on the construction methods of bent functions and self-dual bent functions based on Rothaus’s bent function
AbstractBent functions are maximally nonlinear Boolean functions. They are important functions introduced by Rothaus and studied firstly by Dillon and next by many researchers for more than four decades. A systematic construction method of bent functions ...







Comments