GithubHelp home page GithubHelp logo

snu-sf-class / pl2015spring Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 6.0 3.36 MB

SNU 4190.310, 2015 Spring

Coq 20.10% Shell 0.01% HTML 77.00% Verilog 0.33% CSS 0.10% OCaml 2.29% JavaScript 0.06% Makefile 0.11%

pl2015spring's People

Contributors

corea avatar esifea avatar gilhur avatar jeehoonkang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pl2015spring's Issues

Is there any recommendable editor for Coq?

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...)

Make your repository private

Hi all,

As described here, please make your repository private. The contents of the links basically ask you to:

  • "Request a discount" from https://education.github.com
  • Wait for (at most) a day for the discount to be granted.
  • Change your repository to private one in the repositories' Settings > Danger Zone.

Jeehoon

How can I maintain my parentheses?

image

I'm so stressful because Coq is deleting my parentheses. I tried to maintain my parentheses but everytime I try Coq delete those! Can you help me about this?

Problems with Induction.v (Line 378)

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.

How can we bring the previously proven theorem in the current frame

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).

How can I recover a deleted assignment file?

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.

Question regarding homework

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?

Question about Assignment 2

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.

Assignment 02 Status

Hi all,

  • Assignment 02 is issued.
  • Please read Homework.md to know how to fetch homework and submit your answer.
    • You have to run ./fetch-homework.sh to get assignment 02.
    • Do your homework by editing sf/Assignment_02.v.
    • Commit and push to your GitHub repository.
    • Make sure https://github.com/$YOURID/pl2015 contains the change you made.
  • Stay tuned for README.md and this issue on the assignment.
  • If you did not make your repository private yet, PLEASE DO IT. Read #14 and do as said in the issue.

Sincerely,
Jeehoon

Errors when importing

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??

On merging

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.

GitHub Repository Status

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

Using Homebrew in OS X

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.

Error at fetch

I followed

!/usr/bin/env bash

Usage: ./fetch-homework.sh

Make sure that upstream points to the valid offical repository.

git remote rm upstream
git remote add upstream https://github.com/snu-sf/pl2015.git

Download and update.

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?

Compile about submission

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.

  1. Is it okay to upload .v file only or should I upload assignment01.v and another files created at compiling?
  2. How can i run and check compiled one, to see if it's running correct?

Assignment 01 Status

Hi all,

  • Assignment 01 is issued.
  • Please read Homework.md to know how to fetch homework and submit your answer.
    • You have to run ./fetch-homework.sh to get assignment 01.
    • Do your homework by editing sf/Assignment01.v.
    • Commit and push to your GitHub repository.
    • Make sure https://github.com/$YOURID/pl2015 contains the change you made.
  • Stay tuned for README.md and this issue on the assignment.
  • I understand some of you could not make your repository private yet. Please read #14 and do as said in the issue. Until then, leave your repository public. However make sure to make your repository private before the due (2015/03/19 14:00).

Sincerely,
Jeehoon

Can we leave other codes in the assignment?

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 ([]. [])?

TA Office Hour for Assignment 1

I will give you the office hour @ 301-554:

  • 20150316 (Mon): 13:00-16:00, 19:30-23:59
  • 20150317 (Tue): 13:00-23:59
  • 20150318 (Wed): 13:00-16:00, 19:30-23:59

Order of operations in Coq

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

Make sure make works without errors.

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.
default
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?

Some problems in the first assignment.

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 :(

Assignment 03 Status

Hi all,

  • Assignment 03 is issued.
  • Please read Homework.md to know how to fetch homework and submit your answer.
    • You have to run ./fetch-homework.sh to get assignment 03.
    • Do your homework by editing sf/Assignment03.v.
    • Make sure make works without errors.
    • Commit and push to your GitHub repository.
    • Make sure https://github.com/$YOURID/pl2015 contains the change you made.
  • Stay tuned for README.md and this issue on the assignment.

Sincerely,
Jeehoon

Fix bug for CoqIDE in OS X

  • It is reported that when you are opening coqide in OS X, just an error message saying "Failed to load coqtop." pops up.
  • Click "No", and then find /Applications/CoqIDE_8.4pl5.app/Contents/Resources/bin/coqtop and open for once.
  • Goto 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

Prop vs. bool (in eq_nat)

Prop vs. bool

Problem

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.

Solution

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.

GitHub Repository Status

Jeehoon

Midterm Exam

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?

Problems in Lists.v

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?

How can we import beq_nat from Basics.v - Similar to 43

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?

Do we have to use OCaml version 4.01.0?

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?

makefile update issue

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?

questions about installing coq

  1. There was dependency problem when i tried to install coqide in Ubuntu and I don't know how to solve it(using ocaml 4.02.0). I guess coqide in linux is available only using coq8.4pl3.
    will there be any problem using just coqc and vi instead of using coqide?
  2. is it okay to use coq8.4pl3 which is currently installed in school martini server?
    i wonder if there will be any version problems doing further homework

thank you for reading

Proof General on Emacs

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.

Assignment_02.v question

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?

Thunderbolt-VGA cable

I borrowed one, and I did not return.
I would like the owner to contact me.

Jeehoon

Coq Ide 'Save failed' problem.

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?

Question about my mistake.

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.