Class LiteralSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<Literal>
-
- ai.libs.jaicore.logic.fol.structure.LiteralSet
-
-
Constructor Summary
Constructors Constructor Description LiteralSet()
Creates an empty literal set.LiteralSet(Literal literal)
Creates a literal set that only contains the given literal.LiteralSet(java.lang.String literals, java.lang.String delimiter)
LiteralSet(java.util.Collection<Literal> literals)
LiteralSet(java.util.Collection<Literal> literals, boolean deep)
Creates a copy of the given collection.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(java.lang.String literalDescriptor)
boolean
containsGroundEqualityPredicateThatEvaluatesTo(boolean eval)
boolean
containsLiteralWithPredicatename(java.lang.String predicateName)
boolean
containsPositiveAndNegativeVersionOfLiteral()
java.util.Set<ConstantParam>
getConstantParams()
java.util.Map<VariableParam,VariableParam>
getImplyingMappingThatMapsFromConclusionVarsToPremiseVars(LiteralSet conclusion)
java.util.Set<InterpretedLiteral>
getInterpretedLiterals()
java.util.Set<Literal>
getLiteralsWithPropertyName(java.lang.String propertyName)
LiteralSet
getNegativeLiterals()
java.util.Set<LiteralParam>
getParameters()
LiteralSet
getPositiveLiterals()
java.util.Set<VariableParam>
getVariableParams()
boolean
hasVariables()
boolean
implies(LiteralSet conclusion)
boolean
isConsistent()
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.-
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
-
-
-
-
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)
-
-