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>,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, Collection<LdoFormula>
This class captures the common functionalities of formulas with an associative
operation like conjunction, disjunction, etc.
- Author:
- Matthias Thimm, Tim Janus
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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 TypeMethodDescriptionvoidadd(int index, LdoFormula element) booleanadd(LdoFormula f) booleanadd(LdoFormula... formulas) Adds the specified elements to the end of this collection (optional operation).booleanaddAll(int index, Collection<? extends LdoFormula> c) booleanaddAll(Collection<? extends LdoFormula> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanget(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.inthashCode()intbooleanisEmpty()iterator()intlistIterator(int index) remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) set(int index, LdoFormula element) intsize()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, isLiteralMethods 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
replaceAll, sort, spliteratorMethods 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:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
getPredicatesin interfaceSimpleLogicalFormula- Specified by:
getPredicatesin classLdoFormula- Returns:
- all predicates that appear in this formula
-
getFormulas
- Specified by:
getFormulasin interfaceAssociativeFormula<LdoFormula>- 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<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:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
getAtomsin interfaceSimpleLogicalFormula- Specified by:
getAtomsin classLdoFormula- Returns:
- The set of all atoms
-
getLiterals
Description copied from class:LdoFormulaReturns all literals, i.e. all formulas of the form "a" or "!a" where "a" is a proposition, that appear in this formula.- Specified by:
getLiteralsin classLdoFormula- Returns:
- all literals appearing in this formula.
-
toString
-
getSignature
Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
getSignaturein interfaceFormula- Overrides:
getSignaturein classLdoFormula- Returns:
- the signature of the language of this formula.
-
createEmptySignature
- Specified by:
createEmptySignaturein interfaceAssociativeFormulaSupport.AssociativeSupportBridge- Returns:
- An empty signature of the language of the AssociativeFormula implementation
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<LdoFormula>- Specified by:
hashCodein interfaceList<LdoFormula>- Specified by:
hashCodein interfaceSimpleLogicalFormula- Specified by:
hashCodein classLdoFormula
-
equals
- Specified by:
equalsin interfaceCollection<LdoFormula>- Specified by:
equalsin interfaceList<LdoFormula>- Specified by:
equalsin interfaceSimpleLogicalFormula- Specified by:
equalsin classLdoFormula
-
add
- Specified by:
addin interfaceCollection<LdoFormula>- Specified by:
addin 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:
addAllin interfaceCollection<LdoFormula>- Specified by:
addAllin interfaceList<LdoFormula>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<LdoFormula>- Specified by:
clearin interfaceList<LdoFormula>
-
contains
- Specified by:
containsin interfaceCollection<LdoFormula>- Specified by:
containsin interfaceList<LdoFormula>
-
containsAll
- Specified by:
containsAllin interfaceCollection<LdoFormula>- Specified by:
containsAllin interfaceList<LdoFormula>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<LdoFormula>- Specified by:
isEmptyin interfaceList<LdoFormula>
-
iterator
- Specified by:
iteratorin interfaceCollection<LdoFormula>- Specified by:
iteratorin interfaceIterable<LdoFormula>- Specified by:
iteratorin interfaceList<LdoFormula>
-
remove
- Specified by:
removein interfaceCollection<LdoFormula>- Specified by:
removein interfaceList<LdoFormula>
-
removeAll
- Specified by:
removeAllin interfaceCollection<LdoFormula>- Specified by:
removeAllin interfaceList<LdoFormula>
-
retainAll
- Specified by:
retainAllin interfaceCollection<LdoFormula>- Specified by:
retainAllin interfaceList<LdoFormula>
-
size
public int size()- Specified by:
sizein interfaceCollection<LdoFormula>- Specified by:
sizein interfaceList<LdoFormula>
-
toArray
- Specified by:
toArrayin interfaceCollection<LdoFormula>- Specified by:
toArrayin interfaceList<LdoFormula>
-
toArray
- Specified by:
toArrayin interfaceCollection<LdoFormula>- Specified by:
toArrayin interfaceList<LdoFormula>
-
add
- Specified by:
addin interfaceList<LdoFormula>
-
addAll
- Specified by:
addAllin interfaceList<LdoFormula>
-
get
- Specified by:
getin interfaceList<LdoFormula>
-
indexOf
- Specified by:
indexOfin interfaceList<LdoFormula>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<LdoFormula>
-
listIterator
- Specified by:
listIteratorin interfaceList<LdoFormula>
-
listIterator
- Specified by:
listIteratorin interfaceList<LdoFormula>
-
remove
- Specified by:
removein interfaceList<LdoFormula>
-
set
- Specified by:
setin interfaceList<LdoFormula>
-
subList
- Specified by:
subListin interfaceList<LdoFormula>
-