Abstract
We extend the proof assistant Agda/Alfa for dependent type theory with a modified version of Claessen and Hughes’ tool QuickCheck for random testing of functional programs. In this way we combine testing and proving in one system. Testing is used for debugging programs and specifications before a proof is attempted. Furthermore, we demonstrate by example how testing can be used repeatedly during proof for testing suitable subgoals. Our tool uses testdata generators which are defined inside Agda/Alfa. We can therefore use the type system to prove properties about them, in particular surjectivity stating that all possible test cases can indeed be generated.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Augustsson, L.: Cayenne: a Language with Dependent Types. In: Proceedings of the third ACM SIGPLAN International Conference on Functional Programming (ICFP 1998). ACM SIGPLAN Notices, vol. 34(1), pp. 239–250 (1998)
Backhouse, R., Jansson, P., Jeuring, J., Meertens, L.: Generic Programming – An Introduction. In: Swierstra, S.D., Oliveira, J.N. (eds.) AFP 1998. LNCS, vol. 1608, pp. 28–115. Springer, Heidelberg (1999)
Bove, A.: General Recursion in Type Theory. PhD thesis. Chalmers University of Technology (2002)
Carlsson, M., Hallgren, T.: Fudgets - Purely Functional Processes with applications to Graphical User Interfaces. PhD thesis. Chalmers University of Technology (1998)
Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: Proceedings of the ACM Sigplan International Conference on Functional Programming (ICFP 2000), vol. 35.9, pp. 18–22. ACM Press, New York (2000)
Claessen, K., Hughes, J.: QuickCheck: Automatic Specification-Based Testing: http: http://www.cs.chalmers.se/~rjmh/QuickCheck/
Coquand, C.: Agda, available from http://www.cs.chalmers.se/~catarina/agda
Coquand, T.: Pattern Matching with Dependent Types. In: Nordström, B., Petersson, K., Plotkin, G. (eds.) Proceedings of The 1992 Workshop on Types for Proofs and Programs, Båstad, pp. 71–84 (1992)
Coquand, T.: Structured Type Theory. draft (1999), available from http://www.cs.chalmers.se/~coquand/type.html
Dybjer, P.: Inductive Families. Formal Aspects of Computing 6, 440–465 (1994)
Dybjer, P., Setzer, A.: A finite axiomatization of inductive-recursive definitions. In: Girard, J.-Y. (ed.) TLCA 1999. LNCS, vol. 1581, pp. 129–146. Springer, Heidelberg (1999)
Dybjer, P., Setzer, A.: Indexed Induction-Recursion. In: Kahle, R., Schroeder-Heister, P., Stärk, R.F. (eds.) PTCS 2001. LNCS, vol. 2183, pp. 93–113. Springer, Heidelberg (2001)
Hallgren, T.: Alfa, available from http://www.cs.chalmers.se/~hallgren/Alfa
Hayashi, S., Nakano, H.: PX, a Computational Logic. The MIT Press, Cambridge (1988)
Hayashi, S., Sumitomo, R., Shii, K.-i.: Towards Animation of Proofs - testing proofs by examples. Theoretical Computer Science 272, 177–195 (2002)
Martin-Löf, P.: Constructive Mathematics and Computer Programming. In: Logic, Methodology and Philosophy of Science, VI, 1979, pp. 153–175. North-Holland, Amsterdam (1982)
Martin-Löf, P.: Intuitionistic Type Theory. Bibliopolis (1984)
Okasaki, C.: An Overview of Edison. In: Haskell Workshop, September 2000, pp. 34–54 (2000)
Parent, C.: A collection of examples using the Program tactic, available from http://pauillac.inria.fr/coq/contribs-eng.html
Programatica: Integrating Programming, Properties, and Validation, http://www.cse.ogi.edu/PacSoft/projects/programatica/
Rabhi, F.A., Lapalme, G.: Algorithms: a functional programming approach. Addison-Wesley Press, Reading (1999)
Wahlstedt, D.: Detecting termination using size-change in parameter values. Master thesis. Chalmers University of Technology (2000)
Xi, H., Pfenning, F.: Dependent types in practical programming. In: Proceedings of the 26th ACM SIGPLAN-SIGACT on Principles of programming languages, pp. 214–227. ACM Press, New York (1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dybjer, P., Haiyan, Q., Takeyama, M. (2003). Combining Testing and Proving in Dependent Type Theory. In: Basin, D., Wolff, B. (eds) Theorem Proving in Higher Order Logics. TPHOLs 2003. Lecture Notes in Computer Science, vol 2758. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10930755_12
Download citation
DOI: https://doi.org/10.1007/10930755_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-40664-8
Online ISBN: 978-3-540-45130-3
eBook Packages: Springer Book Archive