Package net.sf.tweety.logics.dl.syntax
Class ExistentialRestriction
- java.lang.Object
-
- net.sf.tweety.logics.dl.syntax.ComplexConcept
-
- net.sf.tweety.logics.dl.syntax.ExistentialRestriction
-
- All Implemented Interfaces:
Formula
,ClassicalFormula
,Conjunctable
,Disjunctable
,Invertable
,ProbabilityAware
,SimpleLogicalFormula
public class ExistentialRestriction extends ComplexConcept
This class models an existential restriction in description logics, i.e. an expression of the form "exists R.C" for a role R and a Concept C.- Author:
- Anna Gessler
-
-
Constructor Summary
Constructors Constructor Description ExistentialRestriction(Pair<AtomicRole,ComplexConcept> f)
ExistentialRestriction(AtomicRole r, ComplexConcept c)
Creates a new ALC existential restriction with the given role and concept.
-
Method Summary
Modifier and Type Method Description ComplexConcept
clone()
Creates a deep copy of this formulaComplexConcept
collapseAssociativeFormulas()
This method collapses all associative operations appearing in this term, e.g.boolean
equals(java.lang.Object obj)
ComplexConcept
getConcept()
Get the concept of the existential restriction.Pair<AtomicRole,ComplexConcept>
getFormulas()
Get the role and concept that are part of the existential restriction.java.util.Set<Predicate>
getPredicates()
Processes the set of all predicates which appear in this formulaAtomicRole
getRole()
Get the role of the existential restriction.DlSignature
getSignature()
Returns the signature of the language of this formula.int
hashCode()
boolean
isLiteral()
java.lang.String
toString()
-
Methods inherited from class net.sf.tweety.logics.dl.syntax.ComplexConcept
combineWithAnd, combineWithOr, complement, getAtoms, getPredicateCls, getUniformProbability
-
-
-
-
Constructor Detail
-
ExistentialRestriction
public ExistentialRestriction(AtomicRole r, ComplexConcept c)
Creates a new ALC existential restriction with the given role and concept.- Parameters:
r
- the rolec
- the concept that is being restricted by the role
-
ExistentialRestriction
public ExistentialRestriction(Pair<AtomicRole,ComplexConcept> f)
-
-
Method Detail
-
getFormulas
public Pair<AtomicRole,ComplexConcept> getFormulas()
Get the role and concept that are part of the existential restriction.- Returns:
- an atomic role and a concept
-
getRole
public AtomicRole getRole()
Get the role of the existential restriction.- Returns:
- an atomic role
-
getConcept
public ComplexConcept getConcept()
Get the concept of the existential restriction.- Returns:
- a concept
-
getSignature
public DlSignature getSignature()
Description copied from interface:Formula
Returns the signature of the language of this formula.- Specified by:
getSignature
in interfaceFormula
- Specified by:
getSignature
in classComplexConcept
- Returns:
- the signature of the language of this formula.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getPredicates
public java.util.Set<Predicate> getPredicates()
Description copied from interface:SimpleLogicalFormula
Processes the set of all predicates which appear in this formula- Specified by:
getPredicates
in interfaceSimpleLogicalFormula
- Specified by:
getPredicates
in classComplexConcept
- Returns:
- all predicates that appear in this formula
-
isLiteral
public boolean isLiteral()
- Returns:
- true if the formula represents a literal in the language or false otherwise
-
clone
public ComplexConcept clone()
Description copied from class:ComplexConcept
Creates a deep copy of this formula- Specified by:
clone
in interfaceSimpleLogicalFormula
- Specified by:
clone
in classComplexConcept
- Returns:
- the cloned formula
-
collapseAssociativeFormulas
public ComplexConcept collapseAssociativeFormulas()
Description copied from class:ComplexConcept
This method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
collapseAssociativeFormulas
in classComplexConcept
- Returns:
- the collapsed formula.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Specified by:
hashCode
in classComplexConcept
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Specified by:
equals
in classComplexConcept
-
-