Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I just finished reading Coq in a Hurry, which is a very good tutorial I found online. I got very exited about Coq.

Is there any material on practical programming in Coq? Like printing the result of a function, String output, reading/writing to a file, etc.? I know it is possible to use code extraction to generate haskell or ocaml code, but I cannot find good examples or a tutorial.

Further, is there something similar to the Agda FFI in Coq?

share|improve this question
3  
"I got very exited about Coq." Be careful when talking about Coq in public. :) – Lord Tydus Apr 19 '12 at 23:38

3 Answers

Adam Chlipala explains at some length, including Generic Programming (for Coq users), which you may find helpful.

share|improve this answer

There is no Foreign Function Interface in Coq. Calling an external function does not make sense as foreign code cannot be verified. You cannot even prove termination to Coq. I asked pretty much the same question to Pierre Letouzey during a 2010 summer school on Coq and he replied that the idea is to write the tricky algorithms with Coq and extract a verified implementation in Ocaml or Haskell (he was working on the latter then) to integrate in a "real program".

You can find something about how to extract code in the manual.

share|improve this answer

There is the Petit guide de survie en Coq ("small Coq survival guide") but as far as I know there is only a french version. However, it seems to be simple enough to get a understandable result with an automatic translation tool (here with Google).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.