Package mepk.kernel

Class DVRSet

java.lang.Object
mepk.kernel.DVRSet

public final class DVRSet extends Object
A set of 'distinct variable restrictions', each of which is an unordered pair of different variable names. DVR sets are values: they cannot be modified after they have been created. They are equal if (and only if) they have the same structure. It is only possible to create instances using the methods in this class.
  • Field Details

    • EMPTY

      public static final DVRSet EMPTY
      The empty DVRSet.
  • Method Details

    • Distinct

      public static DVRSet Distinct(String... varNames)
      Create a DVRSet.
      Parameters:
      varNames - the distinct variables
      Returns:
      the set
    • Distinct

      public static DVRSet Distinct(List<String> varNames)
      Create a DVRSet.
      Parameters:
      varNames - the distinct variables
      Returns:
      the set
    • Distinct

      public static DVRSet Distinct(Iterable<DVRSet> dvrSets)
      Create the union of multiple DVRSets.
      Parameters:
      dvrSets - the DVRSets to be merged
      Returns:
      the union DVRSet
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • substitute

      public DVRSet substitute(String replacedVarName, Iterable<String> replacementVarNames)
      Replace the given variable name by the given set of variable names.
      Parameters:
      replacedVarName - the variable name to be replaced
      replacementVarNames - the replacing variable names
      Returns:
      the new DVR set
    • andDistinct

      public DVRSet andDistinct(DVRSet addedDVRs)
      Create a new DVR set by adding the given DVRs.
      Parameters:
      addedDVRs - the DVRs to be added
      Returns:
      the new DVR set
    • andDistinct

      public DVRSet andDistinct(String... varNames)
      Create a new DVR set by adding a DVR for each pair of the given variable names.
      Parameters:
      varNames - the variables which should be distinct.
      Returns:
      the new DVR set
    • toString

      public String toString()
      Overrides:
      toString in class Object