diff --git a/Cargo.toml b/Cargo.toml index b529ab3..f89f4e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "baa" -version = "0.9.3" +version = "0.9.4" edition = "2021" authors = ["Kevin Laeufer "] description = "BitVector and Array Arithmetic" diff --git a/src/ops.rs b/src/ops.rs index 429e9d6..cccd6b4 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -159,6 +159,14 @@ pub trait BitVecOps { } } + fn is_tru(&self) -> bool { + self.width() == 1 && self.words()[0] == 1 + } + + fn is_fals(&self) -> bool { + self.width() == 1 && self.words()[0] == 0 + } + fn is_zero(&self) -> bool { self.words().iter().all(|w| *w == 0) }