Class BeliefSet<T extends Formula,​S extends Signature>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean EQUALS_USES_SIGNATURE
      Flag that determines whether Object.equals(Object) checks only for equality of the beliefs in the belief sets or whether it also checks for equality of the signatures attached to the belief sets.
    • Constructor Summary

      Constructors 
      Constructor Description
      BeliefSet()
      Creates a new (empty) belief set.
      BeliefSet​(java.util.Collection<? extends T> c)
      Creates a new belief set with the given collection of formulae.
      BeliefSet​(S sig)
      Creates a new belief set with the given type of signature.
    • Method Summary

      Modifier and Type Method Description
      boolean add​(T f)  
      boolean add​(T... formulas)
      Adds the specified elements to the end of this collection (optional operation).
      boolean addAll​(java.util.Collection<? extends T> c)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      boolean equals​(java.lang.Object obj)  
      S getSignature()
      Returns a copy of the signature that is attached to his belief base (it is always equal to or larger than BeliefBase.getMinimalSignature()).
      int hashCode()  
      boolean isEmpty()  
      java.util.Iterator<T> iterator()  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      void setSignature​(S sig)
      Sets the signature that is attached to his belief base to a copy of the given signature.
      int size()  
      java.lang.Object[] toArray()  
      <R> R[] toArray​(R[] a)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Field Detail

      • EQUALS_USES_SIGNATURE

        public static final boolean EQUALS_USES_SIGNATURE
        Flag that determines whether Object.equals(Object) checks only for equality of the beliefs in the belief sets or whether it also checks for equality of the signatures attached to the belief sets.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BeliefSet

        public BeliefSet()
        Creates a new (empty) belief set.
      • BeliefSet

        public BeliefSet​(java.util.Collection<? extends T> c)
        Creates a new belief set with the given collection of formulae.
        Parameters:
        c - a collection of formulae.
      • BeliefSet

        public BeliefSet​(S sig)
        Creates a new belief set with the given type of signature.
        Parameters:
        sig - a signature
    • Method Detail

      • getSignature

        public S getSignature()
        Returns a copy of the signature that is attached to his belief base (it is always equal to or larger than BeliefBase.getMinimalSignature()).
        Returns:
        the signature of this knowledge base.
      • setSignature

        public void setSignature​(S sig)
                          throws java.lang.IllegalArgumentException
        Sets the signature that is attached to his belief base to a copy of the given signature.
        Parameters:
        sig - a signature
        Throws:
        java.lang.IllegalArgumentException - if the given signature is smaller in size than the belief base's formulas' signature.
      • add

        public boolean add​(T f)
        Specified by:
        add in interface java.util.Collection<T extends Formula>
      • add

        public boolean add​(T... formulas)
        Adds the specified elements to the end of this collection (optional operation).
        Parameters:
        formulas - to be appended to collection
        Returns:
        true if all elements were added, false otherwise
      • addAll

        public boolean addAll​(java.util.Collection<? extends T> c)
        Specified by:
        addAll in interface java.util.Collection<T extends Formula>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<T extends Formula>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<T extends Formula>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<T extends Formula>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<T extends Formula>
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Collection<T extends Formula>
        Overrides:
        equals in class java.lang.Object
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<T extends Formula>
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.util.Collection<T extends Formula>
        Specified by:
        iterator in interface java.lang.Iterable<T extends Formula>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<T extends Formula>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<T extends Formula>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<T extends Formula>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<T extends Formula>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<T extends Formula>
      • toArray

        public <R> R[] toArray​(R[] a)
        Specified by:
        toArray in interface java.util.Collection<T extends Formula>
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface BeliefBase
        Overrides:
        toString in class java.lang.Object