Boolean logic

Function all_values

fn all_values(blk: fn(v: bool))

Iterates over all truth values by passing them to blk in an unspecified order

Function and

pure fn and(a: bool, b: bool) -> bool

Conjunction

Function eq

pure fn eq(a: bool, b: bool) -> bool

true if truth values a and b are indistinguishable in the logic

Function from_str

pure fn from_str(s: str) -> option<bool>

Parse logic value from s

Function implies

pure fn implies(a: bool, b: bool) -> bool

Implication in the logic, i.e. from a follows b

Function is_false

pure fn is_false(v: bool) -> bool

true if v represents falsehood in the logic

Function is_true

pure fn is_true(v: bool) -> bool

true if v represents truth in the logic

Function ne

pure fn ne(a: bool, b: bool) -> bool

true if truth values a and b are distinguishable in the logic

Function not

pure fn not(v: bool) -> bool

Negation / inverse

Function or

pure fn or(a: bool, b: bool) -> bool

Disjunction

Function to_bit

pure fn to_bit(v: bool) -> u8

converts truth value to an 8 bit byte

Function to_str

pure fn to_str(v: bool) -> str

Convert v into a string

Function xor

pure fn xor(a: bool, b: bool) -> bool

Exclusive or

Identical to or(and(a, not(b)), and(not(a), b))