Class AtomicRole
java.lang.Object
org.tweetyproject.logics.dl.syntax.ComplexConcept
org.tweetyproject.logics.dl.syntax.AtomicRole
- All Implemented Interfaces:
Formula,ClassicalFormula,Conjunctable,Disjunctable,Invertable,ProbabilityAware,SimpleLogicalFormula
This class models a role in description logics.
Note: Role assertions like (a,b):r ("the Individuals a,b are in the extension of the role r") are modeled with a different class:
Note: Role assertions like (a,b):r ("the Individuals a,b are in the extension of the role r") are modeled with a different class:
ConceptAssertion.- Author:
- Anna Gessler
-
Constructor Summary
ConstructorsConstructorDescriptionAtomicRole(String name) Initializes a role with the given name.Initializes an atomic role with the given predicate. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a deep copy of this formulaThis method collapses all associative operations appearing in this term, e.g.booleangetName()Returns the name of this atomic role.Returns the predicate representing this atomic role.Processes the set of all predicates which appear in this formulaReturns the signature of the language of this formula.inthashCode()booleantoString()Methods inherited from class org.tweetyproject.logics.dl.syntax.ComplexConcept
combineWithAnd, combineWithOr, complement, getAtoms, getPredicateCls, getUniformProbability
-
Constructor Details
-
AtomicRole
Initializes a role with the given name.- Parameters:
name- the name of the role
-
AtomicRole
Initializes an atomic role with the given predicate.- Parameters:
p- the predicate representing the role; must have arity 2- Throws:
IllegalArgumentException- if the predicate's arity is not 2
-
-
Method Details
-
getPredicate
Returns the predicate representing this atomic role.- Returns:
- the predicate representing this atomic role
-
getName
-
getPredicates
Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
getPredicatesin interfaceSimpleLogicalFormula- Specified by:
getPredicatesin classComplexConcept- Returns:
- all predicates that appear in this formula
-
clone
Description copied from class:ComplexConceptCreates a deep copy of this formula- Specified by:
clonein interfaceSimpleLogicalFormula- Specified by:
clonein classComplexConcept- Returns:
- the cloned formula
-
toString
-
collapseAssociativeFormulas
Description copied from class:ComplexConceptThis method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
collapseAssociativeFormulasin classComplexConcept- Returns:
- the collapsed formula.
-
isLiteral
public boolean isLiteral()- Returns:
- true if the formula represents a literal in the language or false otherwise
-
getSignature
Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
getSignaturein interfaceFormula- Specified by:
getSignaturein classComplexConcept- Returns:
- the signature of the language of this formula.
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceSimpleLogicalFormula- Specified by:
hashCodein classComplexConcept
-
equals
- Specified by:
equalsin interfaceSimpleLogicalFormula- Specified by:
equalsin classComplexConcept
-