Package net.sf.tweety.logics.fol.syntax
Class AssociativeFolFormula
- java.lang.Object
-
- net.sf.tweety.logics.commons.syntax.RelationalFormula
-
- net.sf.tweety.logics.fol.syntax.FolFormula
-
- net.sf.tweety.logics.fol.syntax.AssociativeFolFormula
-
- All Implemented Interfaces:
Iterable<net.sf.tweety.logics.commons.syntax.RelationalFormula>,Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>,List<net.sf.tweety.logics.commons.syntax.RelationalFormula>,net.sf.tweety.commons.Formula,net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge,net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<net.sf.tweety.logics.commons.syntax.RelationalFormula>,net.sf.tweety.logics.commons.syntax.interfaces.ClassicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula,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.LogicStructure,net.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware,net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula,net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
- Direct Known Subclasses:
Conjunction,Disjunction,ExclusiveDisjunction
public abstract class AssociativeFolFormula extends FolFormula implements net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<net.sf.tweety.logics.commons.syntax.RelationalFormula>, net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
This class captures the common functionalities first order associative formulas 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<net.sf.tweety.logics.commons.syntax.RelationalFormula>supportThis helper class implements most of the common functionality of an associative formula, so the implementation can delegate the method calls to the support class.
-
Constructor Summary
Constructors Constructor Description AssociativeFolFormula()Creates a new (empty) associative formula.AssociativeFolFormula(Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)Creates a new associative formula with the given inner formulas.AssociativeFolFormula(net.sf.tweety.logics.commons.syntax.RelationalFormula first, net.sf.tweety.logics.commons.syntax.RelationalFormula second)Creates a new associative formula with the two given formulae
-
Method Summary
Modifier and Type Method Description voidadd(int index, net.sf.tweety.logics.commons.syntax.RelationalFormula element)booleanadd(net.sf.tweety.logics.commons.syntax.RelationalFormula e)booleanadd(FolFormula... formulas)Adds the specified elements to the end of this collection (optional operation).booleanaddAll(int index, Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> c)booleanaddAll(Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleancontainsQuantifier()net.sf.tweety.commons.SignaturecreateEmptySignature()booleanequals(Object obj)net.sf.tweety.logics.commons.syntax.RelationalFormulaget(int index)Set<FolAtom>getAtoms()List<net.sf.tweety.logics.commons.syntax.RelationalFormula>getFormulas()<C extends net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula>
Set<C>getFormulas(Class<C> cls)Set<net.sf.tweety.logics.commons.syntax.Functor>getFunctors()Set<? extends net.sf.tweety.logics.commons.syntax.Predicate>getPredicates()Set<net.sf.tweety.logics.commons.syntax.Variable>getQuantifierVariables()Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>getTerms()<C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>
Set<C>getTerms(Class<C> cls)Set<net.sf.tweety.logics.commons.syntax.Variable>getUnboundVariables()inthashCode()intindexOf(Object o)booleanisClosed()booleanisClosed(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)booleanisEmpty()booleanisLiteral()booleanisWellBound()booleanisWellBound(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)Iterator<net.sf.tweety.logics.commons.syntax.RelationalFormula>iterator()intlastIndexOf(Object o)ListIterator<net.sf.tweety.logics.commons.syntax.RelationalFormula>listIterator()ListIterator<net.sf.tweety.logics.commons.syntax.RelationalFormula>listIterator(int index)net.sf.tweety.logics.commons.syntax.RelationalFormularemove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)net.sf.tweety.logics.commons.syntax.RelationalFormulaset(int index, net.sf.tweety.logics.commons.syntax.RelationalFormula element)intsize()List<net.sf.tweety.logics.commons.syntax.RelationalFormula>subList(int fromIndex, int toIndex)AssociativeFolFormulasubstitute(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> termMap)AssociativeFolFormulasubstitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
Methods inherited from class net.sf.tweety.logics.fol.syntax.FolFormula
clone, collapseAssociativeFormulas, combineWithAnd, combineWithOr, complement, getSignature, getUniformProbability, isDnf, toDnf, toNnf
-
Methods inherited from class net.sf.tweety.logics.commons.syntax.RelationalFormula
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed
-
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<net.sf.tweety.logics.commons.syntax.RelationalFormula> support
This helper class implements most of the common functionality of an associative formula, so the implementation can delegate the method calls to the support class.
-
-
Constructor Detail
-
AssociativeFolFormula
public AssociativeFolFormula()
Creates a new (empty) associative formula.
-
AssociativeFolFormula
public AssociativeFolFormula(net.sf.tweety.logics.commons.syntax.RelationalFormula first, net.sf.tweety.logics.commons.syntax.RelationalFormula second)Creates a new associative formula with the two given formulae- Parameters:
first- a relational formula.second- a relational formula.
-
AssociativeFolFormula
public AssociativeFolFormula(Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
Creates a new associative formula with the given inner formulas.- Parameters:
formulas- a collection of formulas.
-
-
Method Detail
-
createEmptySignature
public net.sf.tweety.commons.Signature createEmptySignature()
- Specified by:
createEmptySignaturein interfacenet.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
-
getFunctors
public Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()
- Specified by:
getFunctorsin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
containsQuantifier
public boolean containsQuantifier()
- Specified by:
containsQuantifierin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
getUnboundVariables
public Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()
- Specified by:
getUnboundVariablesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isClosed
public boolean isClosed(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
- Specified by:
isClosedin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isWellBound
public boolean isWellBound()
- Specified by:
isWellBoundin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isWellBound
public boolean isWellBound(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
- Specified by:
isWellBoundin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
-
isLiteral
public boolean isLiteral()
- Specified by:
isLiteralin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
-
getQuantifierVariables
public Set<net.sf.tweety.logics.commons.syntax.Variable> getQuantifierVariables()
- Specified by:
getQuantifierVariablesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula- Overrides:
getQuantifierVariablesin classFolFormula
-
getFormulas
public List<net.sf.tweety.logics.commons.syntax.RelationalFormula> getFormulas()
- Specified by:
getFormulasin interfacenet.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
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<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
getAtoms
public Set<FolAtom> getAtoms()
- Specified by:
getAtomsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getAtomsin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
getTerms
public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
- Specified by:
getTermsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
-
getTerms
public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms(Class<C> cls)
- Specified by:
getTermsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
-
getPredicates
public Set<? extends net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
- Specified by:
getPredicatesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
-
substitute
public AssociativeFolFormula substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
substitutein classFolFormula
-
substitute
public AssociativeFolFormula substitute(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> termMap)
- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Overrides:
substitutein classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
toString
public String toString()
- Specified by:
toStringin classnet.sf.tweety.logics.commons.syntax.RelationalFormula
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
hashCodein interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
hashCodein interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Overrides:
hashCodein classObject
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
equalsin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
equalsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Overrides:
equalsin classObject
-
add
public boolean add(net.sf.tweety.logics.commons.syntax.RelationalFormula e)
- Specified by:
addin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
addin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
add
public boolean add(FolFormula... 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 net.sf.tweety.logics.commons.syntax.RelationalFormula> c)
- Specified by:
addAllin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
addAllin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
clearin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
containsin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
containsAllin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
isEmptyin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
iterator
public Iterator<net.sf.tweety.logics.commons.syntax.RelationalFormula> iterator()
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
removein interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
removeAllin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
retainAllin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
size
public int size()
- Specified by:
sizein interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
sizein interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
toArrayin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<net.sf.tweety.logics.commons.syntax.RelationalFormula>- Specified by:
toArrayin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
add
public void add(int index, net.sf.tweety.logics.commons.syntax.RelationalFormula element)
-
addAll
public boolean addAll(int index, Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> c)
-
get
public net.sf.tweety.logics.commons.syntax.RelationalFormula get(int index)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
listIterator
public ListIterator<net.sf.tweety.logics.commons.syntax.RelationalFormula> listIterator()
- Specified by:
listIteratorin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
listIterator
public ListIterator<net.sf.tweety.logics.commons.syntax.RelationalFormula> listIterator(int index)
- Specified by:
listIteratorin interfaceList<net.sf.tweety.logics.commons.syntax.RelationalFormula>
-
remove
public net.sf.tweety.logics.commons.syntax.RelationalFormula remove(int index)
-
set
public net.sf.tweety.logics.commons.syntax.RelationalFormula set(int index, net.sf.tweety.logics.commons.syntax.RelationalFormula element)
-
-