Class AtomicConcept
java.lang.Object
org.tweetyproject.logics.dl.syntax.ComplexConcept
org.tweetyproject.logics.dl.syntax.AtomicConcept
- All Implemented Interfaces:
Formula,ClassicalFormula,Conjunctable,Disjunctable,Invertable,ProbabilityAware,SimpleLogicalFormula
This class models an atomic concept (aka concept name) in description logics.
Note: Concept assertions like a:C ("the Individual a is in the extension of the Concept C") are modeled with a different class:
Note: Concept assertions like a:C ("the Individual a is in the extension of the Concept C") are modeled with a different class:
ConceptAssertion.- Author:
- Anna Gessler
-
Constructor Summary
ConstructorsConstructorDescriptionAtomicConcept(String name) Initializes an atomic concept with the given name.Initializes an atomic concept with the given predicate. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this atomic concept.Collapses associative formulas.booleanCompares this atomic concept to another object for equality.getName()Returns the name of this atomic concept.Returns the predicate representing this atomic concept.Returns the set of predicates used in this atomic concept, which in this case is the singleton set containing the predicate representing this concept.Returns the description logic signature for this atomic concept, which includes the predicate representing this concept.inthashCode()Computes the hash code for this atomic concept based on its predicate.booleanIndicates whether this concept is a literal.toString()Returns a string representation of this atomic concept.Methods inherited from class org.tweetyproject.logics.dl.syntax.ComplexConcept
combineWithAnd, combineWithOr, complement, getAtoms, getPredicateCls, getUniformProbability
-
Constructor Details
-
AtomicConcept
Initializes an atomic concept with the given name.- Parameters:
name- the name of the atomic concept
-
AtomicConcept
Initializes an atomic concept with the given predicate.- Parameters:
p- the predicate representing the atomic concept; must have arity 1- Throws:
IllegalArgumentException- if the predicate's arity is not 1
-
-
Method Details
-
getPredicate
Returns the predicate representing this atomic concept.- Returns:
- the predicate representing this atomic concept
-
getName
Returns the name of this atomic concept.- Returns:
- the name of this atomic concept
-
getPredicates
Returns the set of predicates used in this atomic concept, which in this case is the singleton set containing the predicate representing this concept.- Specified by:
getPredicatesin interfaceSimpleLogicalFormula- Specified by:
getPredicatesin classComplexConcept- Returns:
- a set containing the predicate of this atomic concept
-
clone
Clones this atomic concept.- Specified by:
clonein interfaceSimpleLogicalFormula- Specified by:
clonein classComplexConcept- Returns:
- a clone of this atomic concept
-
toString
-
collapseAssociativeFormulas
Collapses associative formulas. For atomic concepts, this method simply returns the current object, as atomic concepts cannot be further collapsed.- Specified by:
collapseAssociativeFormulasin classComplexConcept- Returns:
- this atomic concept
-
isLiteral
public boolean isLiteral()Indicates whether this concept is a literal.- Returns:
true, since atomic concepts are considered literals
-
getSignature
Returns the description logic signature for this atomic concept, which includes the predicate representing this concept.- Specified by:
getSignaturein interfaceFormula- Specified by:
getSignaturein classComplexConcept- Returns:
- the signature of this atomic concept
-
hashCode
public int hashCode()Computes the hash code for this atomic concept based on its predicate.- Specified by:
hashCodein interfaceSimpleLogicalFormula- Specified by:
hashCodein classComplexConcept- Returns:
- the hash code of this atomic concept
-
equals
Compares this atomic concept to another object for equality. Two atomic concepts are considered equal if their predicates are equal.- Specified by:
equalsin interfaceSimpleLogicalFormula- Specified by:
equalsin classComplexConcept- Parameters:
obj- the object to compare this atomic concept with- Returns:
trueif the two atomic concepts are equal,falseotherwise
-