Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Optimizing outputs of program extraction?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Optimizing outputs of program extraction?


chronological Thread 
  • From: Adam Chlipala <adamc AT cs.berkeley.edu>
  • To: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] Optimizing outputs of program extraction?
  • Date: Thu, 22 Sep 2005 14:28:14 -0700
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Stefan Karrmann wrote:
For example, I would like to replace all uses of Coq's nat with uses of OCaml's int, relying on dynamic checks to determine when the representation is not precise enough and abort the execution. I can think of some simple type-directed syntactic rewrite rules that would accomplish this, and there are a number of other basic but very worthwhile optimizations of this kind.

Can you use Extract files? I.e. files which define how the export constants
to different target languages. They would need an import clause (preface)
and some helper functions in an epilogue.

This does part of the job, but, especially for the example of 'nat', it's also necessary to translate Coq 'match' expressions in a different way. I've actually hacked up the extraction source to do this, and I'm successfully running the resulting code.




Archive powered by MhonArc 2.6.16.

Top of Page