Class LdoAssociativeFormula
- java.lang.Object
-
- net.sf.tweety.arg.dung.ldo.syntax.LdoFormula
-
- net.sf.tweety.arg.dung.ldo.syntax.LdoAssociativeFormula
-
- All Implemented Interfaces:
Iterable<LdoFormula>,Collection<LdoFormula>,List<LdoFormula>,net.sf.tweety.commons.Formula,net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge,net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<LdoFormula>,net.sf.tweety.logics.commons.syntax.interfaces.ClassicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable,net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable,net.sf.tweety.logics.commons.syntax.interfaces.Invertable,net.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware,net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
- Direct Known Subclasses:
LdoConjunction,LdoDisjunction
public abstract class LdoAssociativeFormula extends LdoFormula implements net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<LdoFormula>, net.sf.tweety.logics.commons.syntax.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
-
-
Field Summary
Fields Modifier and Type Field Description protected net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport<LdoFormula>supportThe inner formulas of this formula
-
Constructor Summary
Constructors Constructor Description LdoAssociativeFormula()Creates 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 Type Method Description voidadd(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()booleancontains(Object o)booleancontainsAll(Collection<?> c)net.sf.tweety.commons.SignaturecreateEmptySignature()booleanequals(Object obj)LdoFormulaget(int index)Set<LdoArgument>getAtoms()List<LdoFormula>getFormulas()<C extends net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula>
Set<C>getFormulas(Class<C> cls)Set<LdoFormula>getLiterals()Returns all literals, i.e.Set<net.sf.tweety.logics.pl.syntax.PlPredicate>getPredicates()DungSignaturegetSignature()inthashCode()intindexOf(Object o)booleanisEmpty()Iterator<LdoFormula>iterator()intlastIndexOf(Object o)ListIterator<LdoFormula>listIterator()ListIterator<LdoFormula>listIterator(int index)LdoFormularemove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)LdoFormulaset(int index, LdoFormula element)intsize()List<LdoFormula>subList(int fromIndex, int toIndex)Object[]toArray()Object[]toArray(Object[] a)StringtoString()-
Methods inherited from class net.sf.tweety.arg.dung.ldo.syntax.LdoFormula
clone, combineWithAnd, combineWithOr, complement, getDividers, getPredicateCls, getUniformProbability, isLiteral
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.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
replaceAll, sort, spliterator
-
-
-
-
Field Detail
-
support
protected net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport<LdoFormula> support
The inner formulas of this formula
-
-
Constructor Detail
-
LdoAssociativeFormula
public LdoAssociativeFormula()
Creates a new (empty) associative formula.
-
LdoAssociativeFormula
public LdoAssociativeFormula(Collection<? extends LdoFormula> formulas)
Creates a new associative formula with the given inner formulas.- Parameters:
formulas- a collection of formulas.
-
LdoAssociativeFormula
public LdoAssociativeFormula(LdoFormula first, LdoFormula second)
Creates a new associative formula with the two given formulae- Parameters:
first- a propositional formula.second- a propositional formula.
-
-
Method Detail
-
getPredicates
public Set<net.sf.tweety.logics.pl.syntax.PlPredicate> getPredicates()
- Specified by:
getPredicatesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getPredicatesin classLdoFormula
-
getFormulas
public List<LdoFormula> getFormulas()
- Specified by:
getFormulasin interfacenet.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<LdoFormula>
-
getFormulas
public <C extends net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula> Set<C> getFormulas(Class<C> cls)
- Specified by:
getFormulasin interfacenet.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<LdoFormula>
-
getAtoms
public Set<LdoArgument> getAtoms()
- Specified by:
getAtomsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getAtomsin classLdoFormula
-
getLiterals
public Set<LdoFormula> 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.
-
getSignature
public DungSignature getSignature()
- Specified by:
getSignaturein interfacenet.sf.tweety.commons.Formula- Overrides:
getSignaturein classLdoFormula
-
createEmptySignature
public net.sf.tweety.commons.Signature createEmptySignature()
- Specified by:
createEmptySignaturein interfacenet.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<LdoFormula>- Specified by:
hashCodein interfaceList<LdoFormula>- Specified by:
hashCodein interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
hashCodein classLdoFormula
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceCollection<LdoFormula>- Specified by:
equalsin interfaceList<LdoFormula>- Specified by:
equalsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
equalsin classLdoFormula
-
add
public boolean add(LdoFormula f)
- Specified by:
addin interfaceCollection<LdoFormula>- Specified by:
addin interfaceList<LdoFormula>
-
add
public boolean add(LdoFormula... formulas)
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
public boolean addAll(Collection<? extends LdoFormula> c)
- 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
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<LdoFormula>- Specified by:
containsin interfaceList<LdoFormula>
-
containsAll
public boolean containsAll(Collection<?> c)
- 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
public Iterator<LdoFormula> iterator()
- Specified by:
iteratorin interfaceCollection<LdoFormula>- Specified by:
iteratorin interfaceIterable<LdoFormula>- Specified by:
iteratorin interfaceList<LdoFormula>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<LdoFormula>- Specified by:
removein interfaceList<LdoFormula>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<LdoFormula>- Specified by:
removeAllin interfaceList<LdoFormula>
-
retainAll
public boolean retainAll(Collection<?> c)
- 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
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<LdoFormula>- Specified by:
toArrayin interfaceList<LdoFormula>
-
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArrayin interfaceCollection<LdoFormula>- Specified by:
toArrayin interfaceList<LdoFormula>
-
add
public void add(int index, LdoFormula element)- Specified by:
addin interfaceList<LdoFormula>
-
addAll
public boolean addAll(int index, Collection<? extends LdoFormula> c)- Specified by:
addAllin interfaceList<LdoFormula>
-
get
public LdoFormula get(int index)
- Specified by:
getin interfaceList<LdoFormula>
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOfin interfaceList<LdoFormula>
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<LdoFormula>
-
listIterator
public ListIterator<LdoFormula> listIterator()
- Specified by:
listIteratorin interfaceList<LdoFormula>
-
listIterator
public ListIterator<LdoFormula> listIterator(int index)
- Specified by:
listIteratorin interfaceList<LdoFormula>
-
remove
public LdoFormula remove(int index)
- Specified by:
removein interfaceList<LdoFormula>
-
set
public LdoFormula set(int index, LdoFormula element)
- Specified by:
setin interfaceList<LdoFormula>
-
subList
public List<LdoFormula> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceList<LdoFormula>
-
-