coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] Running make in CoqIDE 8.9.1 with _CoqProject file works but Forward one command fails
Chronological Thread
- From: Donald Leung <i.donaldl AT me.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Running make in CoqIDE 8.9.1 with _CoqProject file works but Forward one command fails
- Date: Fri, 6 Sep 2019 19:46:17 +0800
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=i.donaldl AT me.com; spf=Pass smtp.mailfrom=i.donaldl AT me.com; spf=None smtp.helo=postmaster AT pv50p00im-ztdg10021101.me.com
- Ironport-phdr: 9a23:A42+MBa2dshhJs8nANzaDU7/LSx+4OfEezUN459isYplN5qZoMm/bnLW6fgltlLVR4KTs6sC17OM9fm/CCdbuN6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vMhm6txjdu8sSjIdtJKs91wbCr2dVdehR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2QKJBAjg+PG87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD+/4apnVAPkhSEaPDM/7WrZiNF/jLhDrRyhuxNxzIHbbpybOvpwYK3Sf9AUS21aU8ZNTixBB5+wb4sTA+cDO+tTsonzp0EJrRu7HQSiCuTvyjlSiX/ywKIxzuIvHh/b3AwmENIFrXPZrNTvOKgPVuC1yrPHzTHeYPNSwjr97ZbHfgo9rvGLWLJ9aMzcwlQhGQPCi1Wfs43lPzWN2+QCsmib8+pgVf+0hGI9tw5xpT2vy8ExgYfKnoIY0k3I+CdjzIs1JtC0Uk92bcSrHZZfry2WKpZ6Tt04T211pSo3yacKtYClcCUL0pgqyBjSYOGdfYeS+BLsTuORLC94hH17fLK/gA6/8VC+yuD8SsW0yEpGojZEktnJr3wM1gDT5dWISvdg4kutxSiD2x3O5u1YPEw4j6/bJIA7zrEskZoTtFzPHi7wmErokK+bblgo9+qy5+nnYbjqvJ6RO5V7hwzxKqgun9awAeU8MggARWib/uG82aXi/UHjXbpKifs2nbPdsJ/HIcQWvau5DBFP3ok/7Ba/Ci+q0M4EknkfMFJFZBWHgpD1NFHJOfD0FOuwg1CxkDhw3P3GJb3gApDVLnfZirvhfLB961RdyAUp19xf6YhUWfk9J6f4XVa0v9jFBDc4NRa1yqDpEoZTzIQbDE6IBKadPOv2vEKO6ap7Iq+AY4kcvDr5A/0oofXpiClqyhcmYaC10M5POziDFfN8LhDBOCe+spI6CW4P+zEGYqnqhVmFCmcBf2jvB7pkvjA+TZC6AYiaHtj32eXZhWG+E9tdYWUUUgndQ0etTJ2NXrI3UAzXJ8ZgljIeUr3xGYoskxqpsV2jkuY1Hq/v4iQd8Knb+p1t/eSDxxQ/szdzCpbF3g==
Dear Théo,
Many thanks for your suggestions and advice (and for filing the bug report!)
- I used the command line to generate the Makefile from _CoqProject before
running make on CoqIDE as suggested and got consistent results between the
make output and the interactive mode.
Cheers,
Donald
> Théo Zimmermann
> <theo.zimmi AT gmail.com>
> 於 2019年9月6日 01:06 寫道:
>
> Hi Donald,
>
> It seems that you have just found a bug with the "Make makefile" menu
> (now reported as https://github.com/coq/coq/issues/10736).
> As you can see when it displays a successful result (in the bottom
> bar), it has run the command "coq_makefile -o makefile *.v" instead of
> using the _CoqProject file in the directory.
> Now if instead you used the command-line to run "coq_makefile -f
> _CoqProject -o Makefile", then you can use the CoqIDE menu (or the
> command-line) to compile, and it will properly work.
>
> By the way, the use of "" as a logical name is discouraged (and you
> will get a warning when generating the Makefile). I'd recommend you
> put a real logical name, like Foo. However, if you do so, you'll have
> to either use -R instead of -Q, or require import "Foo.Preloaded"
> instead of "Preloaded".
>
> Théo
>
> Le jeu. 5 sept. 2019 à 13:38, Donald Leung
> <i.donaldl AT me.com>
> a écrit :
>>
>> Dear coq-clubbers,
>>
>> I recently noticed an email where Théo Zimmerman suggested the use of a
>> _CoqProject file over using Add LoadPath within a vernacular file (because
>> I’m used to (ab)using Add LoadPath whenever files don’t link up) and
>> decided to look into writing a _CoqProject file for a mini project.
>>
>> Currently, within a folder on my desktop, I have the following files:
>>
>> _CoqProject:
>>
>> ```
>> -Q . ""
>> Preloaded.v
>> Solution.v
>> ```
>>
>> Preloaded.v:
>>
>> ```coq
>> Require Import ZArith List Lia.
>> Import Z.
>> Open Scope Z_scope.
>>
>> Fixpoint total (xs : list Z) :=
>> match xs with
>> | nil => 0
>> | x :: xs' => x + total xs'
>> end.
>>
>> Definition Sub (a xs : list Z) :=
>> exists pre suf, xs = pre ++ a ++ suf.
>>
>> Definition Max_sub_sum (a xs : list Z) :=
>> Sub a xs /\ (forall b, Sub b xs -> total b <= total a).
>>
>> Fixpoint max_sub_sum_aux (xs : list Z) : Z * Z :=
>> match xs with
>> | nil => (0, 0)
>> | x :: xs' =>
>> let (p, q) := max_sub_sum_aux xs' in
>> (max 0 (x + p), max (x + p) q)
>> end.
>>
>> Definition max_sub_sum (xs : list Z) := snd (max_sub_sum_aux xs).
>> ```
>>
>> Solution.v:
>>
>> ```coq
>> Require Import Preloaded ZArith List.
>>
>> (* Hope this helps *)
>> Require Import Lia.
>>
>> Import Z.
>> Open Scope Z_scope.
>>
>> Theorem max_sub_sum_correct : forall (xs : list Z),
>> exists s, Max_sub_sum s xs /\ total s = max_sub_sum xs.
>> Proof.
>> (* FILL IN HERE *)
>> Admitted.
>>
>> Print Assumptions max_sub_sum_correct.
>> ```
>>
>> Using CoqIDE 8.9.1, I noticed that when I run Compile > Make makefile
>> followed by Compile > Make, all the associated files get compiled
>> successfully with the following output:
>>
>> ```
>> Compilation output:
>>
>> COQDEP VFILES
>>
>> COQC Preloaded.v
>>
>> COQC Solution.v
>>
>> Axioms:
>> max_sub_sum_correct : forall xs : list Z,
>> exists s : list Z,
>> Max_sub_sum s xs /\ total s = max_sub_sum xs
>>
>> ```
>>
>> However, when I try Forward one command on the first line of Solution.v,
>> it fails with the error message “The file
>> /Users/donaldl/Desktop/kata/Preloaded.vo contains library Top.Preloaded
>> and not library Preloaded”. What does that mean and how can I make my
>> files work both using make and interactive stepping?
>>
>> Cheers,
>> Donald
- [Coq-Club] Running make in CoqIDE 8.9.1 with _CoqProject file works but Forward one command fails, Donald Leung, 09/05/2019
- Re: [Coq-Club] Running make in CoqIDE 8.9.1 with _CoqProject file works but Forward one command fails, Théo Zimmermann, 09/05/2019
- Re: [Coq-Club] Running make in CoqIDE 8.9.1 with _CoqProject file works but Forward one command fails, Donald Leung, 09/06/2019
- Re: [Coq-Club] Running make in CoqIDE 8.9.1 with _CoqProject file works but Forward one command fails, Théo Zimmermann, 09/05/2019
Archive powered by MHonArc 2.6.18.