Class LdoAssociativeFormula
java.lang.Object
org.tweetyproject.arg.dung.ldo.syntax.LdoFormula
org.tweetyproject.arg.dung.ldo.syntax.LdoAssociativeFormula
- All Implemented Interfaces:
Iterable<LdoFormula>
,Collection<LdoFormula>
,List<LdoFormula>
,SequencedCollection<LdoFormula>
,Formula
,AssociativeFormulaSupport.AssociativeSupportBridge
,AssociativeFormula<LdoFormula>
,ClassicalFormula
,Conjunctable
,Disjunctable
,Invertable
,ProbabilityAware
,SimpleLogicalFormula
- Direct Known Subclasses:
LdoConjunction
,LdoDisjunction
public abstract class LdoAssociativeFormula
extends LdoFormula
implements AssociativeFormula<LdoFormula>, AssociativeFormulaSupport.AssociativeSupportBridge
This class captures the common functionalities of formulas with an associative
operation like conjunction, disjunction, etc.
- Author:
- Matthias Thimm, Tim Janus
-
Constructor Summary
ConstructorDescriptionCreates a new (empty) associative formula.LdoAssociativeFormula
(Collection<? extends LdoFormula> formulas) Creates a new associative formula with the given inner formulas.LdoAssociativeFormula
(LdoFormula first, LdoFormula second) Creates a new associative formula with the two given formulae -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int index, LdoFormula element) boolean
add
(LdoFormula f) boolean
add
(LdoFormula... formulas) Adds the specified elements to the end of this collection (optional operation).boolean
addAll
(int index, Collection<? extends LdoFormula> c) boolean
addAll
(Collection<? extends LdoFormula> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
get
(int index) getAtoms()
Processes the set of all atoms which appear in this formula<C extends SimpleLogicalFormula>
Set<C> getFormulas
(Class<C> cls) Process the formulas of type C that are children of this associative formulaReturns all literals, i.e.Processes the set of all predicates which appear in this formulaReturns the signature of the language of this formula.int
hashCode()
int
boolean
isEmpty()
iterator()
int
listIterator
(int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) set
(int index, LdoFormula element) int
size()
subList
(int fromIndex, int toIndex) Object[]
toArray()
Object[]
toString()
Methods inherited from class org.tweetyproject.arg.dung.ldo.syntax.LdoFormula
clone, combineWithAnd, combineWithOr, complement, getDividers, getPredicateCls, getUniformProbability, isLiteral
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, getPredicateCls, isLiteral
-
Constructor Details
-
LdoAssociativeFormula
public LdoAssociativeFormula()Creates a new (empty) associative formula. -
LdoAssociativeFormula
Creates a new associative formula with the given inner formulas.- Parameters:
formulas
- a collection of formulas.
-
LdoAssociativeFormula
Creates a new associative formula with the two given formulae- Parameters:
first
- a propositional formula.second
- a propositional formula.
-
-
Method Details
-
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 classLdoFormula
- Returns:
- all predicates that appear in this formula
-
getFormulas
- Specified by:
getFormulas
in interfaceAssociativeFormula<LdoFormula>
- 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<LdoFormula>
- 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
-
getAtoms
Description copied from interface:SimpleLogicalFormula
Processes the set of all atoms which appear in this formula- Specified by:
getAtoms
in interfaceSimpleLogicalFormula
- Specified by:
getAtoms
in classLdoFormula
- Returns:
- The set of all atoms
-
getLiterals
Description copied from class:LdoFormula
Returns all literals, i.e. all formulas of the form "a" or "!a" where "a" is a proposition, that appear in this formula.- Specified by:
getLiterals
in classLdoFormula
- Returns:
- all literals appearing in this formula.
-
toString
-
getSignature
Description copied from interface:Formula
Returns the signature of the language of this formula.- Specified by:
getSignature
in interfaceFormula
- Overrides:
getSignature
in classLdoFormula
- Returns:
- the signature of the language of this formula.
-
createEmptySignature
- Specified by:
createEmptySignature
in interfaceAssociativeFormulaSupport.AssociativeSupportBridge
- Returns:
- An empty signature of the language of the AssociativeFormula implementation
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<LdoFormula>
- Specified by:
hashCode
in interfaceList<LdoFormula>
- Specified by:
hashCode
in interfaceSimpleLogicalFormula
- Specified by:
hashCode
in classLdoFormula
-
equals
- Specified by:
equals
in interfaceCollection<LdoFormula>
- Specified by:
equals
in interfaceList<LdoFormula>
- Specified by:
equals
in interfaceSimpleLogicalFormula
- Specified by:
equals
in classLdoFormula
-
add
- Specified by:
add
in interfaceCollection<LdoFormula>
- Specified by:
add
in interfaceList<LdoFormula>
-
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<LdoFormula>
- Specified by:
addAll
in interfaceList<LdoFormula>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<LdoFormula>
- Specified by:
clear
in interfaceList<LdoFormula>
-
contains
- Specified by:
contains
in interfaceCollection<LdoFormula>
- Specified by:
contains
in interfaceList<LdoFormula>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<LdoFormula>
- Specified by:
containsAll
in interfaceList<LdoFormula>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<LdoFormula>
- Specified by:
isEmpty
in interfaceList<LdoFormula>
-
iterator
- Specified by:
iterator
in interfaceCollection<LdoFormula>
- Specified by:
iterator
in interfaceIterable<LdoFormula>
- Specified by:
iterator
in interfaceList<LdoFormula>
-
remove
- Specified by:
remove
in interfaceCollection<LdoFormula>
- Specified by:
remove
in interfaceList<LdoFormula>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<LdoFormula>
- Specified by:
removeAll
in interfaceList<LdoFormula>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<LdoFormula>
- Specified by:
retainAll
in interfaceList<LdoFormula>
-
size
public int size()- Specified by:
size
in interfaceCollection<LdoFormula>
- Specified by:
size
in interfaceList<LdoFormula>
-
toArray
- Specified by:
toArray
in interfaceCollection<LdoFormula>
- Specified by:
toArray
in interfaceList<LdoFormula>
-
toArray
- Specified by:
toArray
in interfaceCollection<LdoFormula>
- Specified by:
toArray
in interfaceList<LdoFormula>
-
add
- Specified by:
add
in interfaceList<LdoFormula>
-
addAll
- Specified by:
addAll
in interfaceList<LdoFormula>
-
get
- Specified by:
get
in interfaceList<LdoFormula>
-
indexOf
- Specified by:
indexOf
in interfaceList<LdoFormula>
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<LdoFormula>
-
listIterator
- Specified by:
listIterator
in interfaceList<LdoFormula>
-
listIterator
- Specified by:
listIterator
in interfaceList<LdoFormula>
-
remove
- Specified by:
remove
in interfaceList<LdoFormula>
-
set
- Specified by:
set
in interfaceList<LdoFormula>
-
subList
- Specified by:
subList
in interfaceList<LdoFormula>
-