Class Complement
java.lang.Object
org.tweetyproject.logics.dl.syntax.ComplexConcept
org.tweetyproject.logics.dl.syntax.Complement
- All Implemented Interfaces:
Formula,ClassicalFormula,Conjunctable,Disjunctable,Invertable,ProbabilityAware,SimpleLogicalFormula
This class models the complement (negation) in description logics.
- Author:
- Anna Gessler
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionComplement(ComplexConcept formula) Creates a new complement with the given concept to be negated. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this complement.Collapses associative formulas within the negated concept, if applicable.booleanCompares this complement to another object for equality.Returns the concept that is being negated by this complement.Returns the set of predicates used in this complement, which are the predicates used in the negated concept.Returns the description logic signature for this complement, which is the signature of the negated concept.inthashCode()Computes the hash code for this complement based on its negated concept.booleanDetermines whether this complement is a literal.toString()Returns a string representation of this complement.Methods inherited from class org.tweetyproject.logics.dl.syntax.ComplexConcept
combineWithAnd, combineWithOr, complement, getAtoms, getPredicateCls, getUniformProbability
-
Constructor Details
-
Complement
Creates a new complement with the given concept to be negated.- Parameters:
formula- the concept to be negated
-
-
Method Details
-
getPredicates
Returns the set of predicates used in this complement, which are the predicates used in the negated concept.- Specified by:
getPredicatesin interfaceSimpleLogicalFormula- Specified by:
getPredicatesin classComplexConcept- Returns:
- a set of predicates used in the negated concept
-
clone
Clones this complement.- Specified by:
clonein interfaceSimpleLogicalFormula- Specified by:
clonein classComplexConcept- Returns:
- a clone of this complement
-
collapseAssociativeFormulas
Collapses associative formulas within the negated concept, if applicable.- Specified by:
collapseAssociativeFormulasin classComplexConcept- Returns:
- a new complement with the collapsed negated concept
-
toString
-
hashCode
public int hashCode()Computes the hash code for this complement based on its negated concept.- Specified by:
hashCodein interfaceSimpleLogicalFormula- Specified by:
hashCodein classComplexConcept- Returns:
- the hash code of this complement
-
isLiteral
public boolean isLiteral()Determines whether this complement is a literal. A complement is a literal if the negated concept is a literal.- Returns:
trueif the negated concept is a literal,falseotherwise
-
getFormula
Returns the concept that is being negated by this complement.- Returns:
- the concept being negated by this complement
-
getSignature
Returns the description logic signature for this complement, which is the signature of the negated concept.- Specified by:
getSignaturein interfaceFormula- Specified by:
getSignaturein classComplexConcept- Returns:
- the signature of the negated concept
-
equals
Compares this complement to another object for equality. Two complements are considered equal if their negated concepts are equal.- Specified by:
equalsin interfaceSimpleLogicalFormula- Specified by:
equalsin classComplexConcept- Parameters:
obj- the object to compare this complement with- Returns:
trueif the two complements are equal,falseotherwise
-