-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
Description
When creating a variable to represent a bool value, we have to make sure it is constrained as a boolean.
For example:
assert_eq(bit * (bit - 1), 0); // where bit is a field variable
To make the code more expressive by itself, we can add a bool type in stdlib to constrain the field variable as a boolean value.
For example:
use std::bits;
let bool = bits::Bool::new(1); // the new method should also constrain the argument value.
This Bool
type can be an addition to the existing std::bits
stdlib module.
Related: #201 (comment)