Stefano Zacchiroli: coq as a geek toy
Coq: Happy to See it as a Geek Toy
Daniel, I'm really happy you defined Coq a geek toy. Usually such
pieces of software are more seen as academic toys, seeing
it promoted as a geeky software is a joy to me.
I'm a developer of Matita, 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).
Coq is not really a programming language (even if the CoqArt
book says so, to attract the developer community), it is mainly a
proof assistant; 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
).
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.
Regarding the synergy of Coq with OCaml: 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 Why, Krakatoa, and Caduceus for some practical tools
to prove properties about Java and C programs).
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 extraction) an OCaml program
which consumes as input a prime number and returns the next one.
More generally you can extract programs from (suitable) proofs.
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.
Happy hacking!
).
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.
Regarding the synergy of Coq with OCaml: 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 Why, Krakatoa, and Caduceus for some practical tools
to prove properties about Java and C programs).
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 extraction) an OCaml program
which consumes as input a prime number and returns the next one.
More generally you can extract programs from (suitable) proofs.
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.
Happy hacking!