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
ConstructorDescriptionAtomicConcept
(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.boolean
Compares 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.int
hashCode()
Computes the hash code for this atomic concept based on its predicate.boolean
Indicates 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:
getPredicates
in interfaceSimpleLogicalFormula
- Specified by:
getPredicates
in classComplexConcept
- Returns:
- a set containing the predicate of this atomic concept
-
clone
Clones this atomic concept.- Specified by:
clone
in interfaceSimpleLogicalFormula
- Specified by:
clone
in 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:
collapseAssociativeFormulas
in 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:
getSignature
in interfaceFormula
- Specified by:
getSignature
in 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:
hashCode
in interfaceSimpleLogicalFormula
- Specified by:
hashCode
in 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:
equals
in interfaceSimpleLogicalFormula
- Specified by:
equals
in classComplexConcept
- Parameters:
obj
- the object to compare this atomic concept with- Returns:
true
if the two atomic concepts are equal,false
otherwise
-