Appendix Insertion Sort This is the full formalization of insertion sort as presented in section 1.5. It can also be downloaded from [10] under the entry "A brief presentation of Coq". (* A sorting example : (C) Yves Bertot, Pierre Casteran Require Import List. Require Import ZArith. Open Scope Z_scope. Inductive sorted : list Z -> Prop := I sortedO sorted nil I sorted1 : forall z:Z, sorted (z nil) I sorted2 : forall (z1 z2:Z) (l:list Z), z1 <= z2 -> sorted (z2 :: 1) -> sorted (z1 :: z2 1). Hint Resolve sortedO sorted1 sorted2 : sort. Lemma sort_2357 sorted (2 :: 3 Proof. 5 .. 7 auto with sort zarith. Qed. nil) .
23
Embed
Appendix - Springer978-3-662-07964-5/1.pdf · Appendix Insertion Sort This is the full formalization of insertion sort as presented in section 1.5. It can also be downloaded from
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Appendix
Insertion Sort
This is the full formalization of insertion sort as presented in section 1.5. It can also be downloaded from [10] under the entry "A brief presentation of Coq".
(* A sorting example : (C) Yves Bertot, Pierre Casteran
Require Import List. Require Import ZArith. Open Scope Z_scope.
Inductive sorted : list Z -> Prop := I sortedO sorted nil I sorted1 : forall z:Z, sorted (z nil) I sorted2 :
Proof. intros 1 x H; elim H; simpl; auto with sort. intro z; case (Z_le_gt_dec x z); simpl;
auto with sort zarith. intros zi z2; case (Z_le_gt_dec x z2); simpl; intros; case (Z_le_gt_dec x zi); simpl; auto with sort zarith.
Qed.
(* the sorting function *)
Definition sort forall l:list Z, {l' : list Z 1 equiv 1 l' /\ sorted l'}.
induction 1 as [I a 1 IH1]. exists (nil (A:=Z»; split; auto with sort. case IH1; intros l' [HO Hi]. exists (aux a 1'); split. apply equiv_trans with (a apply aux_equiv. apply aux_sorted; auto.
Defined.
1'); auto with sort.
Extraction "insert-sort" aux sort.
References
1. Users contributions to the Coq system. http://coq. inria.fr/. 2. Wilhelm Ackermann. On Hilbert's construction of the real numbers. In van
Heijenoort [84), pages 493-507. 3. Peter Aczel. An introduction to inductive definitions. In J. Barwise, editor,
Handbook of Mathematical Logic, volume 90 of Studies in Logic and the Foundations of Mathematics. North-Holland, 1977.
4. Cuihtlauac Alvarado. Reflexion pour la reecriture dans le calcul des constructions inductives. PhD thesis, Universite de Paris XI, 2002. http://perso.rd.francetelecom.fr/alvarado/publi/these.ps.gz.
5. Antonia Balaa and Yves Bertot. Fix-point equations for well-founded recursion in type theory. In J. Harrison and M. Aagaard, editors, Theorem Proving in Higher Order Logics: 13th International Conference, TPHOLs 2000, volume 1869 of Lecture Notes in Computer Science, pages 1-16. Springer-Verlag, 2000.
6. Antonia Balaa and Yves Bertot. Fonctions recursives generales par iteration en theorie des types. In Journees Francophones pour les Langages Applicatifs, January 2002.
7. Henk Barendregt. Introduction to generalized type systems. Journal of Functional Programming, 1(2):125-154, April 1991.
8. Gilles Barthe and Pierre Courtieu. Efficient reasoning about executable specifications in Coq. In V. Carreno, C. Munoz, and S. Tahar, editors, Proceedings of TPHOLs'02, volume 2410 of Lecture Notes in Computer Science, pages 31-46. Springer-Verlag, 2002.
9. Yves Bertot, Venanzio Capretta, and Kuntal Das Barman. Type-theoretic functional semantics. In Theorem Proving in Higher Order Logics (TPHOLS'02), volume 2410 of Lecture Notes in Computer Science. Springer-Verlag, 2002.
10. Yves Bertot and Pierre Casteran. Coq'Art: examples and exercises. http: //www.labri.fr/Perso/-casteran/CoqArt.
11. Yves Bertot and Ranan Fraer. Reasoning with executable specifications. In Proceedings of the International Joint Conference on Theory and Practice of Software Development (TAPSOFT'95), volume 915 of Lecture Notes in Computer Science, pages 531-545, 1995.
12. Yves Bertot, Nicolas Magaud, and Paul Zimmermann. A proof of GMP square root. Journal of Automated Reasoning, 29:225-252, 2002.
454 References
13. Richard J. Boulton and Paul B. Jackson, editors. Theorem Proving in Higher Order Logics: 14th International Conference, TPHOLs 2001, volume 2152 of Lecture Notes in Computer Science. Springer-Verlag, 2001.
14. Samuel Boutin. Using reflection to build efficient and certified decision procedures. In Theoretical Aspects of Computer Science, volume 1281 of Lecture Notes in Computer Science. Springer-Verlag, 1997.
15. Ana Bove. Simple general recursion in type theory. Nordic Journal of Computing, 8(1):22~42, 2001.
16. Ana Bove and Venanzio Capretta. Nested general recursion and partiality in type theory. In Boulton and Jackson [13), pages 121~135.
17. Robert S. Boyer and J Strother Moore. Proving theorems about lisp functions. Journal of the ACM, 22(1):129-144, 1975.
18. Robert S. Boyer and J Strother Moore. A Computational Logic Handbook. Academic Press, 1988.
19. William H. Burge. Recursive Programming Techniques. Addison-Wesley, 1975. 20. Venanzio Capretta. Certifying the fast Fourier transform with Coq. In Boulton
and Jackson [13), pages 154~168. 21. Olga Caprotti and Martijn Oostdijk. Formal and efficient primality proofs by use
of computer algebra oracles. Journal of Symbolic Computation, 32(1/2):55~70, July 2001.
22. Pierre Casteran and Davy Rouillard. Reasoning about parametrized automata. In Proceedings, 8-th International Conference on Real- Time System, volume 8, pages 107~119, 2000.
23. Emmanuel Chailloux, Pascal Manoury, and Bruno Pagano. Developpement d'applications avec Objective CAML. O'Reilly, 2000.
24. Alonzo Church. A formulation of the simple theory of types. Journal of Symbolic Logic, 5(1):56~68, 1940.
25. Robert L. Constable et al. Implementing Mathematics with the Nuprl Development System. Prentice Hall, 1986.
26. Thierry Coquand. An analysis of Girard's paradox. In Symposium on Logic in Computer Science, IEEE Computer Society Press, 1986.
27. Thierry Coquand. Metamathematical investigations on a calculus of constructions. In P. Odifreddi, editor, Logic and Computer Science. Academic Press, 1990.
28. Thierry Coquand and Gerard Huet. The calculus of constructions. Information and Computation, 76, 1988.
29. Solange Coupet-Grimal. LTL in Coq. Technical report, Contributions to the Coq System, 2002.
30. Solange Coupet-Grimal. An axiomatization of linear temporal logic in the calculusofinductiveconstructions. Journal of Logic and Computation, 13(6):801~813, 2003.
31. Solange Coupet-Grimal and Line Jakubiec. Hardware verification using coinduction in coq. In TPHOLs'99, volume 1690 of Lecture Notes in Computer Science. Springer-Verlag, 1999.
32. Haskell B. Curry and Robert Feys. Combinatory Logic 1. North- Holland, 1958. 33. Olivier Danvy. Back to direct style. In Bernd Krieg-Bruckner, editor, ESOP
'92, 4th European Symposium on Programming, Rennes, Prance, February 1992, Proceedings, volume 582, pages 130~ 150. Springer-Verlag, 1992.
References 455
34. Nicolaas G. de Bruijn. The mathematical language automath, its usage and some of its extensions. In Symposium on Automatic Demonstration, volume 125 of Lectur Notes in Mathematics. Springer-Verlag, 1970.
35. Richard Dedekind. Was sind und was sollen die Zahlen? Vieweg, 1988. 36. David Delahaye. Conception de langages pour decrire les preuves et les automa
tisations dans les outils d'aide a la preuve, Une etude dans Ie cadre du systeme Coq. PhD thesis, Universite de Paris VI, Pierre et Marie Curie, 2001.
37. Development team. The Coq proof assistant. Documentation, system download. Contact: http://coq.inria.fr/.
38. Edsger W. Dijkstra. A discipline of Programming. Prentice Hall, 1976. 39. Peter Dybjer. A general formulation of simultaneous inductive-recursive defini
tions in type theory. Journal of Symbolic Logic, 65(2), 2000. 40. Jean-Christophe Filliiltre. Verification of non-functional programs using inter
pretations in type theory. Journal of Functional Programming, 13(4):709-745, 2003.
41. Jean-Christophe Filliiltre. L'outil de verification Why. http://why.lri.fr/. 42. Robert W. Floyd. Assigning meanings to programs. In J. T. Schwartz, ed
itor, Mathematical Aspects of Computer Science: 19th Symposium on Applied Mathematics, pages 19-31, 1967.
43. Jean-Baptiste-Joseph Fourier. Oeuvre de Fourier. Gauthier-Villars, 1890. Publie par les soins de Gaston Darboux.
44. Eduardo Gimenez. A tutorial on recursive types in Coq. Documentation of the Coq system.
45. Eduardo Gimenez. An application of co-inductive types in Coq: Verification of the alternating bit protocol. In Proceedings of the 1995 Workshop on Types for Proofs and Programs, volume 1158 of Lecture Notes in Computer Science, pages 135-152. Springer-Verlag, 1995.
46. Jean-Yves Girard, Yves Lafont, and Paul Taylor. Proofs and types. Cambridge University Press, 1989.
47. Michael Gordon and Tony Melham. Introduction to HOL. Cambridge University Press, 1993.
48. Michael Gordon, Robin Milner, and Christopher Wadsworth. Edinburgh LCF: A mechanized logic of computation, volume 78 of Lecture Notes in Computer Science. Springer-Verlag, 1979.
49. Arend Heyting. Intuitionism - an Introduction. North-Holland, 1971. 50. David Hilbert. On the infinite. In van Heijenoort [84], pages 367-392. 51. Charles Anthony Richard Hoare. An axiomatic basis for computer programming.
Communications of the ACM, 12(10):576-580, 1969. 52. William A. Howard. The formulae-as-types notion of construction. In J. P.
Seldin and J. R. Hindley, editors, To H. B. Curry: Essays on combinatory logic, Lambda Calculus and Formalism, pages 479-490. Academic Press, 1980.
53. Gerard Huet. Induction principles formalized in the calculus of constructions. In K. Fuchi and M. Nivat, editors, Programming of Future Generation Computers, pages 205-216. North-Holland, 1988.
54. Gilles Kahn. Natural semantics. In K. Fuchi and M. Nivat, editors, Programming of Future Generation Computers. North-Holland, 1988.
55. Matt Kaufmann, Panagiotis Manolios, and J. Strother Moore. Computer-aided reasoning: an approach. Kluwer Academic Publishing, 2000.
456 References
56. Xavier Leroy. Manifest types, modules, and separate compilation. In Proceedings of the 21st Symposium on Principles of Progmmming Languages, pages 109-122. ACM,1994.
57. Xavier Leroy. A modular module system. Journal of Functional Progmmming, 10(3), 2000.
58. Pierre Letouzey. A new extraction for Coq. In Herman Geuvers and Freek Wiedijk, editors, TYPES 2002, volume 2646 of Lecture Notes in Computer Science. Springer-Verlag, 2003.
59. Zhaohui Luo. Computation and Reasoning - A Type Theory for Computer Science. Oxford University Press, 1994.
60. Zhaohui Luo and Randy Pollack. Lego proof development system: user's manual. Technical Report ECS-LFCS-92-211, LFCS (Edinburgh University), 1992.
61. Assia Mahboubi and LOIc Pottier. Elimination des quantificateurs sur les reels en Coq. In Journees Fmncophones des Langages Applicatifs, Anglet, Jan 2002.
62. Per Martin-L<)f. Intuitionistic type theories. Bibliopolis, 1984. 63. Conor McBride. Elimination with a motive. In Types for Proofs and Pro
gmms'2000, volume 2277, pages 197-217, 2002. 64. Conor McBride and James McKinna. The view from the left. Journal of Func
tional Progmmming, 14(1), 2004. 65. John C. Mitchell. Type systems for programming languages. In J. van Leeuwen,
editor, Handbook of Theoretical Computer Science, Volume B :Formal Models and Semantics. MIT Press and Elsevier, 1994.
66. Jean-Fran~ois Monin. Understanding Formal Methods. Springer-Verlag, 2002. 67. Bengt Nordstrom, Kent Petersson, and Jan Smith. Martin-Iof's type theory. In
Handbook of Logic in Computer Science, Vol. 5. Oxford University Press, 1994. 68. Sam Owre, Sreeranga P. Rajan, John M. Rushby, Natarajan Shankar, and Man
dayam K. Srivas. PVS: Combining specifications, proof checking and model checking. In Rajeev Alur and Thomas A. Henzinger, editors, Computer Aided Verification, CA V'96, volume 1102 of Lecture Notes in Computer Science, pages 411-414, 1996.
69. Catherine Parent. Synthesizing proofs from programs in the calculus of inductive constructions. In Proceedings of MPC'1995, volume 947 of Lecture Notes in Computer Science, pages 351-379, 1995.
70. Christine Paulin-Mohring. Inductive definitions in the system Coq - rules and properties. In M. Bezem and J.-F. Groote, editors, Proceedings of the conference Typed Lambda Calculi and Applications, volume 664 of Lecture Notes in Computer Science. Springer-Verlag, 1993. LIP research report 92-49.
71. Christine Paulin-Mohring. Definitions Inductives en Theorie des Types d'Ordre Superieur. Habilitation a diriger les recherches, Universite Claude Bernard Lyon I, December 1996.
72. Christine Paulin-Mohring and Benjamin Werner. Synthesis of ML programs in the system Coq. Journal of Symbolic Computation, 15:607-640, 1993.
73. Lawrence C. Paulson. The foundation of a generic theorem prover. Journal of Automated Reasoning, 5(3):363-397, 1989.
74. Lawrence C. Paulson. ML for the Working Progmmmer. Cambridge University Press, 1996.
75. Amir Pnueli. The temporal logic of programs. In Proceedings of the 18th Annual IEEE Symposium on Foundations of Computer Science, 1977.
76. Olivier Pons. Ingenierie de preuve. In Journees Francophones pour les Langages Applicatifs, January 2000.
References 457
77. Dag Prawitz. Ideas and results in proof theory. In Proceedings of the second Scandinavian logic symposium. North-Holland, 1971.
78. William Pugh. The omega test: a fast and practical integer programming algorithm for dependence analysis. CACM, 8:102-114, 1992.
79. Dana Scott. Constructive validity. In Proceedings of Symposium on Automatic Demonstmtion, volume 125 of Lecture Notes in Mathematics, pages 237-275. Springer-Verlag, 1970.
80. Alfred Tarski. The semantic conception of truth and the foundations of semantics. Philosophy and Phenomenological Research, 4, 1944. Transcription available at www.ditext.com/tarski/tarski. html.
81. Coq Development Team. The Coq reference manual. LogiCal Project, http://coq. inria.fr/.
82. Laurent Thery. A certified version of Buchberger's algorithm. In Automated Deduction-CADE-IS, volume 1421 of Lecture Notes in Artificial Intelligence, pages 349-364. Springer-Verlag, 1998.
83. Andrzej Trybulec. The Mizar-qc/6000 logic information language. ALLC Bulletin, 6(2):136-140, 1978.
84. Jean van Heijenoort, editor. From Frege to Cadel: a source book in mathematical logic, 1879-1931. Harvard University Press, 1981.
85. Mitchell Wand. Continuation-based program transformation strategies. Journal of the ACM, 27(1):164-180, January 1980.
Index
This index is divided in two main sections. The first one refers to general concepts of Coq and the Calculus of Inductive Constructions. The second one lists main definitions and theorems from this book. We only refer to the page where a constant is defined, not to all pages where it is used.
Monographs in Theoretical Computer Science· An EA TCS Series
K. Jensen Coloured Petri Nets Basic Concepts, Analysis Methods and Practical Use, Vol. 1 2nd ed.
K. Jensen Coloured Petri Nets Basic Concepts, Analysis Methods and Practical Use, Vol. 2
K. Jensen Coloured Petri Nets Basic Concepts, Analysis Methods and Practical Use, Vol. 3
A. Nait Abdallah The Logic of Partial Information
Z. Fiilop, H. Vogler Syntax-Directed Semantics Formal Models Based on Tree Transducers
A. de Luca, S. Varricchio Finiteness and Regularity in Semigroups and Formal Languages
E. Best, R. Devillers, M. Koutny Petri Net Algebra
S.P. Demri, E. S. Orlowska Incomplete Information: Structure, Inference, Complexity
J.C.M. Baeten, C.A. Middelburg Process Algebra with Timing
L.A. Hemaspaandra, L.Torenvliet Theory of Semi-Feasible Algorithms E. Fink, D. Wood Restricted -Orientation Convexity
Zhou Chao chen, M. R. Hansen Duration Calculus A Formal Approach to Real-Time Systems M. GroBe-Rhode Semantic Integration of Heterogeneous Software Specifications
Texts in Theoretical Computer Science' An EATCS Series
J.1. Baldzar, J. Diaz, J. Gabarr6 Structural Complexity I
M. Garzon Models of Massive Parallelism Analysis of Cellular Automata and Neural Networks
J. Hromkovic Communication Complexity and Parallel Computing
A. Leitsch The Resolution Calculus
G. Paun, G. Rozenberg, A. Salomaa DNA Computing New Computing Paradigms
A. Salomaa Public-Key Cryptography 2nd ed.
K. Sikkel Parsing Schemata A Framework for Specification and Analysis of Parsing Algorithms
H. Vollmer Introduction to Circuit Complexity A Uniform Approach
W. Fokkink Introduction to Process Algebra
K. Weihrauch Computable Analysis An Introduction
J. Hromkovic Algorithmics for Hard Problems Introduction to Combinatorial Optimization, Randomization, Approximation, and Heuristics 2nded.
S. Jukna Extremal Combinatorics With Applications in Computer Science
P. Clote, E. Kranakis Boolean Functions and Computation Models
1. A. Hemaspaandra, M. Ogihara The Complexity Theory Companion
C.S. Calude Information and Randomness. An Algorithmic Perspective 2nded.
J. Hromkovic Theoretical Computer Science Introduction to Automata, Computability, Complexity, Algorithmics, Randomization, Communication and Cryptography
A. Schneider Verification of Reactive Systems Formal Methods and Algorithms
S. Ronchi Della Rocca, 1. Paolini The Parametric Lambda Calculus A Meta-Model for Computation
Y. Bertot, P. Casteran Interactive Theorem Proving and Program Development Coq' Art: The Calculus of Inductive Constructions
1. Libkin Elements of Finite Model Theory
The New Springer Global Website
Be the fi rst to know • Benefit from new practice-driven features.
• Search all books and journals -now faster and easier than ever before.
• Enjoy big savings through online sales.
springeronl ine.com - the innovative website with you in focus.