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

public class AtomicConcept extends ComplexConcept
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: ConceptAssertion.
Author:
Anna Gessler
  • Constructor Details

    • AtomicConcept

      public AtomicConcept(String name)
      Initializes an atomic concept with the given name.
      Parameters:
      name - the name of the atomic concept
    • AtomicConcept

      public AtomicConcept(Predicate p)
      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

      public Predicate getPredicate()
      Returns the predicate representing this atomic concept.
      Returns:
      the predicate representing this atomic concept
    • getName

      public String getName()
      Returns the name of this atomic concept.
      Returns:
      the name of this atomic concept
    • getPredicates

      public Set<Predicate> 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 interface SimpleLogicalFormula
      Specified by:
      getPredicates in class ComplexConcept
      Returns:
      a set containing the predicate of this atomic concept
    • clone

      public ComplexConcept clone()
      Clones this atomic concept.
      Specified by:
      clone in interface SimpleLogicalFormula
      Specified by:
      clone in class ComplexConcept
      Returns:
      a clone of this atomic concept
    • toString

      public String toString()
      Returns a string representation of this atomic concept.
      Overrides:
      toString in class Object
      Returns:
      the name of this atomic concept as a string
    • collapseAssociativeFormulas

      public AtomicConcept 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 class ComplexConcept
      Returns:
      this atomic concept
    • isLiteral

      public boolean isLiteral()
      Indicates whether this concept is a literal.
      Returns:
      true, since atomic concepts are considered literals
    • getSignature

      public DlSignature getSignature()
      Returns the description logic signature for this atomic concept, which includes the predicate representing this concept.
      Specified by:
      getSignature in interface Formula
      Specified by:
      getSignature in class ComplexConcept
      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 interface SimpleLogicalFormula
      Specified by:
      hashCode in class ComplexConcept
      Returns:
      the hash code of this atomic concept
    • equals

      public boolean equals(Object obj)
      Compares this atomic concept to another object for equality. Two atomic concepts are considered equal if their predicates are equal.
      Specified by:
      equals in interface SimpleLogicalFormula
      Specified by:
      equals in class ComplexConcept
      Parameters:
      obj - the object to compare this atomic concept with
      Returns:
      true if the two atomic concepts are equal, false otherwise