Class LiteralSet

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Literal>, java.util.Collection<Literal>, java.util.Set<Literal>
    Direct Known Subclasses:
    Clause, Monom

    public class LiteralSet
    extends java.util.HashSet<Literal>
    A set of literals.
    See Also:
    Serialized Form
    • Constructor Detail

      • LiteralSet

        public LiteralSet()
        Creates an empty literal set. Literals can be added later.
      • LiteralSet

        public LiteralSet​(java.lang.String literals,
                          java.lang.String delimiter)
      • LiteralSet

        public LiteralSet​(Literal literal)
        Creates a literal set that only contains the given literal. Other literals can be added later.
        Parameters:
        literal - A literal.
      • LiteralSet

        public LiteralSet​(java.util.Collection<Literal> literals,
                          boolean deep)
        Creates a copy of the given collection. The created literal set will contain all the elements from the given collection.
        Parameters:
        literals - A collection of literals.
      • LiteralSet

        public LiteralSet​(java.util.Collection<Literal> literals)
      • LiteralSet

        public LiteralSet​(java.util.Collection<Literal> literals,
                          java.util.Map<? extends LiteralParam,​? extends LiteralParam> mapping)
        Creates a copy of the given collection under the given parameter mapping.
        Parameters:
        literals - A collection of literals.
        mapping - A mapping of literals.
    • Method Detail

      • add

        public boolean add​(java.lang.String literalDescriptor)
      • implies

        public boolean implies​(LiteralSet conclusion)
                        throws java.lang.InterruptedException
        Parameters:
        conclusion - Another literal set that may be concluded by this literal set.
        Returns:
        True, if this literal set logically implies the conclusion literal set under any partial mapping.
        Throws:
        java.lang.InterruptedException
      • isConsistent

        public boolean isConsistent()
      • getImplyingMappingThatMapsFromConclusionVarsToPremiseVars

        public java.util.Map<VariableParam,​VariableParam> getImplyingMappingThatMapsFromConclusionVarsToPremiseVars​(LiteralSet conclusion)
                                                                                                                   throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • getPositiveLiterals

        public LiteralSet getPositiveLiterals()
      • getNegativeLiterals

        public LiteralSet getNegativeLiterals()
      • getParameters

        public java.util.Set<LiteralParam> getParameters()
        Returns:
        All the parameters (variable and constant) from the contained literals.
      • getVariableParams

        public java.util.Set<VariableParam> getVariableParams()
        Returns:
        All the variable parameters from the contained literals.
      • getConstantParams

        public java.util.Set<ConstantParam> getConstantParams()
      • getInterpretedLiterals

        public java.util.Set<InterpretedLiteral> getInterpretedLiterals()
        Returns:
        All interpreted literals that could be used as branching or looping condition
      • toPropositionalSet

        public java.util.Set<java.lang.String> toPropositionalSet()
        This method converts the LiteralSet into a PropositionalSet meaning that the resulting set only contains properties of the literals contained in this LiteralSet.
        Returns:
        A set of property name strings.
      • containsPositiveAndNegativeVersionOfLiteral

        public boolean containsPositiveAndNegativeVersionOfLiteral()
      • containsGroundEqualityPredicateThatEvaluatesTo

        public boolean containsGroundEqualityPredicateThatEvaluatesTo​(boolean eval)
      • containsLiteralWithPredicatename

        public boolean containsLiteralWithPredicatename​(java.lang.String predicateName)
      • hasVariables

        public boolean hasVariables()
      • getLiteralsWithPropertyName

        public java.util.Set<Literal> getLiteralsWithPropertyName​(java.lang.String propertyName)