coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Le Xuan Bach <bachdylan AT gmail.com>
- To: coq-club AT inria.fr
- Cc: Aquinas Hobor <aquinashobor AT live.com>
- Subject: [Coq-Club] Module extraction bug (Ocaml)
- Date: Mon, 9 May 2016 17:20:06 +0800
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=bachdylan AT gmail.com; spf=Pass smtp.mailfrom=bachdylan AT gmail.com; spf=None smtp.helo=postmaster AT mail-io0-f194.google.com
- Ironport-phdr: 9a23:qWK8HB887db6E/9uRHKM819IXTAuvvDOBiVQ1KB91u0cTK2v8tzYMVDF4r011RmSDdSdsqgP07uempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lS8iL1Y/vhqibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwuwwZgf8q9tZBXKPmZOx4COUAVHV1e1wyscbsrFzISRaFznoaSGQf1BRSUCbf6xSvepq5gjbzsKJX0SKadZn8RLs0VSWm5qFDRxrhiSNBPDk8pjKEwvdshb5W9Ury7yd0xJTZNcTMbKJz
Hi Sir/Madam,
I encounter a problem when extracting my Coq project to Ocaml. Here I will try to replicate the bug in it simplest form.
This is the Coq file:
Module Type A.
End A.
Module A_instance : A.
End A_instance.
Module Type B.
End B.
Module Type C (b : B).
Declare Module a : A.
End C.
Module Example (a' : A) (b' : B) (c' : C b' with Module a := A_instance).
End Example.
Extraction Language Ocaml.
Set Extraction AutoInline.
Require Import ExtrOcamlBasic.
Require Import ExtrOcamlString.
Extraction "bug.ml" Example.
This is the extracted file:
module type A =
sig
end
module type B =
sig
end
module Example =
functor (Coq_a':A) ->
functor (Coq_b':B) ->
functor (Coq_c':sig
module Coq_a :
A
end) ->
struct
end
As you can see, the module Example in the ml file fails to recognize that Coq_a in the functor Coq_c' should be A_instance. This bug happens every time I try to declare "Module a : A b c... with Module k := k_instance" in the functor declaration. It seems that Coq tries to unfold Module a and assign corresponding arguments from b,c,.. but fails to preserve the information in k_instance.
Regards,
Xuan Bach.
- [Coq-Club] Module extraction bug (Ocaml), Le Xuan Bach, 05/09/2016
Archive powered by MHonArc 2.6.18.