-
Notifications
You must be signed in to change notification settings - Fork 247
has it (DecTotalOrder Bin) ? #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you elaborate a bit more? Do you mean |
I see `strictTotalOrder : StrictTotalOrder _ _ _` in `Data.Bin`, but I do not find there `decTotalOrder : decTotalOrder _ _ _`
Probably it has sense to add such.
…------
Sergei
On Thu, 2017-06-22 at 15:21 -0700, MatthewDaggitt wrote:
Can you elaborate a bit more? Do you mean Fin instead of Bin?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Correct me if I'm wrong, but |
On Mon, 2017-06-26 at 05:27 -0700, MatthewDaggitt wrote:
Correct me if I'm wrong, but _<_ in Data.Bin is not a total order or
even a preorder because it is a strict inequality and therefore is not
reflexive...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Data.Bin defines and exports StrictTotalOrder for _<_.
And similarly, it is also desirable to have there
DecTotalOrder for _≤_ for Bin.
Such is possible to define, but I do not find such.
…-----
Segei
|
Ah, well at the moment the relation As it's a fairly niche part of the library and a reasonably large piece of work, I don't think that it's likely it'll be done any time soon. However if you need this and have already written the necessary code then please do feel free to submit a pull request with it! |
On Mon, 2017-06-26 at 08:18 -0700, MatthewDaggitt wrote:
Ah, well at the moment the relation _≤_ isn't even defined in
Data.Bin. Adding such a definition would probably mean that the
existing definition of _<_ would want to be reworked in terms of it
and that would entail making large changes to the rest of the file.
As it's a fairly niche part of the library and a reasonably large
piece of work, I don't think that it's likely it'll be done any time
soon. However if you need this and have already written the necessary
code then please do feel free to submit a pull request with it!
I have its code inside DoCon-A-0.04.1.
I am going to separate it and to suggest for Standard,
may be, in July 2017.
Also, please, consider
ftp://ftp.botik.ru/pub/local/Mechveliani/agdaNotes/bin2.zip
(of February 2013 !).
This is a very essential addition to Bin.
Threre are proved some properties from the list that constitutes the
_correctness_ of the binary coding.
Correctness of the binary coding means that
(1) this coding is a bijective map,
(2) it preserves the operations _+_, _*_.
Without this correctness proof, Bin is not a proved program.
This bin2.zip contains a proof for that the binary coding is injective
and that it preserves suc <--> addC, may be something else.
But I am not sure that I am the only one who proved things on Bin in
Agda. The e-mail archive may contain the related announcements from
other people (they may be in the segment of 2012 -- 2015). It may have
sense to directly ask the Agda email list.
…------
Sergei
|
Please, take a fresh version from there: Ii is tested under Agda 2.6.0-207bde6. |
Also includes the items of bin2.zip + the instance of DecTotalOrder for Bin |
Thank you for your contribution! It would be great if you could submit some of it as a pull request rather than a zip file. If you need any pointers on creating a pull request please feel free to ask! As for the ordering |
On Wed, 2017-07-05 at 09:59 +0000, MatthewDaggitt wrote:
Thank you for your contribution! It would be great if you could submit
some of it as a pull request rather than a zip file. If you need any
pointers on creating a pull request please feel free to ask!
Please, how to make a pull request in this my particular case?
I have done a fork from the project 'Standard library'.
In this fork I enter into scr/Data/Bin/
I have the files
Bin2.agda Nat2.agda readme.agda
to pull, where readme.agda contains a general description and comment.
I set "Create new branch", click "Upload files", and
"Choose your files".
This brings me to the files on my computer.
I click at Nat2.agda on my computer.
This returns me to the repository, and nothing happens, no message of
any file being uploaded.
Please, how to improve?
As for the ordering x ≤ y = x < y ⊎ x ≡ y, defining _≤_ in terms of
_<_ is backwards with respect to the rest of the standard library. I'm
reluctant to accept it as I feel its likely to cause confusions for
users and further problems down the line. As I mentioned before, I'd
be much more comfortable rewriting the implementation of _<_ in terms
of a new native _≤_ relation.
This is a further question to consider.
…------
Sergei
|
|
I put Nat2.agda into the folder Data/Nat/, And And ``make test" reports cabal clean && cabal install
|
Currently, Bin has the following implementation to
Do you suggest to replace this with
and then, to define |
So the changes that you're making shouldn't be put inside their own files. They should be incorporated into the existing
That certainly seems better. In fact, as we're reworking the implementation and the changes aren't going to be backwards compatible anyway, I might be tempted to copy the style of _≤_ : Rel Bin Set
x ≤ y = toℕ x Nat.≤ toℕ y
_<_ : Rel Bin Set
x < y = x ≤ y × x ≢ y The notes say that the existing data declaration is to aid in pattern matching. It might be worth experimenting with the two different definitions of |
On Sun, 2017-07-09 at 06:20 -0700, MatthewDaggitt wrote:
I put Nat2.agda into the folder Data/Nat/ and put Bin2.agda
into Data/Bin
So the changes that you're making shouldn't be put inside their own
files. They should be incorporated into the existing Data.Bin and
Data.Bin.Properties files. This should bypass your current problem
with the tests.
I incorporate them there.
Now it reports
…--------------------------
...
Installed lib-0.13
cabal exec -- GenerateEverything
cabal exec -- fix-agda-whitespace --check
cabal: The program 'fix-agda-whitespace' is required but it could not be
found.
--------------------------
On the other hand, Agda 2.6.0-207bde6 does work on my machine, and it
uses Standard library of April 13 2017
(which is probably lib-0.13).
Please, how to fix?
------
Sergei
|
I incorporate them there. Now it reports
|
You can install $ cd my-agda-upstream-directory
$ cd src/fix-agda-whitespace/
$ cabal install |
Now, the commands
lead to the report
These three files are exactly the files to which I have added certain needed comments and code. |
Now, the commands
lead to the report
These three files are exactly the files to which I have added certain needed comments and code. |
Usually it's because you have trailing whitespace on some lines. IIRC |
You have whitespace issues (but your editor is not showing them). Run |
@mechvel it is difficult read your messages in GitHub because the format is awful. Please edit your messages and fix their format. |
@mechvel You don't need 2 opening and 2 closing backticks on every line, you can simply use 3 backticks on a single line before the block and 3 backticks on a single line after the block like so:
gives:
|
About pull requests: |
So its not impossible to add new files, it's just that by keeping everything organised logically it helps users. Adding new files for each pull request would lead to chaos where no-one would know where to look for a particular property. The fact that you are getting import cycles means that as it is your code could be structured better, but it sounds like you've already worked out how to fix it by putting your changes in the relevant files! If I may make the suggestion that you start off creating a pull request for only a small set of changes? Maybe only the basic changes to |
I cancel my complaint about restriction on .agda files for pull requests for Standard library. So far, I propose the two main backwards compatible items for Bin. I do not care much of adding things to Standard library, I just use them as non-standard. |
I have committed a pull request for the above features. Further improvement for Bin can be as follows.
This will make the ordering witnesses for Bin an explicit data, with also preserving fast comparison. |
Okay great. Now if you go to your forked repository on Github to the right of the text "This branch is 1 commit ahead of agda:master." there is a button called "Pull request". This allows you to submit your pull request to the main repository. Also I agree, your proposed implementation of the lexicographic ordering seems like the best! |
I clicked this "Pull request". But I am not sure that it is submitted to the main repository. |
Okay, after clicking that you then need to click the green "Create pull request" button at the top of the page, and then again on the next screen. |
On Tue, 2017-07-11 at 06:17 -0700, MatthewDaggitt wrote:
Okay, after clicking that you then need to click the green "Create
pull request" button at the top of the page, and then again on the
next screen.
After clicking the green "Create pull request" nothing happens.
It stays there, silent.
Also I need to change in my part in CHANGELOG.md
the name `Data.Nat' to `Data.Nat.Properties',
because the items are added not to the former file but to the latter
(this does not effect "make test").
Is it possible to change this CHANGELOG.md in the pull request?
…------
Sergei
|
Is this the first or the second "Create pull request" button? Does the page say "Comparing changes" or "Open a pull request" at the top? It seems to work for me fine.
Yes, it's possible to make modifications to the pull request at any point. Simply repeat steps 2, 3, 4, 5 and 6 in the instructions I gave you earlier. Any changes you make will automatically be added to the pull request (once you've succeeded in making it). |
First I stay at The last two are the buttons at the right end. I click "Pull request". Clicking at "Create new pull request" does not change anything. |
On Tue, 2017-07-11 at 15:02 +0000, MatthewDaggitt wrote:
The last two are the buttons at the right end. I click "Pull
request".
So after clicking "Pull request" you should see this:
image
.
.
.
Clicking at "Create new pull request" does not change
anything.
Clicking the "Create new pull request" button should then allow you to
enter the description of the pull request. The screen should now look
like this:
image
Do you get this screen?
The "Create new pull request" button is followed in its line with the
comment
"Create another pull request to discuss and review the changes again".
And I probably do not need to create _another_ pull request.
Anyway clicking it changes nothing.
Lower, on the right, there is the button "View".
Clicking it shows CHANGELOG
After editing the details, you then need to click the green "Create
pull request" button at the bottom.
I cannot edit there anything, and there is not "Create pull request"
button at the bottom.
I do not know, may be, the pull request is already done?
May be it tries to contact me by the expanded email address (which I
suspect is wrongly expanded), and hangs because does not get a
response?
(my address is [email protected], but Git inserts there `mechvel2' in
the middle, which is suspicious).
|
Yes you do. The pull requests are listed here so yours most definitely has not been created yet. If you want to make some more edits, you need to commit them and push them to your fork before you start the pull request. |
On the directory where you are doing the commits, please show me the output of
|
On Tue, 2017-07-11 at 13:30 -0700, Andrés Sicard-Ramírez wrote:
(my address is ***@***.***, but Git inserts there
`mechvel2' in
the middle, which is suspicious).
On the directory where you are doing the commits, please show me the
output of
$ git log -5
For any occasion:
in this log the first "Committer" field has an extra period after @ in
my address.
…-------------------------------------------------------------------
commit cf2a0cf113b80d4ec10b81df392ffcfc4d6f42c1
Author: Sergei Meshveliani <[email protected]>
Date: Tue Jul 11 13:54:19 2017 +0300
Committer: Sergei Meshveliani <[email protected]>
On branch master
Changes to be committed:
modified: CHANGELOG.md
modified: src/Data/Bin.agda
modified: src/Data/Bin/Properties.agda
modified: src/Data/Char.agda
modified: src/Data/Nat/DivMod.agda
modified: src/Data/Nat/Properties.agda
Author: Sergei Meshveliani <[email protected]>
Committer: Sergei Meshveliani <[email protected]>
Changes to be committed:
modified: CHANGELOG.md
modified: src/Data/Bin.agda
modified: src/Data/Bin/Properties.agda
modified: src/Data/Char.agda
modified: src/Data/Nat/DivMod.agda
modified: src/Data/Nat/Properties.agda
commit 7205fba
Author: Matthew Daggitt <[email protected]>
Date: Wed Jul 5 14:45:37 2017 +0100
Added some additional properties to `Data.List.All.Properties`
commit 315262b
Author: Matthew Daggitt <[email protected]>
Date: Wed Jul 5 13:34:09 2017 +0100
Added some additional proofs to `Data.List.Any.Properties`
commit 878b375
Author: MatthewDaggitt <[email protected]>
Date: Wed Jul 5 10:45:31 2017 +0100
Added a properties file for Data.Bin (#142)
commit 76b99a7
Author: Matthew Daggitt <[email protected]>
Date: Tue Jul 4 16:58:46 2017 +0100
Added extra ordering relations to `Data.Integer` and improved
compatability of `Data.Integer.Properties` with planned changes to
`Data.Integer`
-----------------------------------------------------------------------
|
I have sent an email reply to the last request here. But Github replaced 1 page log text with "..." . |
Okay, let's try again.
|
@mechvel The email address used is not important for the success of the creation of the pull request, but if you want to change it, you can execute the following command on the command line:
Afterwards git will use your correct email address (see e.g. https://help.github.com/articles/setting-your-email-in-git/#setting-your-email-address-for-every-repository-on-your-computer). |
On Wed, 2017-07-12 at 02:24 -0700, MatthewDaggitt wrote:
Okay, let's try again.
1. Go to https://github.com/mechvel/agda-stdlib
2. Press "Pull request"
image
3. Press "Create new pull request"
image
4. Change the title of the pull request to something sensible
image
5. Click "Create pull request"
image
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
The step
3. Press "Create new pull request"
does not produce any effect. And I do not see how can I change there
anything in the title, there is no possibility.
The page
https://github.com/mechvel/agda-stdlib
shows which files are changed in the commit: 6 files
(CHANGELOG.md and five .agda files).
May be you can take these files and make a pull request instead of me?
…------
Sergei
|
Okay, well that's deeply bizarre. Fine, I guess I'll go ahead and create the pull request for you. |
Closing this issue, as users seriously interested in binary computation can use the release of @mechvel 's new library. |
has it (DecTotalOrder Bin) ?
The text was updated successfully, but these errors were encountered: