## QArith: Coq formalisation of lazy rational arithmetic (2003)

### Cached

### Download Links

- [www.cs.ru.nl]
- [www.cs.kun.nl]
- [www.cs.kun.nl]
- DBLP

### Other Repositories/Bibliography

Venue: | Types for Proofs and Programs, volume 3085 of LNCS |

Citations: | 10 - 2 self |

### BibTeX

@INPROCEEDINGS{Niqui03qarith:coq,

author = {Milad Niqui and Yves Bertot and Inria Sophia Antipolis},

title = {QArith: Coq formalisation of lazy rational arithmetic},

booktitle = {Types for Proofs and Programs, volume 3085 of LNCS},

year = {2003},

pages = {309--323},

publisher = {Springer-Verlag}

}

### OpenURL

### Abstract

Abstract. In this paper we present the Coq formalisation of the QArith library which is an implementation of rational numbers as binary sequences for both lazy and strict computation. We use the representation also known as the Stern-Brocot representation for rational numbers. This formalisation uses advanced machinery of the Coq theorem prover and applies recent developments in formalising general recursive functions. This formalisation highlights the rôle of type theory both as a tool to verify hand-written programs and as a tool to generate verified programs. 1

### Citations

76 |
Exact real computer arithmetic with continued fractions
- Vuillemin
- 1990
(Show Context)
Citation Context ...rb next. Classical examples of lazy algorithms are those given by Gosper [8] for adding and multiplying regular continued fractions. The work by Gosper was later generalised for exact real arithmetic =-=[18, 12, 17, 9]-=-. We devised lazy algorithms to compute directly on the Q + and Q structures without going through computations on fractions; we then showed their equivalence with the strict algorithms from Sect. 3. ... |

56 |
A New Extraction for Coq
- Letouzey
(Show Context)
Citation Context ...f the formalised programs, Coq has the program extraction mechanism. This is a tool to extract the underlying program of an object in type theory into a program in a conventional programming language =-=[16, 10]-=-.sIn our case, after finishing the formalisation of the lazy algorithms, we used the program extraction into Haskell, to obtain the verified version of the algorithms. It is interesting to compare the... |

32 |
Extracting Fω’s programs from proofs in the Calculus of Constructions
- Paulin-Mohring
- 1989
(Show Context)
Citation Context ...f the formalised programs, Coq has the program extraction mechanism. This is a tool to extract the underlying program of an object in type theory into a program in a conventional programming language =-=[16, 10]-=-.sIn our case, after finishing the formalisation of the lazy algorithms, we used the program extraction into Haskell, to obtain the verified version of the algorithms. It is interesting to compare the... |

27 | Nested general recursion and partiality in type theory
- Bove, Capretta
- 2001
(Show Context)
Citation Context ...orithm complexity (for example the Balaa and Bertot’s method [1]) or lead to very large proof terms by changing the representation of the function’s domain (for example the Bove and Capretta’s method =-=[5]-=-). In Sect. 4.4 we explain how we used a variant of .sBove and Capretta’s method in our formalisation to formalise the non-structural recursion. Similarly in the case of the quadratic algorithm, the s... |

15 |
Exact Real Arithmetic Using Möbius Transformations
- Potts
- 1998
(Show Context)
Citation Context ...rb next. Classical examples of lazy algorithms are those given by Gosper [8] for adding and multiplying regular continued fractions. The work by Gosper was later generalised for exact real arithmetic =-=[18, 12, 17, 9]-=-. We devised lazy algorithms to compute directly on the Q + and Q structures without going through computations on fractions; we then showed their equivalence with the strict algorithms from Sect. 3. ... |

13 |
Fonctions récursives générales par itération en théorie des types
- Balaa, Bertot
- 2002
(Show Context)
Citation Context ...g non-structural yet terminating recursion is possible in various ways. But all of the methods either require a priori knowledge of the algorithm complexity (for example the Balaa and Bertot’s method =-=[1]-=-) or lead to very large proof terms by changing the representation of the function’s domain (for example the Bove and Capretta’s method [5]). In Sect. 4.4 we explain how we used a variant of .sBove an... |

