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
ConstructorDescriptionCreates 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 TypeMethodDescriptionvoid
add
(int index, ComplexConcept element) boolean
boolean
add
(ComplexConcept... formulas) Adds the specified elements to the end of this collection (optional operation).boolean
addAll
(int index, Collection<? extends ComplexConcept> c) boolean
addAll
(Collection<? extends ComplexConcept> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
get
(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.int
hashCode()
int
boolean
isEmpty()
boolean
iterator()
int
listIterator
(int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) set
(int index, ComplexConcept element) int
size()
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, getUniformProbability
Methods inherited from interface org.tweetyproject.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
createEmptyFormula, getEmptySymbol, getOperatorSymbol
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
Methods 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:
createEmptySignature
in interfaceAssociativeFormulaSupport.AssociativeSupportBridge
- Returns:
- An empty signature of the language of the AssociativeFormula implementation
-
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.
-
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()- Specified by:
isLiteral
in interfaceSimpleLogicalFormula
- Returns:
- true if the formula represents a literal in the language or false otherwise
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<ComplexConcept>
- Specified by:
hashCode
in interfaceList<ComplexConcept>
- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Specified by:
hashCode
in classComplexConcept
-
equals
- Specified by:
equals
in interfaceCollection<ComplexConcept>
- Specified by:
equals
in interfaceList<ComplexConcept>
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Specified by:
equals
in classComplexConcept
-
getFormulas
- Specified by:
getFormulas
in interfaceAssociativeFormula<ComplexConcept>
- Returns:
- all the formulas saved as childs in the associative formula
-
getFormulas
Description copied from interface:AssociativeFormula
Process the formulas of type C that are children of this associative formula- Specified by:
getFormulas
in 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:
add
in interfaceCollection<ComplexConcept>
- Specified by:
add
in 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:
addAll
in interfaceCollection<ComplexConcept>
- Specified by:
addAll
in interfaceList<ComplexConcept>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<ComplexConcept>
- Specified by:
clear
in interfaceList<ComplexConcept>
-
contains
- Specified by:
contains
in interfaceCollection<ComplexConcept>
- Specified by:
contains
in interfaceList<ComplexConcept>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<ComplexConcept>
- Specified by:
containsAll
in interfaceList<ComplexConcept>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<ComplexConcept>
- Specified by:
isEmpty
in interfaceList<ComplexConcept>
-
iterator
- Specified by:
iterator
in interfaceCollection<ComplexConcept>
- Specified by:
iterator
in interfaceIterable<ComplexConcept>
- Specified by:
iterator
in interfaceList<ComplexConcept>
-
remove
- Specified by:
remove
in interfaceCollection<ComplexConcept>
- Specified by:
remove
in interfaceList<ComplexConcept>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<ComplexConcept>
- Specified by:
removeAll
in interfaceList<ComplexConcept>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<ComplexConcept>
- Specified by:
retainAll
in interfaceList<ComplexConcept>
-
size
public int size()- Specified by:
size
in interfaceCollection<ComplexConcept>
- Specified by:
size
in interfaceList<ComplexConcept>
-
toArray
- Specified by:
toArray
in interfaceCollection<ComplexConcept>
- Specified by:
toArray
in interfaceList<ComplexConcept>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<ComplexConcept>
- Specified by:
toArray
in interfaceList<ComplexConcept>
-
add
- Specified by:
add
in interfaceList<ComplexConcept>
-
addAll
- Specified by:
addAll
in interfaceList<ComplexConcept>
-
get
- Specified by:
get
in interfaceList<ComplexConcept>
-
indexOf
- Specified by:
indexOf
in interfaceList<ComplexConcept>
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<ComplexConcept>
-
listIterator
- Specified by:
listIterator
in interfaceList<ComplexConcept>
-
listIterator
- Specified by:
listIterator
in interfaceList<ComplexConcept>
-
remove
- Specified by:
remove
in interfaceList<ComplexConcept>
-
set
- Specified by:
set
in interfaceList<ComplexConcept>
-
subList
- Specified by:
subList
in interfaceList<ComplexConcept>
-