Class AssociativeDlFormula
java.lang.Object
org.tweetyproject.logics.dl.syntax.ComplexConcept
org.tweetyproject.logics.dl.syntax.AssociativeDlFormula
- All Implemented Interfaces:
Iterable<ComplexConcept>,Collection<ComplexConcept>,List<ComplexConcept>,SequencedCollection<ComplexConcept>,Formula,AssociativeFormulaSupport.AssociativeSupportBridge,AssociativeFormula<ComplexConcept>,ClassicalFormula,Conjunctable,Disjunctable,Invertable,ProbabilityAware,SimpleLogicalFormula
- Direct Known Subclasses:
Intersection,Union
public abstract class AssociativeDlFormula
extends ComplexConcept
implements AssociativeFormula<ComplexConcept>, AssociativeFormulaSupport.AssociativeSupportBridge
This class captures the common functionalities of description logic associative formulas
(union and intersection).
- Author:
- Anna Gessler, Matthias Thimm, Tim Janus
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new (empty) associative formula.AssociativeDlFormula(Collection<? extends ComplexConcept> formulas) Creates a new associative formula with the given inner formulas.AssociativeDlFormula(ComplexConcept first, ComplexConcept second) Creates a new associative formula with the two given formulae -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, ComplexConcept element) booleanbooleanadd(ComplexConcept... formulas) Adds the specified elements to the end of this collection (optional operation).booleanaddAll(int index, Collection<? extends ComplexConcept> c) booleanaddAll(Collection<? extends ComplexConcept> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanget(int index) <C extends SimpleLogicalFormula>
Set<C> getFormulas(Class<C> cls) Process the formulas of type C that are children of this associative formulaProcesses the set of all predicates which appear in this formulaReturns the signature of the language of this formula.inthashCode()intbooleanisEmpty()booleaniterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) set(int index, ComplexConcept element) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class org.tweetyproject.logics.dl.syntax.ComplexConcept
clone, collapseAssociativeFormulas, combineWithAnd, combineWithOr, complement, getAtoms, getPredicateCls, getUniformProbabilityMethods inherited from interface org.tweetyproject.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
createEmptyFormula, getEmptySymbol, getOperatorSymbolMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliteratorMethods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.SimpleLogicalFormula
clone, getAtoms, getPredicateCls
-
Constructor Details
-
AssociativeDlFormula
public AssociativeDlFormula()Creates a new (empty) associative formula. -
AssociativeDlFormula
Creates a new associative formula with the two given formulae- Parameters:
first- a relational formula.second- a relational formula.
-
AssociativeDlFormula
Creates a new associative formula with the given inner formulas.- Parameters:
formulas- a collection of formulas.
-
-
Method Details
-
createEmptySignature
- Specified by:
createEmptySignaturein interfaceAssociativeFormulaSupport.AssociativeSupportBridge- Returns:
- An empty signature of the language of the AssociativeFormula implementation
-
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.
-
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
-
isLiteral
public boolean isLiteral()- Specified by:
isLiteralin interfaceSimpleLogicalFormula- Returns:
- true if the formula represents a literal in the language or false otherwise
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<ComplexConcept>- Specified by:
hashCodein interfaceList<ComplexConcept>- Specified by:
hashCodein interfaceSimpleLogicalFormula- Specified by:
hashCodein classComplexConcept
-
equals
- Specified by:
equalsin interfaceCollection<ComplexConcept>- Specified by:
equalsin interfaceList<ComplexConcept>- Specified by:
equalsin interfaceSimpleLogicalFormula- Specified by:
equalsin classComplexConcept
-
getFormulas
- Specified by:
getFormulasin interfaceAssociativeFormula<ComplexConcept>- Returns:
- all the formulas saved as childs in the associative formula
-
getFormulas
Description copied from interface:AssociativeFormulaProcess the formulas of type C that are children of this associative formula- Specified by:
getFormulasin interfaceAssociativeFormula<ComplexConcept>- Type Parameters:
C- the type of formulas- Parameters:
cls- the class structure defining the type of formulas which are searched.- Returns:
- A set of formulas of type C which are members of the associative formula
-
toString
-
add
- Specified by:
addin interfaceCollection<ComplexConcept>- Specified by:
addin interfaceList<ComplexConcept>
-
add
Adds the specified elements to the end of this collection (optional operation).- Parameters:
formulas- to be appended to collection- Returns:
- true if all elements were added, false otherwise
-
addAll
- Specified by:
addAllin interfaceCollection<ComplexConcept>- Specified by:
addAllin interfaceList<ComplexConcept>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<ComplexConcept>- Specified by:
clearin interfaceList<ComplexConcept>
-
contains
- Specified by:
containsin interfaceCollection<ComplexConcept>- Specified by:
containsin interfaceList<ComplexConcept>
-
containsAll
- Specified by:
containsAllin interfaceCollection<ComplexConcept>- Specified by:
containsAllin interfaceList<ComplexConcept>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<ComplexConcept>- Specified by:
isEmptyin interfaceList<ComplexConcept>
-
iterator
- Specified by:
iteratorin interfaceCollection<ComplexConcept>- Specified by:
iteratorin interfaceIterable<ComplexConcept>- Specified by:
iteratorin interfaceList<ComplexConcept>
-
remove
- Specified by:
removein interfaceCollection<ComplexConcept>- Specified by:
removein interfaceList<ComplexConcept>
-
removeAll
- Specified by:
removeAllin interfaceCollection<ComplexConcept>- Specified by:
removeAllin interfaceList<ComplexConcept>
-
retainAll
- Specified by:
retainAllin interfaceCollection<ComplexConcept>- Specified by:
retainAllin interfaceList<ComplexConcept>
-
size
public int size()- Specified by:
sizein interfaceCollection<ComplexConcept>- Specified by:
sizein interfaceList<ComplexConcept>
-
toArray
- Specified by:
toArrayin interfaceCollection<ComplexConcept>- Specified by:
toArrayin interfaceList<ComplexConcept>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<ComplexConcept>- Specified by:
toArrayin interfaceList<ComplexConcept>
-
add
- Specified by:
addin interfaceList<ComplexConcept>
-
addAll
- Specified by:
addAllin interfaceList<ComplexConcept>
-
get
- Specified by:
getin interfaceList<ComplexConcept>
-
indexOf
- Specified by:
indexOfin interfaceList<ComplexConcept>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<ComplexConcept>
-
listIterator
- Specified by:
listIteratorin interfaceList<ComplexConcept>
-
listIterator
- Specified by:
listIteratorin interfaceList<ComplexConcept>
-
remove
- Specified by:
removein interfaceList<ComplexConcept>
-
set
- Specified by:
setin interfaceList<ComplexConcept>
-
subList
- Specified by:
subListin interfaceList<ComplexConcept>
-