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
Right now, modulo builtin constraints are not always fulfilled.
Given a sub mod gate (for example: x3 = x2 - x1), then it must always be true that x3 + x1 - x2 = 0 or p.
Take, for example, x2 = p + 1 and x1 = 1. Our current implementation will calculate x3 = 0 as a result of the operation (x2 - x1) % p. The expected output is p, as it's the minimum value that meets the constraint (p + 1 - (p + 1) = 0). (the other possible value is 2p.
Right now, modulo builtin constraints are not always fulfilled.
x3 = x2 - x1
), then it must always be true thatx3 + x1 - x2 = 0 or p
.Take, for example,
x2 = p + 1
andx1 = 1
. Our current implementation will calculatex3 = 0
as a result of the operation(x2 - x1) % p
. The expected output isp
, as it's the minimum value that meets the constraint (p + 1 - (p + 1) = 0
). (the other possible value is2p
.See starkware-libs/cairo-lang#196 and cairo-lang implementation as reference.
The text was updated successfully, but these errors were encountered: