snu-sf-class / pl2015spring Goto Github PK
View Code? Open in Web Editor NEWSNU 4190.310, 2015 Spring
SNU 4190.310, 2015 Spring
It seems that CoqIDE is very inconvenient to use for editing coq files. (ex : not support auto-indent)
I found an eclipse plugin named coqoon, but it does not work properly.
Could you recommend any coq editor which has auto-indent, syntax coloring, coqIDE plugin, etc? (except Vim, for windows...)
@LeeGyeongGeon @snu-amoretspero @cocghe210 @egejjespersen @jwlee93 @reinos
Hi!
Jeehoon
Hi all,
As described here, please make your repository private. The contents of the links basically ask you to:
Settings
> Danger Zone
.Jeehoon
In the Induction.v file, on line 378, there is an exercise:
(** **** Exercise: 2 stars, optional (evenb_n__oddb_Sn) *)
(** Prove the following simple fact: *)
Theorem evenb_n__oddb_Sn : forall n : nat,
__evenb__ n = negb (evenb (S n)).
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
which gives an error message:
Error: The reference evenb was not found in the current environment.
Wasn't evenb supposed to be defined?
The file does not compile:
Error: The reference evenb was not found in the current environment.Compilation output:
File "C:\Users\Alena\GitHub\pl2015\sf\Induction.v", line 378, characters 2-7:
Error: The reference evenb was not found in the current environment.
I'm currently studying Rel.v
, and meet the case like below.
Hnm : S n <= S m
Hmo : S m <= S o'
______________________________________(1/1)
S n <= S o'
Fortunately, I already prove the following theorem.
Theorem le_trans :
transitive le.
However, I cannot directly apply this theorem to my goal with apply le_trans
, because transitive
is not unfolded yet. If I can bring that theorem in my frame, I can unfold it, but I don't know how to do it elegantly. Of course, I can do it as follows, but I have to re-type the statement of the theorem. I guess that there is an easier keyword for doing this.
assert (H:transitive le).
apply le_trans.
unfold transitive in H.
apply H with (b:=S m).
It can be a silly question, but after I directly removed Assignment_02.v file in my computer, I cannot download it again from snu-sf/pl2015 via fetch-homework.sh file. Does that script operate only once? I'd like to get "clean" files from snu-sf/pl2015.
Are we allowed to use theorems proved earlier in the homework to prove solve a problem that occurs afterwards?
In other words, are we allowed to do rewrite -> some_earlier_theorem
?
I think some comments given in the Assignment 2 are somewhat misleading.
For example,
(** **** Problem #7 : 4 stars (mult_comm) *)
(** Use [assert] to help prove this theorem if necessary.
You shouldn't need to use induction. *)
Theorem plus_swap : forall n m p : nat,
(** **** Problem #8 : 3 stars (mult_comm) *)
Those comments refer to mult_comm
, even though there is no theorem named mult_comm
in the whole assignment.
Hi all,
./fetch-homework.sh
to get assignment 02.sf/Assignment_02.v
.https://github.com/$YOURID/pl2015
contains the change you made.Sincerely,
Jeehoon
This error is caused by referring 'libcurl.dll' in C:\Windows\SysWOW64.
So You should change 'libcurl.dll' in C:\Windows\SysWOW64 with 'libcurl.dll' in C:\Users[$USERNAME]\AppData\Local\GitHub.
I would be of help to you in using Github.
line 3 in Assignment03.v "Require Import Basics." makes error
"Error: The file somepath/y/theories/Program/Basics.vo contains library
Coq.Program.Basics and not library theories.Program.Basics"
is there any ways i can solve them??
Hello. I have question about git 'fetch and merge'.
Whenever I try to execute the fetch script you loaded and pull a new assignment, it changes my files, specifically, the last assignment. I think the 'merge' command has something to do with it.
Is there any way to keep local files unmodified after pulling a new assignment? Is there no problem with that but me? I want to know what I am missing.
Expecting an insight on it, Thanks.
@snu.ac.kr
email address (https://help.github.com/articles/verifying-your-email-address/).@snu.ac.kr
email address.Subject: Request for Faster Transaction for Course
Content:
Hi GitHub Education Team,
I am YOURNAME, a student from Seoul National University.
This semester I take Programming Languages course,
and to attend the the course, I have to prepare for a private repository.
So I applied a discount from education.github.com, but I could not get an approval.
As the first assignment will be issued next week, I will need a free repository soon.
So may I ask if you could approve my application sooner than usual?
My TA (@jeehoonkang) said he asked Mr. Sanicki (@sanicki) to help me, so I contacted via this channel.
Thanks,
YOURNAME
I think that using Homebrew for installing coq is a convenient way of downloading and installing coq on mac OS X. I've just tried it for myself, and it seems to be working fine with the right versions (8.4pl5). Maybe this can be instructed in the course instruction manuals.
With Homebrew installed, all you have to do is
$ brew install coq
and if you want to install opam, it can be done by
$ brew install opam
It seems like the steps like ./configure ..
and make world
are all included in $ brew install coq
as well. No extra bash settings to do.
It's just a small suggestion that seems like a fine solution that does all the work for you.
I followed
upstream
points to the valid offical repository.git remote rm upstream
git remote add upstream https://github.com/snu-sf/pl2015.git
git fetch upstream
git merge upstream/master
as same as snu-sf/pl2015/fetch-homework.sh
but I got some problem @ git merge upstream/master. Here is error
error: 'merge' is not possible because you have unmerged files.
hint: Fix them up in the work tree.
hint: and then use 'git add/rm ' as
hint : appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: Exiting because of an unresolved conflict.
How can I solve this problem?
I unintentionally made change to Assignment01.v file when pushing Assinment_02.v file
is it okay to change homework files that is passed due date?
In homework.md,
Make sure your source code is compiled without error before submission. TA will compile by make clean; make in Linux environment. This should not fail.
I pushed assignment01.v without compiling...
But, the above sentence in homework.md says that TA compiles my code when checking my homework.
Hi all,
./fetch-homework.sh
to get assignment 01.sf/Assignment01.v
.https://github.com/$YOURID/pl2015
contains the change you made.Sincerely,
Jeehoon
Is installing opam necessary for Coq on Windows? Or is it enough to get the Windows binary from the Coq downloads page?
I defined 'nonzeros'
but oddmembers and countoddmembers do not have any example or a skeleton code.
I have codes such as
Eval compute in ...
and Example ...
to test my codes.
It is ok to just leave them in the code right?
One additional question,
what happens if a empty list comes into split?
split nil = ?? would it be ([]. [])?
I will give you the office hour @ 301-554:
Posting a question/answer with the TA regarding order of operations in Coq.
QUESTION:
Hi Jeehoon,
Do you have time to answer a quick question for me? I've reduced a proof in assignment 2 to this: p + (n' * p + m * p) = p + n' * p + m * p. I'm trying to figure out how mult and plus will be executed, but I'm confused about the order of operations and want to check with you that my understanding is correct. You mentioned yesterday that by default Coq evaluates expressions from left to right, so here is my guess about how the terms are evaluated:
Starting on the left-hand side of the equation, Coq first evaluates the terms inside the parentheses by multiplying n' and p and m and p and adding the results. The p outside the parentheses is then added to the unified term inside the parentheses. On the left-hand side, the multiplication is evaluated first, then, moving from left to right p is added to the result of n' * p and the result of that is added to m * p.
I hope that by understanding the order of operations I can get rid of the parentheses! It's so frustrating to have them keeping the proof from going through.
Thank you,
Adam
ANSWER:
Your interpretation seems right. p + (n' * p + m * p) means p + ((n' * p) + (m * p)), and p + n' * p + m * p means (p + (n' * p)) + (m * p).
Sorry for confusion I made; (1) * is more privileged than +, and (2) left +/* is more privileged than right +/*. (1) was missing in my explanation yesterday.
It would be helpful to use the issue tracker for this kind of general questions :-) Would you please make an issue for the interpretation of operators? Thanks.
Jeehoon
My assignment in the coqIDE can navigate until the end with Ctrl+alt+->
And the compile buffer works.
But when I try to 'make' in coqIDE, the program freezes.
Also when I try make or makefile in bash, it does not work as well.
I have submitted already, but I am not sure what is wrong.
Would I have to fix something and submit again?
or if the navigation works and the 'compile buffer' works would I be fine?
The exercise named blt_nat
is given as:
(** The [blt_nat] function tests [nat]ural numbers for [l]ess-[t]han,
yielding a [b]oolean. Instead of making up a new [Fixpoint] for
this one, define it in terms of a previously defined function.
Note: If you have trouble with the [simpl] tactic, try using
[compute], which is like [simpl] on steroids. However, there is a
simple, elegant solution for which [simpl] suffices. *)
But I think that no proper functions are defined in the Assignment01.v
:(
Hi all,
Jeehoon
Is it okay to state a new theorem and prove it, so I can use this theorem in the given problems?
Hi all,
./fetch-homework.sh
to get assignment 03.sf/Assignment03.v
.make
works without errors.https://github.com/$YOURID/pl2015
contains the change you made.Sincerely,
Jeehoon
/Applications/CoqIDE_8.4pl5.app/Contents/Resources/bin/coqtop
and open for once.CoqIDE
> Preferences
> Externals
. And then change coqtop
into /Applications/CoqIDE_8.4pl5.app/Contents/Resources/bin/coqtop
.This solved my problem, and I hope it will solve your problem, too.
Jeehoon
I tried to execute this Fixpoint called "eq_nat" in Basics.v
and wanted to get a "true" or a "false" as a return value.
But instead, I got a "True" or a "False", and failed to get a "bool".
Fixpoint eq_nat n m: Prop :=
match n, m with
| O, O => True
| O, S => False
| S _, O => False
| S n1, S m1 => eq_nat n1 m1
end.
To solve this problem changed
Prop, True, False to bool, true, false
in Fixpoint eq_nat.
and then I could get a "bool."
Fixpoint eq_nat n m: bool :=
match n, m with
| O, O => true
| O, S => false
| S _, O => false
| S n1, S m1 => eq_nat n1 m1
end.
Please check out your (SNU) Email "Spam" Folder.
Jeehoon
When are we going to have a midterm exam? And will we have to use lab's computers and submit the exam file to github repository?
(I believe this post does not pertain to non-Korean-speakers.)
301동 554호에서 보관하고 있읍니다.
강지훈 드림
There's an error when I progress "Require Export Induction."
Error: Compiled library Induction.vo makes inconsistent assumptions over
library Coq.Init.Notations
How can I solve this?
I have the same problem with the issue #43 .
The same error occurs when I compile the code Check beq_nat
.
The error message is:
Warning: query commands should not be inserted in scripts
Error: The reference beq_nat was not found in the current environment.
I'm working in Windows 7, so some kinda things like make
don't seem to be the solution.
To cope with it, I think of not using beq_nat
at all.
Instead, I will use my own Fixpoint beq_nat_mimic
,
which I will define by myself so that it works just same as ordinary beq_nat
.
Is that OK?
In the instruction given in the file Coq.md, it seems to be necessary to use OCaml version 4.01.0.
But the command "apt-get install" in Ubuntu installs the version 4.02.1, not 4.01.0.
With 4.02.1, it works, but I see many warning messages of deprecation during the installation of Coq.
Since I'm not familiar with Linux, I have no idea with how to install the older version of OCaml.
How can I solve it?
In homework.md#submission
Make sure your source code is compiled without error before submission. TA will compile by make clean; make in Linux environment. This should not fail.
So I think Assignment01.v
should be list of VFILES
in Makefile
like this
Or, do I have to update Makefile
every Assignment?
thank you for reading
Is the pushing successful if I can see my commit on GitHub website? And what is 'pulling request'? Can TA pull my repository only if I answer his pulling request?
Is it possible to get a tutorial on installing Proof General? I know it's a lot to ask for, but I have been struggling to correctly install Proof General and there aren't many internet resources for it.
To be a bit more precise on where I'm stuck.
I have installed emacs correctly (at least I think I have) on my Windows computer. In my .emacs.d\init.el file, I type the following command
(load-file "Proof General directory....") and I continue to get the error on emacs that the file will not load.
Shouldn't
Require String. Open Scope string_scope.
Ltac move_to_top x :=
match reverse goal with
| H : _ |- _ => try move x after H
end.
Tactic Notation "assert_eq" ident(x) constr(v) :=
let H := fresh in
assert (x = v) as H by reflexivity;
clear H.
Tactic Notation "Case_aux" ident(x) constr(name) :=
first [
set (x := name); move_to_top x
| assert_eq x name; move_to_top x
| fail 1 "because we are working on a different case" ].
Tactic Notation "Case" constr(name) := Case_aux Case name.
Tactic Notation "SCase" constr(name) := Case_aux SCase name.
Tactic Notation "SSCase" constr(name) := Case_aux SSCase name.
Tactic Notation "SSSCase" constr(name) := Case_aux SSSCase name.
Tactic Notation "SSSSCase" constr(name) := Case_aux SSSSCase name.
Tactic Notation "SSSSSCase" constr(name) := Case_aux SSSSSCase name.
Tactic Notation "SSSSSSCase" constr(name) := Case_aux SSSSSSCase name.
Tactic Notation "SSSSSSSCase" constr(name) := Case_aux SSSSSSSCase name.
be included?
https://docs.google.com/spreadsheets/d/1LzOLx22lF3N31D9RDS20Ec8ub_Rq6IA3utD8CNMk9CQ/edit#gid=0
If something wrong, please let me know.
Jeehoon
I found that using "auto." is easy way to proof.
Is there any penalty if I use auto in assignment?
I borrowed one, and I did not return.
I would like the owner to contact me.
Jeehoon
http://try.github.com/ is a decent git tutorial.
If you have a trouble with Git, then please go through the tutorial. It takes less than one hour.
Jeehoon
when I create new coq file and try to save it, A Message -save failed- is printed.
I don't know why it happens.
could you help me solving this problem?
Sorry for the Q about the mistake I made in merging the assignment2.
In brief, I removed "Assignment_1.v" file using "git rm sf/Assignment_1.v" command a minute ago and pushed my local repository(which has no ass1) to the remote. So, If you visit my remote repository, you'll notice that my "Assignment_1.v" file has been uploaded a few minute ago becauase I pushed again with the file.
Actually, I had pushed Ass1 to the remote before the due date so that if you fetched my repo at due time(hopefully), I guess it's no big deal.
Is there any problem with this? Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.