top of page

BoolSemiring

Flag4j provides a reference implementation of the Semiring interface through the BoolSemiring class.
The BoolSemiring class is immutable and represents a boolean variable that supports the operations defined on semirings. It is essentially a thin wrapper around Java's primitive boolean type.

Initialization

A BoolSemiring value can be initialized from an integer or a primitive boolean.

Arithmetic

BoolSemiring objects support all the basic arithmetic operations of a general semiring in addition to the basic operations for a boolean.
For a full list of supported operations see the Javadoc API reference.
bottom of page