Enum Class BooleanSemiring

java.lang.Object
java.lang.Enum<BooleanSemiring>
com.darkcollective.relix.provenance.BooleanSemiring
All Implemented Interfaces:
Semiring<Boolean>, Serializable, Comparable<BooleanSemiring>, Constable

public enum BooleanSemiring extends Enum<BooleanSemiring> implements Semiring<Boolean>
The boolean semiring (𝔹, ∨, ∧, false, true) — plain set semantics (a tuple is present or absent). This is relix's default annotation: a query with no provenance request behaves exactly as a boolean K-relation.

⊕ is logical OR (a tuple exists if any derivation produces it), ⊗ is logical AND (a join's tuple exists only if both inputs do), 0 is false (absent), and 1 is true.

  • Enum Constant Details

    • INSTANCE

      public static final BooleanSemiring INSTANCE
      The singleton instance.
  • Method Details

    • values

      public static BooleanSemiring[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BooleanSemiring valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • zero

      public Boolean zero()
      Description copied from interface: Semiring
      Returns the additive identity 0. It is the identity of Semiring.plus(K, K) and the annihilator of Semiring.times(K, K), and denotes an absent tuple.
      Specified by:
      zero in interface Semiring<Boolean>
      Returns:
      the additive identity 0
    • one

      public Boolean one()
      Description copied from interface: Semiring
      Returns the multiplicative identity 1. It is the identity of Semiring.times(K, K).
      Specified by:
      one in interface Semiring<Boolean>
      Returns:
      the multiplicative identity 1
    • plus

      public Boolean plus(Boolean a, Boolean b)
      Description copied from interface: Semiring
      Combines two annotations with ⊕ — the way alternative derivations of the same tuple (union, projection) are merged. Associative and commutative, with identity Semiring.zero().
      Specified by:
      plus in interface Semiring<Boolean>
      Parameters:
      a - the first annotation
      b - the second annotation
      Returns:
      a ⊕ b
    • times

      public Boolean times(Boolean a, Boolean b)
      Description copied from interface: Semiring
      Combines two annotations with ⊗ — the way the joint requirements of a tuple (join, product) are merged. Associative and commutative, with identity Semiring.one(), annihilated by Semiring.zero().
      Specified by:
      times in interface Semiring<Boolean>
      Parameters:
      a - the first annotation
      b - the second annotation
      Returns:
      a ⊗ b