coq-club AT inria.fr
Subject: The Coq mailing list
List archive
[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: [Coq-Club] Running make in CoqIDE 8.9.1 with _CoqProject file works but Forward one command fails
- Date: Thu, 5 Sep 2019 19:37:04 +0800
- Authentication-results: mail3-smtp-sop.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-zteg10021401.me.com
- Ironport-phdr: 9a23:AVSs6ROEZGBH5Z+fc1El6mtUPXoX/o7sNwtQ0KIMzox0Lf34rarrMEGX3/hxlliBBdydt6sezbOJ7Ou7BiQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagf79+Ngi6oAfTu8UZj4ZvKLs6xwfUrHdPZ+lY335jK0iJnxb76Mew/Zpj/DpVtvk86cNOUrj0crohQ7BAAzsoL2465MvwtRneVgSP/WcTUn8XkhVTHQfI6gzxU4rrvSv7sup93zSaPdHzQLspVzmu87tnRRn1gyoBKjU38nzYitZogaxbvB2vqBNwzZPXbo+bKvRwebjQfc8DRWpEQspRVzBND4G6YoASD+QBJ+FYr4zlqlUAqhu+AxOjBOfyxTRVgHH5w7A60+IuEQrb2wEgHsgCv2nTrNXzLqgSVf26zK3TwDXGcfxawyvy6I/Nch04p/yHQLF+cdLJxEUyFQ7JlFWdpI//Mz6UzOgAvGqW4/JvWO6xkWIqrwJ8riKxyssyi4TFnJ8Zxk7Z+Sh/3Y07P8e3SFRhbt6hCJZQtz+VN49xQs46W2FopiY3xqEeuZKnYCQKyZEnywfeavybbYeI7Q/vWPqNLTtmmX5od66ziwuo/Uil1OLwTNW70FFPriZdk9nMsG4C1wDL58SaSPZx5Ees1DWV2w3S8O1JLkI5mbLeK5E7w74wkpQTsV7EHi/zgEj2jbWaeVgj+uiu8evnZqjpppuHOo9xlA7yKLghmsu6AeggKAgBQ3Cb+fig1L3k5UD2XLJKjuQvnqbFtJDaON8Uq7WiAw5V14Yj8wywAy2n0NQeh3kHLUhKdAiJj4jzaBnyJ6XzCu76iFCxmh9qwerHN/vvGMbjNH/GxZvme7955wZ4xRc1wpgL5tRYDbcIJP73ckr88tffC0lqYESP3+/7BYAlhcslUmWVD/rBaf6AgRqz/usqZtK0SsoVtTL6cKF3/+Cz1WdhwV4YOLu10JROMCjiR6g+egOcbDznhdJTST5b7Dp7d/TjjRi5aRAWYn+zW6wm4TRrWoerS4zEQ9L02eDT7GKABpRTI1t+JBWUC364JYCJHfwLbXDKLw==
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.