Added the use of variable names other than 'x'
As the name says, I added the use of variable names other than 'x'. Any letter except 'c' and 'p' can be used. I am also skipping underscores so a(2), a2, and a_2 should be equivalent,
Clauses that begin like q_0 = a_xb_x should be equivalent to q_0 + a_xb_x , unless I have misunderstood the syntax.
Finally, I outout a ".resolve" file that explains the correspondences between variables and numbers.
Note that at the moment I am adding 2 to the variable count because I am leaving "0 signifies 0" and "1 signifies 1" that the Courtois converter generated. If these are actually not used/needed, I can amend it.
Thanks, looks nice! I'll review tomorrow, but it looks good to me :)
Hi,
I have now made the GitHub actions work, and build a binary for linux amd64 and arm64, and mac arm64. It now also runs a test suite. You can find the tests under tests/anf-tests -- they specify what needs to run and what the output should mostly look like. It's a very simple system. Please check it out and adjust your PR to match them. Sorry for the system being in such a sorry state before. With this change, I think your PR will also be a lot more impactful, as Bosphorus will finally be available for different architectures, etc.
Once your PR is merged, I will create a new release, and attach the auto-generated binaries, e.g. the ones at the bottom of this page here:
https://github.com/meelgroup/bosphorus/actions/runs/14292531540
but of course after your PR is merged.
Sorry for this delay. I worked on this for a few hours, so hopefully it'll now be a lot easier to release things and to build them for different target architectures.
Mate
HI, I am not sure what you mean by "Please check it out and adjust your PR to match them" (them = the tests).
Hi! I just meant that I saw you added some test cases -- I was just trying to ask you to adjust your test cases to the pattern that's in that directory. I think it should be easy, but let me know if you have any trouble! Thank you a lot!
Hi! I just meant that I saw you added some test cases -- I was just trying to ask you to adjust your test cases to the pattern that's in that directory. I think it should be easy, but let me know if you have any trouble! Thank you a lot!
Oh, interesting, I am not sure how those ended up there. I may have mixed up things. They seem to be all tests that were in this repo previously (at leat last year). I however pulled the latest before branching for my changes, so they must be yours.
bosphorus --anfread substitute_carefully.anf --cnfwrite substitute_carefully.cnf
crashes:
libc++abi: terminating due to uncaught exception of type polybori::PBoRiError: Variable index out of bounds.
(but also the master from your repo, I think)
FOUND the issue in ANF::readFileForMaxVar — need to handle ()_ better.
Let’s not make it work for special characters :) Instead, let’s emit an error of that happens.
On Mon 7. Apr 2025 at 11:35, mocenigo @.***> wrote:
@.**** commented on this pull request.
In src/anf.cpp https://github.com/meelgroup/bosphorus/pull/48#discussion_r2030860509:
}
size_t ANF::readFile(const std::string& filename) { // Read in the file line by line vectorstd::string text_file;
- size_t maxes[26] = {0};
I was assuming that only a-z and A-Z can be used, but in this case I am also making assumptions on their encoding (ASCII). Maybe using tolower and a std::is better, so people can also use ö or δ. Why not?
— Reply to this email directly, view it on GitHub https://github.com/meelgroup/bosphorus/pull/48#discussion_r2030860509, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKF4ON7IZKYFFS7JH5BAS32YJBHNAVCNFSM6AAAAAB2QWYMCKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDONBWGE4DCNRZG4 . You are receiving this because you commented.Message ID: @.***>
Let’s not make it work for special characters :) Instead, let’s emit an error of that happens.
Anyway, since there are then 26 characters (up to lower case/upper case equivalence) I would keep the array of 26 values. note that I am keeping counts of the variables and already adding +1 there, so I removed this addition from bosphorus.cpp .
Omitting "c" and "p" means that there are only 24 valid characters, I am not sure that allowing "C" and "P" are good ideas, so I am not allowing them. This means that their maxes counters will remain zero.
HI @msoos it is not clear to me what I should change. Since we only use latin alphabet letters for the variables, the 26-element array for the counts is sufficient, I have decuded to keep it and I have added a comment. I ran some tests, and added a test using a "ü" — what else should I do?
Can't seem to be able to rebase to remove those ANF and CNF and RESOLVE files. Can you please remove them from your PR?
Sorry, I did not have time to work on this today. I will try and find time tomorrow.
On 10. Apr 2025, at 23:02, Mate Soos @.***> wrote:
msoos left a comment (meelgroup/bosphorus#48) Can't seem to be able to rebase to remove those ANF and CNF and RESOLVE files. Can you please remove them from your PR?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
https://github.com/meelgroup/bosphorus/pull/48#issuecomment-2795159903 https://github.com/notifications/unsubscribe-auth/ABFK7QOHW57I6VEP4GUUXLD2Y3L57AVCNFSM6AAAAAB2QWYMCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJVGE2TSOJQGM
msoos left a comment (meelgroup/bosphorus#48) https://github.com/meelgroup/bosphorus/pull/48#issuecomment-2795159903 Can't seem to be able to rebase to remove those ANF and CNF and RESOLVE files. Can you please remove them from your PR?
— Reply to this email directly, view it on GitHub https://github.com/meelgroup/bosphorus/pull/48#issuecomment-2795159903, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFK7QOHW57I6VEP4GUUXLD2Y3L57AVCNFSM6AAAAAB2QWYMCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJVGE2TSOJQGM. You are receiving this because you authored the thread.
I have now made the GitHub actions work, and build a binary for linux amd64 and arm64, and mac arm64. It now also runs a test suite. You can find the tests under
tests/anf-tests-- they specify what needs to run and what the output should mostly look like. It's a very simple system. Please check it out and adjust your PR to match them. Sorry for the system being in such a sorry state before. With this change, I think your PR will also be a lot more impactful, as Bosphorus will finally be available for different architectures, etc.
Sadly, I do not understand how the test system works. Anyway, I changed the name of the "maxes" array and used the vector<uint32_t> you suggested instead. I changed the ending of the "resolve" files to mapping, so that one can used them to map back to the original variables.