tags/logicszack's home pagehttp://upsilon.cc/~zack/tags/logics/zack's home pageikiwiki2009-11-28T12:00:16Zcoq as a geek toyhttp://upsilon.cc/~zack/blog/posts/2007/04/coq_as_a_geek_toy/2009-11-28T12:00:16Z2007-04-10T09:26:50Z
<h1>Coq: Happy to See it as a Geek Toy</h1>
<p><a href=
"http://lambdaman.blogspot.com/2007/04/latest-shiny-geek-toy-coq.html">
Daniel</a>, I'm really happy you defined <a href=
"http://coq.inria.fr">Coq</a> a <em>geek toy</em>. Usually such
pieces of software are more seen as <em>academic toys</em>, seeing
it <em>promoted</em> as a geeky software is a joy to me.</p>
<p>I'm a developer of <a href=
"http://matita.cs.unibo.it">Matita</a>, a concurrent system of Coq
(yet less mature a of today). I'm happy to give some more info
about Coq (and hence about Matita, which is based on the same
logical foundation of Coq).</p>
<p>Coq is not really a programming language (even if the CoqArt
book says so, to attract the developer community), it is mainly a
<em>proof assistant</em>; i.e. a software in which you give
definitions, state theorems and prove them. The added value of the
system wrt plain pen and paper is that it grants that you won't be
able to produce incorrect proofs (of course you are still free to
prove useless theorems <img src="http://upsilon.cc/~zack/smileys/smile.png" alt=":-)" /> ).</p>
<p>It is more expressive than predicate calculus, technically it is
based on the Calculus of (Co)Inductive Constructions, but the most
important differences are that you can give inductive definitions
of predicates (or define recursive data structures) and the system
will let you play with them freely automatically constructing
recursors on these data types. You can even define infinite data
structures (using co-induction) mimicking lazy types available in
languages as Haskell.</p>
<p>Regarding the synergy of Coq with <a href=
"http://caml.inria.fr">OCaml</a>: yes, you can prove in Coq the
correctness of OCaml program, but actually not more than you can do
with programs written in other programming languages (see for
example <a href="http://why.lri.fr/">Why</a>, <a href=
"http://krakatoa.lri.fr/">Krakatoa</a>, and <a href=
"http://why.lri.fr/caduceus/">Caduceus</a> for some practical tools
to prove properties about Java and C programs).</p>
<p>Yet the synergy with OCaml is even more than that: once you
proved properties like the existence of, say, a prime number
greater than a given prime number, you can ask Coq to generate for
you (using a feature called <em>extraction</em>) an OCaml program
which consumes as input a prime number and returns the next one.
More generally you can extract programs from (suitable) proofs.</p>
<p>Some info on the Debian side: thanks to smimou Coq has been in
Debian for a long time now and Why/Krakatoa/Caduceus are coming
soon.</p>
<p>Happy hacking!</p>