Class BooleanSemiring

java.lang.Object
org.tweetyproject.math.algebra.Semiring<Boolean>
org.tweetyproject.math.algebra.BooleanSemiring

public class BooleanSemiring extends Semiring<Boolean>
This class represents a Boolean semiring. In this semiring, the addition operation corresponds to logical OR, the multiplication operation corresponds to logical AND, the additive identity is false, and the multiplicative identity is true.
Author:
Sandra Hoffmann
  • Constructor Details

    • BooleanSemiring

      public BooleanSemiring()
      Constructs a BooleanSemiring with logical OR, logical AND as addition and multiplication operations, respectively. The additive identity is false, and the multiplicative identity is true.
  • Method Details

    • getRandomElement

      public Boolean getRandomElement()
      Generates a random Boolean element.
      Specified by:
      getRandomElement in class Semiring<Boolean>
      Returns:
      A random Boolean element.
    • toNumericalValue

      public double toNumericalValue(Boolean weight)
      Converts a Boolean weight to its numerical representation.
      Overrides:
      toNumericalValue in class Semiring<Boolean>
      Parameters:
      weight - The Boolean weight to be converted.
      Returns:
      1.0 if the weight is true, 0.0 otherwise.
    • divide

      public Boolean divide(Boolean dividend, Boolean divisor)
      Implements the division operation in this semiring.
      Specified by:
      divide in class Semiring<Boolean>
      Parameters:
      dividend - The Boolean dividend.
      divisor - The Boolean divisor.
      Returns:
      The result of the division operation (logical AND).