HOME

TheInfoList



OR:

Coq is an interactive theorem prover first released in 1989. It allows for expressing
mathematical Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
assertions, mechanically checks proofs of these assertions, helps find formal proofs, and extracts a certified program from the
constructive proof In mathematics, a constructive proof is a method of proof that demonstrates the existence of a mathematical object by creating or providing a method for creating the object. This is in contrast to a non-constructive proof (also known as an existenc ...
of its
formal specification In computer science, formal specifications are mathematically based techniques whose purpose are to help with the implementation of systems and software. They are used to describe a system, to analyze its behavior, and to aid in its design by verif ...
. Coq works within the theory of the calculus of inductive constructions, a derivative of the calculus of constructions. Coq is not an
automated theorem prover Automated theorem proving (also known as ATP or automated deduction) is a subfield of automated reasoning and mathematical logic dealing with proving mathematical theorems by computer programs. Automated reasoning over mathematical proof was a m ...
but includes automatic theorem proving
tactics Tactic(s) or Tactical may refer to: * Tactic (method), a conceptual action implemented as one or more specific tasks ** Military tactics, the disposition and maneuver of units on a particular sea or battlefield ** Chess tactics ** Political tact ...
( procedures) and various
decision Decision may refer to: Law and politics *Judgment (law), as the outcome of a legal case *Landmark decision, the outcome of a case that sets a legal precedent * ''Per curiam'' decision, by a court with multiple judges Books * ''Decision'' (novel ...
procedures. The
Association for Computing Machinery The Association for Computing Machinery (ACM) is a US-based international learned society for computing. It was founded in 1947 and is the world's largest scientific and educational computing society. The ACM is a non-profit professional member ...
awarded Thierry Coquand, Gérard Huet, Christine Paulin-Mohring, Bruno Barras, Jean-Christophe Filliâtre, Hugo Herbelin, Chetan Murthy, Yves Bertot, and Pierre Castéran with the 2013
ACM Software System Award The ACM Software System Award is an annual award that honors people or an organization "for developing a software system that has had a lasting influence, reflected in contributions to concepts, in commercial acceptance, or both". It is awarded b ...
for Coq. Coq is a wordplay on the name of Thierry Coquand, Calculus of Constructions or "CoC" and is following the French tradition to name tools after animals (''coq'' in French meaning rooster).


Overview

When viewed as a programming language, Coq implements a dependently typed
functional programming language In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
; when viewed as a logical system, it implements a higher-order
type theory In mathematics, logic, and computer science, a type theory is the formal presentation of a specific type system, and in general type theory is the academic study of type systems. Some type theories serve as alternatives to set theory as a founda ...
. The development of Coq has been supported since 1984 by
INRIA The National Institute for Research in Digital Science and Technology (Inria) () is a French national research institution focusing on computer science and applied mathematics. It was created under the name ''Institut de recherche en informatiq ...
, now in collaboration with
École Polytechnique École may refer to: * an elementary school in the French educational stages normally followed by secondary education establishments (collège and lycée) * École (river), a tributary of the Seine flowing in région Île-de-France * École, Savoi ...
,
University of Paris-Sud Paris-Sud University (French: ''Université Paris-Sud''), also known as University of Paris — XI (or as Université d'Orsay before 1971), was a French research university distributed among several campuses in the southern suburbs of Paris, in ...
, Paris Diderot University, and
CNRS The French National Centre for Scientific Research (french: link=no, Centre national de la recherche scientifique, CNRS) is the French state research organisation and is the largest fundamental science agency in Europe. In 2016, it employed 31,63 ...
. In the 1990s, ENS Lyon was also part of the project. The development of Coq was initiated by Gérard Huet and Thierry Coquand, and more than 40 people, mainly researchers, have contributed features to the core system since its inception. The implementation team has successively been coordinated by Gérard Huet, Christine Paulin-Mohring, Hugo Herbelin, and Matthieu Sozeau. Coq is mainly implemented in
OCaml OCaml ( , formerly Objective Caml) is a general-purpose, multi-paradigm programming language Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms. ...
with a bit of C. The core system can be extended by way of a plug-in mechanism. The name means '
rooster The chicken (''Gallus gallus domesticus'') is a domesticated junglefowl species, with attributes of wild species such as the grey and the Ceylon junglefowl that are originally from Southeastern Asia. Rooster or cock is a term for an adult m ...
' in
French French (french: français(e), link=no) may refer to: * Something of, from, or related to France ** French language, which originated in France, and its various dialects and accents ** French people, a nation and ethnic group identified with Franc ...
and stems from a French tradition of naming research development tools after animals. Up until 1991, Coquand was implementing a language called the Calculus of Constructions and it was simply called CoC at this time. In 1991, a new implementation based on the extended Calculus of Inductive Constructions was started and the name was changed from CoC to Coq in an indirect reference to Coquand, who developed the Calculus of Constructions along with Gérard Huet and contributed to the Calculus of Inductive Constructions with Christine Paulin-Mohring. Coq provides a specification language called Gallina (" hen" in Latin, Spanish, Italian and Catalan). Programs written in Gallina have the weak normalization property, implying that they always terminate. This is a distinctive property of the language, since infinite loops (non-terminating programs) are common in other programming languages, and is one way to avoid the halting problem. As an example, a proof of commutativity of addition on natural numbers in Coq: plus_comm = fun n m : nat => nat_ind (fun n0 : nat => n0 + m = m + n0) (plus_n_0 m) (fun (y : nat) (H : y + m = m + y) => eq_ind (S (m + y)) (fun n0 : nat => S (y + m) = n0) (f_equal S H) (m + S y) (plus_n_Sm m y)) n : forall n m : nat, n + m = m + n stands for
mathematical induction Mathematical induction is a method for proving that a statement ''P''(''n'') is true for every natural number ''n'', that is, that the infinitely many cases ''P''(0), ''P''(1), ''P''(2), ''P''(3), ...  all hold. Informal metaphors help ...
, for substitution of equals, and for taking the same function on both sides of the equality. Earlier theorems are referenced showing m = m + 0 and S (m + y) = m + S y.


Notable uses


Four color theorem and SSReflect extension

Georges Gonthier Georges Gonthier is a Canadian computer scientist and one of the leading practitioners in formal mathematics. He led the formalization of the four color theorem and Feit–Thompson proof of the odd-order theorem. (Both were written using the ...
of
Microsoft Research Microsoft Research (MSR) is the research subsidiary of Microsoft. It was created in 1991 by Richard Rashid, Bill Gates and Nathan Myhrvold with the intent to advance state-of-the-art computing and solve difficult world problems through technolog ...
in
Cambridge Cambridge ( ) is a university city and the county town in Cambridgeshire, England. It is located on the River Cam approximately north of London. As of the 2021 United Kingdom census, the population of Cambridge was 145,700. Cambridge bec ...
,
England England is a country that is part of the United Kingdom. It shares land borders with Wales to its west and Scotland to its north. The Irish Sea lies northwest and the Celtic Sea to the southwest. It is separated from continental Europe ...
and Benjamin Werner of
INRIA The National Institute for Research in Digital Science and Technology (Inria) () is a French national research institution focusing on computer science and applied mathematics. It was created under the name ''Institut de recherche en informatiq ...
used Coq to create a surveyable proof of the
four color theorem In mathematics, the four color theorem, or the four color map theorem, states that no more than four colors are required to color the regions of any map so that no two adjacent regions have the same color. ''Adjacent'' means that two regions sha ...
, which was completed in 2002. Their work led to the development of the SSReflect ("Small Scale Reflection") package, which was a significant extension to Coq. Despite its name, most of the features added to Coq by SSReflect are general-purpose features and are not limited to the computational reflection style of proof. These features include: * Additional convenient notations for irrefutable and refutable
pattern matching In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact: "either it will or will not be ...
, on
inductive type In type theory, a system has inductive types if it has facilities for creating a new type from constants and functions that create terms of that type. The feature serves a role similar to data structures in a programming language and allows a ...
s with one or two constructors * Implicit arguments for functions applied to zero arguments, which is useful when programming with
higher-order function In mathematics and computer science, a higher-order function (HOF) is a function that does at least one of the following: * takes one or more functions as arguments (i.e. a procedural parameter, which is a parameter of a procedure that is itse ...
s * Concise anonymous arguments * An improved set tactic with more powerful matching * Support for reflection SSReflect 1.11 is freely available, dual-licensed under the open source CeCILL-B or CeCILL-2.0 license, and compatible with Coq 8.11.


Other applications

*
CompCert CompCert is a formally verified optimizing compiler for a large subset of the C99 programming language (known as Clight) which currently targets PowerPC, ARM, RISC-V, x86 and x86-64 architectures. This project, led by Xavier Leroy, started of ...
: an optimizing compiler for almost all of the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well a ...
which is largely programmed and proven correct in Coq. *
Disjoint-set data structure In computer science, a disjoint-set data structure, also called a union–find data structure or merge–find set, is a data structure that stores a collection of disjoint (non-overlapping) sets. Equivalently, it stores a partition of a set ...
: correctness proof in Coq was published in 2007. *
Feit–Thompson theorem In mathematics, the Feit–Thompson theorem, or odd order theorem, states that every finite group of odd order is solvable. It was proved by . History conjectured that every nonabelian finite simple group has even order. suggested using t ...
: formal proof using Coq was completed in September 2012.


See also

* Calculus of constructions *
Curry–Howard correspondence In programming language theory and proof theory, the Curry–Howard correspondence (also known as the Curry–Howard isomorphism or equivalence, or the proofs-as-programs and propositions- or formulae-as-types interpretation) is the direct rela ...
*
Intuitionistic type theory Intuitionistic type theory (also known as constructive type theory, or Martin-Löf type theory) is a type theory and an alternative foundation of mathematics. Intuitionistic type theory was created by Per Martin-Löf, a Swedish mathematician an ...
*
List of proof assistants In computer science and mathematical logic, a proof assistant or interactive theorem prover is a software tool to assist with the development of formal proofs by human-machine collaboration. This involves some sort of interactive proof editor ...


References


External links


The Coq proof assistant
– the official English website
coq/coq
– the project's source code repository on
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, cont ...

JsCoq Interactive Online System
– allows Coq to be run in a web browser, without the need for any software installation

– a library to process Coq snippets embedded in documents, showing goals and messages for each Coq sentence
Coq WikiMathematical Components library
– widely used library of mathematical structures, part of which is the SSReflect proof language
Constructive Coq Repository at NijmegenMath Classes
*{{Openhub, coq, Coq ; Textbooks

– a book on Coq by Yves Bertot and Pierre Castéran
Certified Programming with Dependent Types
– online and printed textbook by Adam Chlipala
Software Foundations
– online textbook by
Benjamin C. Pierce Benjamin Crawford Pierce is the Henry Salvatori Professor of computer science at the University of Pennsylvania. Pierce joined Penn in 1998 from Indiana University and held research positions at the University of Cambridge and the University of ...
et al.
An introduction to small scale reflection in Coq
– a tutorial on SSReflect by Georges Gonthier and Assia Mahboubi ; Tutorials
Introduction to the Coq Proof Assistant
– video lecture by Andrew Appel at
Institute for Advanced Study The Institute for Advanced Study (IAS), located in Princeton, New Jersey, in the United States, is an independent center for theoretical research and intellectual inquiry. It has served as the academic home of internationally preeminent schola ...

Video tutorials for the Coq proof assistant
by Andrej Bauer. Proof assistants Free theorem provers Dependently typed languages Educational math software OCaml software Free software programmed in OCaml Functional languages Programming languages created in 1984 1989 software Extensible syntax programming languages