13 |
Field: une procédure de décision pour les nombres réels en Coq
- Delahaye, Mayero
- 2001
(Show Context)
Citation Context ...em, the term Q nonzeroCorrect corresponds to the correctness of the lazy proof obligations that we defined in Sect. 4.3.s5.2 Using the field Tactic The field tactic was devised by Delahaye and Mayero =-=[7]-=- to ease the equational reasoning on field structures in Coq. It is a decision procedure for simple equations that generates proof obligations for each occurrence of the division. We could use this ta... |

11 | Efficient Reasoning about Executable Specifications in Coq
- Barthe, Courtieu
- 2002
(Show Context)
Citation Context ...correctness many of these cases should be handled in a similar way; they can be solved by automatic tactics or are degenerate cases. The tactic functional induction is designed by Barthe and Courtieu =-=[2]-=- to assist the user in dealing with these situations by providing some automation. When given a Coq function, the tactic functional induction tries to automatically generate an elimination principle w... |

11 |
exacte, conception, algorithmique et performances d’une implémentation informatique en précision arbitraire. Thèse, Université Paris 7
- Ménissier-Morain, Arithmétique
- 1994
(Show Context)
Citation Context ...rb next. Classical examples of lazy algorithms are those given by Gosper [8] for adding and multiplying regular continued fractions. The work by Gosper was later generalised for exact real arithmetic =-=[18, 12, 17, 9]-=-. We devised lazy algorithms to compute directly on the Q + and Q structures without going through computations on fractions; we then showed their equivalence with the strict algorithms from Sect. 3. ... |

8 | Exact arithmetic on Stern-Brocot tree
- Niqui
- 2003
(Show Context)
Citation Context ...ype theory both as a tool to verify hand-written programs and as a tool to generate verified programs. 1 Introduction The present work is the continuation of two earlier parallel works of the authors =-=[3, 13]-=- with two principal objectives: 1. To present a library of rational numbers for Coq [6] based on a canonical representation for rational numbers also known as Stern-Brocot representation 3 . 2. To ver... |

7 |
Simple canonical representation of rational numbers
- Bertot
- 2003
(Show Context)
Citation Context ...ype theory both as a tool to verify hand-written programs and as a tool to generate verified programs. 1 Introduction The present work is the continuation of two earlier parallel works of the authors =-=[3, 13]-=- with two principal objectives: 1. To present a library of rational numbers for Coq [6] based on a canonical representation for rational numbers also known as Stern-Brocot representation 3 . 2. To ver... |

5 |
Many-Valued Real Functions Computable by Finite Transducers using IFSRepresentations
- Konečn´y
- 2000
(Show Context)
Citation Context |

4 |
Changing Data Representation within the Coq system
- MAGAUD
- 2003
(Show Context)
Citation Context ...hose ubiquitous algorithms. This requires a clever reuse of the proof objects that we supplied during the present work, in order to minimise the amount of additional effort. The recent work by Magaud =-=[11]-=- seems to provide a useful theoretical background for this approach. The second possible improvement on our work is to extend the inductive data types and the lazy algorithms on them to coinductive da... |

1 | Coq contribution - contribNijmegenQArith - 2003 |

1 |
Coq club mailing list correspondence
- Paulin
- 2002
(Show Context)
Citation Context ...ith respect to this predicate. This method is also known as recursion on an ad hoc predicate. For the reasons that we discuss in Sect. 6.2, we use a variant of the method that was suggested by Paulin =-=[15]-=- and further explored in detail in [4]. The domain of the function B will be quotiented by ΨH(a, b, c, d, p), which is an inductively defined predicate that determines which of the 5-tuples (a, b, c, ... |