Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Extracting partial implementations

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Extracting partial implementations


Chronological Thread 
  • From: Fabian Kunze <fkunze AT fakusb.de>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Extracting partial implementations
  • Date: Mon, 29 May 2017 14:50:58 +0000
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=fkunze AT fakusb.de; spf=None smtp.mailfrom=fkunze AT fakusb.de; spf=None smtp.helo=postmaster AT tucana.uberspace.de
  • Ironport-phdr: 9a23:a1dRJhc/G2uK0C0Yv2LyBKW/lGMj4u6mDksu8pMizoh2WeGdxcu/YR7h7PlgxGXEQZ/co6odzbGH7ea9BiRAuc/H6yFdNsQUFlcssoY/oU8JOI2/NQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7MhdpdKyuQtaBx8u42Pqv9JLNfg5GmCSyYa9oLBWxsA7dqtQajZFsJ6s1yxbFuHtFduZLzm9sOV6fggzw68m08ZNh6Shcp+4t+8tdWqjmYqo0SqBVAzshP20p/sPnsgXNQxWS7XUGSGUWlRRIAwnB7B7kW5r6rzX3uOlg1iSEJMP6Vb87Vyis4KdtUx/olTwINyUl/2HNi8x/l7xUrRS8rBFi2YHUYYWVNP1jfqPBeN4RWGRMUtpNWyFHH4ixaZYEAegcMuZCt4TyqFUOohm+CweiB+3h1yFGiWPt0KIgz+gsCxvL0BA8E98MtnnfsdX7NL0VUeCw1KTGzS/MYOhX2Tjn7ojDbxUvoeyKXbNxb8Xa1E4iFw3GjlWNr4zkPi2a2/8Ds2eB7OpgSPmvhHU9pw5svDei38EhgZTHiIISz1DL7yR5wIAtKN2kVkF7ZMakHIFVtyGeMYZ9X8AsQ3lwtSs+yrAKo4O3cScExZg92hLSaeKLf5KW7h7/V+ucJypzimh/d7KlnRmy9FCtyu3iWcmw11ZHtjZFksTQuX8X0Rzc8NKLSuZm8Ui/wzaPzBjT5ftYLk8qj6bUNoAuzqYxlpoVr0vDAjf7lUH2gaOMa0kp9eal5/76brjkuJOQLZF4hh39P6g2n8ywG+U4MgwAX2iB/uS80aXu/UP6QLVXiP03k7fWvYvUJcsBpa65HhRV3Z055xmiETiqyM4YkmUfLFJZZBKHiJDkNE3JIPDhFPuwn1CskCpwyP3dJb3gApDNLmDZn7v7fLZ97VRcyAspwtxF6ZJUEOJJHPWmUUjo8dfcExURMgquwu+hBs8u+JkZXDehC6WYOaWakkKO9O9nd+ePeYkHtR7zIvs4/PSogXJvygxVRrWgwZZCMCPwJf9hOUjMOXc=

Hi,

a workaround should be to manually specify one eta-expanded value to fail only once executed (and not during module initialisation):

Definition not_yet_implemented {A} : unit -> A. Admitted.
Extract Constant not_yet_implemented => "(fn x => failwith ""not yet implemented"")".  

usage:

Definition foo (x:nat) :bool := not_yet_implemented tt.

I hope this helps,

Fabian

Benjamin C. Pierce <bcpierce AT cis.upenn.edu> schrieb am Mo., 29. Mai 2017 um 16:21 Uhr:
I’d like to be able to extract an ML program from a Coq file that is missing some definitions.  For example, suppose I have a file temp.v containing

Definition foo (x:nat) : bool. Admitted.
Definition bar (x:nat) : bool := true.

and I want to play with bar before finishing foo.  If I do

Require Import temp.
Extraction Library temp.

what I get in temp.ml is

open Datatypes

(** val foo : nat -> bool **)

let foo =
  failwith "AXIOM TO BE REALIZED"

(** val bar : nat -> bool **)

let bar _ =
  Coq_true

which is not helpful (executing this code simply raises an error, whether or not foo is called).  

Is there a better way?

Thanks!

      - Benjamin






Archive powered by MHonArc 2.6.18.

Top of Page