You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see `strictTotalOrder : StrictTotalOrder _ _ _` in `Data.Bin`, but I do not find there `decTotalOrder : decTotalOrder _ _ _`
Probably it has sense to add such.
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 _<_ in Data.Bin is not a total order or even a preorder because it is a strict inequality and therefore is not reflexive...
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.
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!
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.
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 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.
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.
Please, how to make a pull request in this my particular case?
In a suitable directory, on the command line call git clone https://github.com/mechvel/agda-stdlib stdlib-clone. This will copy the standard library into a new folder called stdlib-clone.
Make the changes you want to in the files Data.Bin and Data.Bin.Properties within stdlib-clone, (including updating CHANGELOG.md with the changes you've made)
Whilst in the top level of the directory stdlib-clone, run the command make test from the command line to check that your changes haven't broken anything.
Add the files you've made changes to using the commands git add src/Data/Bin.agda, git add src/Data/Bin/Properties.agda, git add CHANGELOG.md etc.
Commit the files you've added using git commit.
Push all your changes to your fork on github using git push origin master
Go to https://github.com/mechvel/agda-stdlib and there should be a button to create a pull request from your new commit.
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.
Currently, Bin has the following implementation to _<_ :
data _<_ (b₁ b₂ : Bin) : Set where less : (lt : (Nat._<_ on toℕ) b₁ b₂) → b₁ < b₂
Do you suggest to replace this with
data _≤__ (b₁ b₂ : Bin) : Set where leq : (le : (Nat._≤__ on toℕ) b₁ b₂) → b₁ ≤_b₂
and then, to define _<_ as x < y = x ≤ y × x ≢ y
?
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.
Currently, Bin has the following implementation to <:
data < (b₁ b₂ : Bin) : Set where
less : (lt : (Nat.< on toℕ) b₁ b₂) → b₁ < b₂
Do you suggest to replace this with
data ≤_ (b₁ b₂ : Bin) : Set where
leq : (le : (Nat.≤_ on toℕ) b₁ b₂) → b₁ ≤_b₂
and then, to define < as
x < y = x ≤ y × x ≢ y
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 _≤_ in Data.Fin and get rid of the data declaration entirely so that it reads as follows:
_≤_ : 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 _≤_: your new version and mine and see which is easier to work with.
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?
First I stay at https://github.com/mechvel/agda-stdlib
There is the headline of
"This branch is 1 commit ahead of agda:master." "Pull request" "Compare".
The last two are the buttons at the right end. I click "Pull request".
And it shows now differently.
At the right end it shows green "View pull request".
And it prints " Committer: Sergei Meshveliani ......"
-- in one left column, leaving blank the rest of the page on screen.
One page lower it shows in green "Create new pull request",
and below shows in green a responsible part of my CHANGELOG.md.
No "Create pull request" button is visible
Clicking at "Create new pull request" does not change anything.
Lower it is visible a small ring with running segment in it.
The page ends with "No commit comments for this range".
And this way it stays.
The last two are the buttons at the right end. I click "Pull request".
So after clicking "Pull request" you should see this:
.
.
.
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:
Do you get this screen? After editing the details, you then need to click the green "Create pull request" button at the bottom.
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 mechvel@botik.ru, but Git inserts there `mechvel2' in
the middle, which is suspicious).
And I probably do not need to create another pull request.
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 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.
@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:
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?
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.
Okay, well that's deeply bizarre. Fine, I guess I'll go ahead and create the pull request for you.
Activity
MatthewDaggitt commentedon Jun 22, 2017
Can you elaborate a bit more? Do you mean
Fininstead of Bin?mechvel commentedon Jun 23, 2017
MatthewDaggitt commentedon Jun 26, 2017
Correct me if I'm wrong, but
_<_inData.Binis not a total order or even a preorder because it is a strict inequality and therefore is not reflexive...mechvel commentedon Jun 26, 2017
MatthewDaggitt commentedon Jun 26, 2017
Ah, well at the moment the relation
_≤_isn't even defined inData.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!
mechvel commentedon Jun 29, 2017
mechvel commentedon Jun 30, 2017
Please, take a fresh version from there:
ftp://ftp.botik.ru/pub/local/Mechveliani/agdaNotes/bin2.zip
Ii is tested under Agda 2.6.0-207bde6.
mechvel commentedon Jun 30, 2017
Also
ftp://ftp.botik.ru/pub/local/Mechveliani/agdaNotes/bin3.zip
includes the items of bin2.zip + the instance of DecTotalOrder for Bin
for
x ≤ ydefined on Bin asx < y ⊎ x ≡ y.MatthewDaggitt commentedon Jul 5, 2017
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
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.mechvel commentedon Jul 9, 2017
MatthewDaggitt commentedon Jul 9, 2017
git clone https://github.com/mechvel/agda-stdlib stdlib-clone. This will copy the standard library into a new folder calledstdlib-clone.Data.BinandData.Bin.Propertieswithinstdlib-clone, (including updatingCHANGELOG.mdwith the changes you've made)stdlib-clone, run the commandmake testfrom the command line to check that your changes haven't broken anything.git add src/Data/Bin.agda,git add src/Data/Bin/Properties.agda,git add CHANGELOG.mdetc.git commit.git push origin masterhttps://github.com/mechvel/agda-stdliband there should be a button to create a pull request from your new commit.mechvel commentedon Jul 9, 2017
I put Nat2.agda into the folder Data/Nat/,
and put Bin2.agda into Data/Bin
And
module Data.Bin.Bin2imports items from ``Data.Nat.Nat2''.
And ``make test" reports
cabal clean && cabal install
cleaning...
Resolving dependencies...
Configuring lib-0.13...
Building lib-0.13...
Preprocessing executable 'GenerateEverything' for lib-0.13...
[1 of 1] Compiling Main ( GenerateEverything.hs, dist/build/GenerateEverything/GenerateEverything-tmp/Main.o )
Linking dist/build/GenerateEverything/GenerateEverything ...
Preprocessing executable 'AllNonAsciiChars' for lib-0.13...
[1 of 1] Compiling Main ( AllNonAsciiChars.hs, dist/build/AllNonAsciiChars/AllNonAsciiChars-tmp/Main.o )
Linking dist/build/AllNonAsciiChars/AllNonAsciiChars ...
Installing executable(s) in /home/mechvel/.cabal/bin
Installed lib-0.13
cabal exec -- GenerateEverything
GenerateEverything: src/Data/Bin/Bin2.agda is malformed
I reduce this module to two lines (by commenting out all the rest):
module Data.Bin.Bin2 where -- ℕ <--> Bin⁺ isomorphismopen import Level using () renaming (zero to 0ℓ)and still it is reported "malformed".
I wonder what might this mean.
mechvel commentedon Jul 9, 2017
Currently, Bin has the following implementation to
_<_:data _<_ (b₁ b₂ : Bin) : Set whereless : (lt : (Nat._<_ on toℕ) b₁ b₂) → b₁ < b₂Do you suggest to replace this with
data _≤__ (b₁ b₂ : Bin) : Set whereleq : (le : (Nat._≤__ on toℕ) b₁ b₂) → b₁ ≤_b₂and then, to define
_<_asx < y = x ≤ y × x ≢ y?
MatthewDaggitt commentedon Jul 9, 2017
So the changes that you're making shouldn't be put inside their own files. They should be incorporated into the existing
Data.BinandData.Bin.Propertiesfiles. This should bypass your current problem with the tests.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
_≤_inData.Finand get rid of thedatadeclaration entirely so that it reads as follows: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
_≤_: your new version and mine and see which is easier to work with.18 remaining items
mechvel commentedon Jul 11, 2017
First I stay at
https://github.com/mechvel/agda-stdlibThere is the headline of
"This branch is 1 commit ahead of agda:master." "Pull request" "Compare".
The last two are the buttons at the right end. I click "Pull request".
And it shows now differently.
At the right end it shows green "View pull request".
And it prints " Committer: Sergei Meshveliani ......"
-- in one left column, leaving blank the rest of the page on screen.
One page lower it shows in green "Create new pull request",
and below shows in green a responsible part of my CHANGELOG.md.
No "Create pull request" button is visible
Clicking at "Create new pull request" does not change anything.
Lower it is visible a small ring with running segment in it.
The page ends with "No commit comments for this range".
And this way it stays.
MatthewDaggitt commentedon Jul 11, 2017
So after clicking "Pull request" you should see this:

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

Do you get this screen? After editing the details, you then need to click the green "Create pull request" button at the bottom.
mechvel commentedon Jul 11, 2017
gallais commentedon Jul 11, 2017
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.
asr commentedon Jul 11, 2017
On the directory where you are doing the commits, please show me the output of
mechvel commentedon Jul 12, 2017
mechvel commentedon Jul 12, 2017
I have sent an email reply to the last request here. But Github replaced 1 page log text with "..." .
Can you see this text anywhere?
MatthewDaggitt commentedon Jul 12, 2017
Okay, let's try again.
fredrikNordvallForsberg commentedon Jul 12, 2017
@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:
git config --global user.email "mechvel@botik.ru"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).
mechvel commentedon Jul 12, 2017
MatthewDaggitt commentedon Jul 12, 2017
Okay, well that's deeply bizarre. Fine, I guess I'll go ahead and create the pull request for you.
MatthewDaggitt commentedon Feb 22, 2018
Closing this issue, as users seriously interested in binary computation can use the release of @mechvel 's new library.