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
ConstructorDescriptionComplement
(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.boolean
Compares 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.int
hashCode()
Computes the hash code for this complement based on its negated concept.boolean
Determines 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:
getPredicates
in interfaceSimpleLogicalFormula
- Specified by:
getPredicates
in classComplexConcept
- Returns:
- a set of predicates used in the negated concept
-
clone
Clones this complement.- Specified by:
clone
in interfaceSimpleLogicalFormula
- Specified by:
clone
in classComplexConcept
- Returns:
- a clone of this complement
-
collapseAssociativeFormulas
Collapses associative formulas within the negated concept, if applicable.- Specified by:
collapseAssociativeFormulas
in 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:
hashCode
in interfaceSimpleLogicalFormula
- Specified by:
hashCode
in 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:
true
if the negated concept is a literal,false
otherwise
-
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:
getSignature
in interfaceFormula
- Specified by:
getSignature
in 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:
equals
in interfaceSimpleLogicalFormula
- Specified by:
equals
in classComplexConcept
- Parameters:
obj
- the object to compare this complement with- Returns:
true
if the two complements are equal,false
otherwise
-