un_algebra 0.9.0

Simple implementations of selected abstract algebraic structures--including groups, rings, and fields. Intended for self-study of abstract algebra concepts and not for production use.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//!
//! Helper types and functions for logic and sets.
//!

/// Test logical implication `x` => `y`.
pub fn imply(x: bool, y: bool) -> bool {
  (!x) || y
}


/// Test logical equivalence `x` <=> `y`.
pub fn iff(x: bool, y: bool) -> bool {
  imply(x, y) && imply(y, x)
}