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
The negate function of the Num Bit instance here, uses the complement## as implementation.
However, this is incorrect if you test it against the definition of the negate function.
The negate should be the additive inverse of something, so a + negate a = 0.
For Bit, the (+) is correctly defined as xor##, which means that negate should cause xor## to return a 0 bit.
This is of course done by giving the same bit to xor twice, which means that negate should be the identity function, id, and not the complement.
Suggested edit
Change the line from negate = complement##
to negate = id.