## Combining Testing and Proving in Dependent Type Theory (2003)

Venue: | 16th International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2003 |

Citations: | 15 - 1 self |

### BibTeX

@INPROCEEDINGS{Dybjer03combiningtesting,

author = {Peter Dybjer and Qiao Haiyan and and Makoto Takeyama and Makoto Takeyama},

title = {Combining Testing and Proving in Dependent Type Theory},

booktitle = {16th International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2003},

year = {2003},

pages = {188--203},

publisher = {SpringerVerlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

We extend the proof assistant Agda/Alfa for dependent type theory with a modi ed 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 speci cations 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 de ned 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.

### Citations

327 | Quickcheck: a lightweight tool for random testing of haskell programs
- Claessen, Hughes
- 2000
(Show Context)
Citation Context ...ams. However, an interesting tool QuickCheck for random testing of functional programs (written in the lazy functional programming language Haskell) has recently been developed by Claessen and Hughes =-=[5]-=-. With this tool, correctness properties of functional programs can easily be checked for randomly generated inputs. Experience shows that this is a useful method for debugging programs [6]. Neverthel... |

299 | Dependent types in practical programming
- Xi, Pfenning
- 1999
(Show Context)
Citation Context ...ata structures and algorithms. To illustrate our tool we consider the correctness of some simple search tree algorithms (search and insertion in binary search trees and AVL-trees). As Xi and Pfenning =-=[23]-=- have emphasized in their work on DML (Dependent ML), dependent types are useful for expressing invariants of such data structures. Our goals should be compared to those of Okasaki, who is currently d... |

44 | Indexed induction-recursion
- Dybjer, Setzer
(Show Context)
Citation Context ...l framework underlying Agda/Alfa including record types see the paper about structured type theory [9] and for the inductive denitions available in type theory, see Dybjer [10] and Dybjer and Setzer [=-=11, 12]-=-. 4 A Testing Tool for Agda/Alfa Our testing tool can test properties of the following form: (x1 :: D1) -> ... -> (xn :: Dn[x1, ..., x(n-1)]) -> T (p1[x1, ..., xn]) -> ... -> T (pm[x1, ..., xn]) -> T ... |

43 | A finite axiomatization of inductive-recursive definitions
- Dybjer, Setzer
- 1998
(Show Context)
Citation Context ...l framework underlying Agda/Alfa including record types see the paper about structured type theory [9] and for the inductive denitions available in type theory, see Dybjer [10] and Dybjer and Setzer [=-=11, 12]-=-. 4 A Testing Tool for Agda/Alfa Our testing tool can test properties of the following form: (x1 :: D1) -> ... -> (xn :: Dn[x1, ..., x(n-1)]) -> T (p1[x1, ..., xn]) -> ... -> T (pm[x1, ..., xn]) -> T ... |

41 | General Recursion in Type Theory
- Bove
- 2003
(Show Context)
Citation Context ...e system. There is also a signicant amount of work on the question of how to reason about general recursive programs in dependent type theory. For some recent contributions to this problem, see Bove [=-=3-=-]. As asrst case study we are developing a certied library of classic data structures and algorithms. To illustrate our tool we consider the correctness of some simple search tree algorithms (search a... |

27 | Fudgets — Purely Functional Processes with applications to Graphical User Interfaces - Carlsson, Hallgren - 1998 |

13 |
Algorithms: a Functional Programming Approach
- Rabhi, Lapalme
- 1999
(Show Context)
Citation Context ...lt - #rt|swhere #t is the height of t and |x| is the absolute value of the integer x. The following algorithm inserts a key in an AVL-tree and is adapted from a textbook on functional data structures =-=[21]-=-. We show relevant parts only: insert :: BT -> Nat -> BT insert Empty k = Branch k Empty Empty insert (Branch n lt rt) k | k == n = Branch n lt rt | ks| k > n = insert_r n lt (insert rt k) insert_l ::... |

10 |
Detecting termination using size-change in parameter values
- Wahlstedt
- 2000
(Show Context)
Citation Context ...llowing certain recursion patterns. Originally only structural recursion over well-founded datatypes was allowed, but recent work on pattern matching with dependent types [8] and termination checking =-=[22-=-] has extended the class of programs accepted by the system. There is also a signicant amount of work on the question of how to reason about general recursive programs in dependent type theory. For so... |

7 |
Augustsson. Cayenne - a language with dependent types
- Lennart
- 1998
(Show Context)
Citation Context ...cted" only means that a completed proof is indeed correct. It does not help you to avoid blind alleys. The syntax of Agda/Alfa has been strongly in uenced by the syntax of Haskell and also of Cay=-=enne [1]-=-, a functional programming language with dependent types. In addition to the function types a -> b available in ordinary functional languages, there are dependent function types written (x :: a) -> b,... |

2 |
Ryosuke Sumitomo, and Ken-ichiro Shii. Towards animation of proofs -testing proofs by examples. Theoretical Computer Science
- Hayashi
- 2002
(Show Context)
Citation Context ...sed testing to debug lemmas while doing proofs in his PX-system [14]. Hayashi is currently pursuing the idea of testing proofs and theorems in his foundationally oriented project on \proof animation&q=-=uot; [15]-=-. AVL-insertion has been implemented and proven correct in Coq by Catherine Parent [19]. Plan. In Section 2 we introduce QuickCheck. In Section 3 we introduce the proof assistant Agda/Alfa. In Section... |

1 |
Claessen and John Hughes: QuickCheck: Automatic Speci Testing: http://www.cs.chalmers.se/~rjmh/QuickCheck
- Koen
(Show Context)
Citation Context ...and Hughes [5]. With this tool, correctness properties of functional programs can easily be checked for randomly generated inputs. Experience shows that this is a useful method for debugging programs =-=[6]-=-. Nevertheless, missing rare counterexamples is unacceptable for certain applications. Furthermore, not all correctness properties have a directly testable form. Since both testing and proving have th... |

1 |
Dybjer: Inductive Families
- Peter
- 1994
(Show Context)
Citation Context ...plete account of the logical framework underlying Agda/Alfa including record types see the paper about structured type theory [9] and for the inductive denitions available in type theory, see Dybjer [=-=10]-=- and Dybjer and Setzer [11, 12]. 4 A Testing Tool for Agda/Alfa Our testing tool can test properties of the following form: (x1 :: D1) -> ... -> (xn :: Dn[x1, ..., x(n-1)]) -> T (p1[x1, ..., xn]) -> .... |

1 |
and Hiroshi Nakano: PX, a Computational Logic
- Hayashi
(Show Context)
Citation Context ... currently under development at Oregon Graduate Centre [20]. Some early work on combining proving and testing was done by Hayashi, who used testing to debug lemmas while doing proofs in his PX-system =-=[14]. Hay-=-ashi is currently pursuing the idea of testing proofs and theorems in his foundationally oriented project on \proof animation" [15]. AVL-insertion has been implemented and proven correct in Coq b... |

1 |
Okasaki: An Overview of Edison
- Chris
(Show Context)
Citation Context ...expressing invariants of such data structures. Our goals should be compared to those of Okasaki, who is currently developing Edison { a library of ecient functional data structures written in Haskell =-=[18]-=-. Okasaki uses QuickCheck to test his programs, and also includes QuickCheck test data generators to be used in applications of his data structures. We aim to build an analogous library for the Agda/A... |

1 |
A collection of examples using the Program tactic. available from http://pauillac.inria.fr/coq/contribs-eng.html
- Parent
(Show Context)
Citation Context ...tly pursuing the idea of testing proofs and theorems in his foundationally oriented project on \proof animation" [15]. AVL-insertion has been implemented and proven correct in Coq by Catherine Pa=-=rent [19]-=-. Plan. In Section 2 we introduce QuickCheck. In Section 3 we introduce the proof assistant Agda/Alfa. In Section 4 we extend Agda/Alfa with a QuickCheck-like tool. In Section 5 we discuss test case g... |