Skip to content
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

Unexpected behavior on a factored system #23

Closed
espitau opened this issue Apr 2, 2021 · 3 comments
Closed

Unexpected behavior on a factored system #23

espitau opened this issue Apr 2, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@espitau
Copy link

espitau commented Apr 2, 2021

I tried to solve the following system which is not in ANF (ternary factorized system):

(x1*x4 + x0*x5)*x8 + (x3*x4 + x0*x7)*x9 + (x3*x6 + x2*x7)*x10 + (x2*x5 + x1*x6)*x11
(x2*x4 + x0*x6)*x8 + (x3*x5 + x1*x7)*x9 + (x2*x4 + x0*x6)*x10 + (x3*x5 + x1*x7)*x11
(x2*x5 + x1*x6)*x8 + (x1*x4 + x0*x5)*x9 + (x3*x4 + x0*x7)*x10 + (x3*x6 + x2*x7)*x11
(x3*x4 + x0*x7)*x8 + (x3*x6 + x2*x7)*x9 + (x2*x5 + x1*x6)*x10 + (x1*x4 + x0*x5)*x11
(x3*x5 + x1*x7)*x8 + (x2*x4 + x0*x6)*x9 + (x3*x5 + x1*x7)*x10 + (x2*x4 + x0*x6)*x11
(x3*x6 + x2*x7)*x8 + (x2*x5 + x1*x6)*x9 + (x1*x4 + x0*x5)*x10 + (x3*x4 + x0*x7)*x11 + 1

However, a bosphorus call on this system still produce a solution (which is not a solution
of the problem however). After inspecting the output with option --anfwrite, it seems that
some parsing is still going on and that a system is somehow produced, which is pretty odd.

Is it a feature, or should the parser raise an error because the system is not in ANF ?

@msoos
Copy link
Collaborator

msoos commented Apr 2, 2021

Hi,

Thanks for the report! Parser should raise an error. It misparses the system. This is a bug, I'm flagging it as such. If you wanna have a go at it, the parsing function is here: https://github.com/meelgroup/bosphorus/blob/master/src/anf.cpp#L100 Otherwise, we'll try to fix :)

Thanks again,

Mate

@msoos msoos added the bug Something isn't working label Apr 2, 2021
@msoos
Copy link
Collaborator

msoos commented Sep 13, 2021

Ah, I figured out what's going on. It ignores all brackets because people sometimes write x(1) and sometimes they write x1. I am now creating a test case to check for this!

@msoos msoos closed this as completed in 47edb6b Sep 13, 2021
@msoos
Copy link
Collaborator

msoos commented Sep 13, 2021

Yay, fixed it! Also, thanked you in the commit :) Thanks again for reporting, and sorry for the delay. I also added a bunch of tests so we should be able to catch these next time without much further ado :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants