Class InstanceAssignment

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.util.Collection<? extends Constant>,​java.lang.Integer>

    public class InstanceAssignment
    extends java.util.HashMap<java.util.Collection<? extends Constant>,​java.lang.Integer>
    Instances of this class represent assignenment of true instances for a given predicate wrt. to a set of constants.
    Author:
    Matthias Thimm
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      InstanceAssignment​(Predicate predicate)
      Creates a new instance assignment for the given predicate with no assignments.
      InstanceAssignment​(Predicate predicate, java.util.Map<? extends java.util.Collection<? extends Constant>,​java.lang.Integer> map)
      Creates a new instance assignment for the given predicate with the given map.
    • Method Summary

      Modifier and Type Method Description
      static java.util.Set<InstanceAssignment> enumerateInstanceAssignments​(Predicate p, java.util.Set<java.util.Set<Constant>> constants)
      Determines the set of all instance assignments for the given predicate and equivalence classes.
      boolean equals​(java.lang.Object obj)  
      Predicate getPredicate()
      Returns the predicate of this assignment.
      int hashCode()  
      int numberOfConstants()
      Returns the number of constants assigned by this assignment, i.e.
      java.lang.Integer put​(java.util.Collection<? extends Constant> key, java.lang.Integer value)  
      java.lang.String toString()  
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • InstanceAssignment

        public InstanceAssignment​(Predicate predicate)
        Creates a new instance assignment for the given predicate with no assignments.
        Parameters:
        predicate - a predicate.
      • InstanceAssignment

        public InstanceAssignment​(Predicate predicate,
                                  java.util.Map<? extends java.util.Collection<? extends Constant>,​java.lang.Integer> map)
        Creates a new instance assignment for the given predicate with the given map.
        Parameters:
        predicate - a predicate.
        map - a map mapping sets of constants to integers.
    • Method Detail

      • getPredicate

        public Predicate getPredicate()
        Returns the predicate of this assignment.
        Returns:
        the predicate of this assignment.
      • put

        public java.lang.Integer put​(java.util.Collection<? extends Constant> key,
                                     java.lang.Integer value)
        Specified by:
        put in interface java.util.Map<java.util.Collection<? extends Constant>,​java.lang.Integer>
        Overrides:
        put in class java.util.HashMap<java.util.Collection<? extends Constant>,​java.lang.Integer>
      • numberOfConstants

        public int numberOfConstants()
        Returns the number of constants assigned by this assignment, i.e. the sum of the values in this map.
        Returns:
        the number of constants assigned by this assignment.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.AbstractMap<java.util.Collection<? extends Constant>,​java.lang.Integer>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.util.Collection<? extends Constant>,​java.lang.Integer>
        Overrides:
        hashCode in class java.util.AbstractMap<java.util.Collection<? extends Constant>,​java.lang.Integer>
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Map<java.util.Collection<? extends Constant>,​java.lang.Integer>
        Overrides:
        equals in class java.util.AbstractMap<java.util.Collection<? extends Constant>,​java.lang.Integer>
      • enumerateInstanceAssignments

        public static java.util.Set<InstanceAssignment> enumerateInstanceAssignments​(Predicate p,
                                                                                     java.util.Set<java.util.Set<Constant>> constants)
        Determines the set of all instance assignments for the given predicate and equivalence classes.
        Parameters:
        p - a predicate.
        constants - a set of constants.
        Returns:
        a set of instance assignments.