public abstract class AssociativeFOLFormula extends FolFormula implements AssociativeFormula<RelationalFormula>, AssociativeFormulaSupport.AssociativeSupportBridge
Modifier and Type | Field and Description |
---|---|
protected AssociativeFormulaSupport<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 and Description |
---|
AssociativeFOLFormula()
Creates a new (empty) associative formula.
|
AssociativeFOLFormula(java.util.Collection<? extends RelationalFormula> formulas)
Creates a new associative formula with the given inner formulas.
|
AssociativeFOLFormula(RelationalFormula first,
RelationalFormula second)
Creates a new associative formula with the two given formulae
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
RelationalFormula element) |
boolean |
add(RelationalFormula e) |
boolean |
addAll(java.util.Collection<? extends RelationalFormula> c) |
boolean |
addAll(int index,
java.util.Collection<? extends RelationalFormula> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsQuantifier()
Checks whether this formula contains any quantification.
|
Signature |
createEmptySignature() |
boolean |
equals(java.lang.Object obj) |
RelationalFormula |
get(int index) |
java.util.Set<FOLAtom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
java.util.List<RelationalFormula> |
getFormulas() |
<C extends SimpleLogicalFormula> |
getFormulas(java.lang.Class<C> cls)
Process the formulas of type C that are children of this associative
formula
|
java.util.Set<Functor> |
getFunctors() |
java.util.Set<? extends Predicate> |
getPredicates()
Processes the set of all predicates which appear in this
formula
|
java.util.Set<Variable> |
getQuantifierVariables() |
java.util.Set<Term<?>> |
getTerms() |
<C extends Term<?>> |
getTerms(java.lang.Class<C> cls)
Processes the set containing all terms of type C.
|
java.util.Set<Variable> |
getUnboundVariables() |
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
boolean |
isClosed()
Checks whether this formula is closed, i.e.
|
boolean |
isClosed(java.util.Set<Variable> boundVariables)
Checks whether this formula is closed, i.e.
|
boolean |
isEmpty() |
boolean |
isLiteral() |
boolean |
isWellBound()
Checks whether this formula is well-bound, i.e.
|
boolean |
isWellBound(java.util.Set<Variable> boundVariables)
Checks whether this formula is well-bound, i.e.
|
java.util.Iterator<RelationalFormula> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<RelationalFormula> |
listIterator() |
java.util.ListIterator<RelationalFormula> |
listIterator(int index) |
RelationalFormula |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
RelationalFormula |
set(int index,
RelationalFormula element) |
int |
size() |
java.util.List<RelationalFormula> |
subList(int fromIndex,
int toIndex) |
AssociativeFOLFormula |
substitute(java.util.Map<? extends Term<?>,? extends Term<?>> termMap)
Substitutes all occurrences of all terms "v" in map.keyset() in this formula
by map.get(v) and returns the new formula.
NOTE: variables bound to quantifiers are not substituted in their inner formulas even if they appear in the map. |
AssociativeFOLFormula |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
clone, collapseAssociativeFormulas, combineWithAnd, combineWithOr, complement, getUniformProbability, isDnf, toDnf, toNnf
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, getSignature, isGround, isWellFormed
finalize, getClass, notify, notifyAll, wait, wait, wait
clone, getPredicateCls
getSignature
createEmptyFormula, getEmptySymbol, getOperatorSymbol
protected AssociativeFormulaSupport<RelationalFormula> support
public AssociativeFOLFormula()
public AssociativeFOLFormula(RelationalFormula first, RelationalFormula second)
first
- a relational formula.second
- a relational formula.public AssociativeFOLFormula(java.util.Collection<? extends RelationalFormula> formulas)
formulas
- a collection of formulas.public Signature createEmptySignature()
createEmptySignature
in interface AssociativeFormulaSupport.AssociativeSupportBridge
public java.util.Set<Functor> getFunctors()
getFunctors
in class RelationalFormula
public boolean containsQuantifier()
QuantifiedFormula
containsQuantifier
in interface QuantifiedFormula
public java.util.Set<Variable> getUnboundVariables()
getUnboundVariables
in interface QuantifiedFormula
public boolean isClosed()
QuantifiedFormula
isClosed
in interface QuantifiedFormula
public boolean isClosed(java.util.Set<Variable> boundVariables)
QuantifiedFormula
isClosed
in interface QuantifiedFormula
boundVariables
- the variables assumed to be bound.public boolean isWellBound()
QuantifiedFormula
isWellBound
in interface QuantifiedFormula
public boolean isWellBound(java.util.Set<Variable> boundVariables)
QuantifiedFormula
isWellBound
in interface QuantifiedFormula
boundVariables
- the variables assumed to be bound.public boolean isLiteral()
isLiteral
in interface SimpleLogicalFormula
public java.util.Set<Variable> getQuantifierVariables()
getQuantifierVariables
in interface QuantifiedFormula
getQuantifierVariables
in class FolFormula
public java.util.List<RelationalFormula> getFormulas()
getFormulas
in interface AssociativeFormula<RelationalFormula>
public <C extends SimpleLogicalFormula> java.util.Set<C> getFormulas(java.lang.Class<C> cls)
AssociativeFormula
getFormulas
in interface AssociativeFormula<RelationalFormula>
cls
- the class structure defining the type of formulas which
are searched.public java.util.Set<FOLAtom> getAtoms()
SimpleLogicalFormula
getAtoms
in interface SimpleLogicalFormula
getAtoms
in class RelationalFormula
public java.util.Set<Term<?>> getTerms()
getTerms
in interface LogicStructure
public <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls)
LogicStructure
getTerms
in interface LogicStructure
cls
- The Class structure containing type information about the
searched termpublic java.util.Set<? extends Predicate> getPredicates()
SimpleLogicalFormula
getPredicates
in interface SimpleLogicalFormula
public AssociativeFOLFormula substitute(Term<?> v, Term<?> t)
RelationalFormula
substitute
in interface ComplexLogicalFormula
substitute
in class FolFormula
v
- the term to be substituted.t
- the term to substitute.public AssociativeFOLFormula substitute(java.util.Map<? extends Term<?>,? extends Term<?>> termMap)
RelationalFormula
substitute
in interface ComplexLogicalFormula
substitute
in class RelationalFormula
termMap
- a mapping defining which terms to be substituted.public java.lang.String toString()
toString
in class RelationalFormula
public int hashCode()
hashCode
in interface java.util.Collection<RelationalFormula>
hashCode
in interface java.util.List<RelationalFormula>
hashCode
in interface SimpleLogicalFormula
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<RelationalFormula>
equals
in interface java.util.List<RelationalFormula>
equals
in interface SimpleLogicalFormula
equals
in class java.lang.Object
public boolean add(RelationalFormula e)
add
in interface java.util.Collection<RelationalFormula>
add
in interface java.util.List<RelationalFormula>
public boolean addAll(java.util.Collection<? extends RelationalFormula> c)
addAll
in interface java.util.Collection<RelationalFormula>
addAll
in interface java.util.List<RelationalFormula>
public void clear()
clear
in interface java.util.Collection<RelationalFormula>
clear
in interface java.util.List<RelationalFormula>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<RelationalFormula>
contains
in interface java.util.List<RelationalFormula>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<RelationalFormula>
containsAll
in interface java.util.List<RelationalFormula>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<RelationalFormula>
isEmpty
in interface java.util.List<RelationalFormula>
public java.util.Iterator<RelationalFormula> iterator()
iterator
in interface java.lang.Iterable<RelationalFormula>
iterator
in interface java.util.Collection<RelationalFormula>
iterator
in interface java.util.List<RelationalFormula>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<RelationalFormula>
remove
in interface java.util.List<RelationalFormula>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<RelationalFormula>
removeAll
in interface java.util.List<RelationalFormula>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<RelationalFormula>
retainAll
in interface java.util.List<RelationalFormula>
public int size()
size
in interface java.util.Collection<RelationalFormula>
size
in interface java.util.List<RelationalFormula>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<RelationalFormula>
toArray
in interface java.util.List<RelationalFormula>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<RelationalFormula>
toArray
in interface java.util.List<RelationalFormula>
public void add(int index, RelationalFormula element)
add
in interface java.util.List<RelationalFormula>
public boolean addAll(int index, java.util.Collection<? extends RelationalFormula> c)
addAll
in interface java.util.List<RelationalFormula>
public RelationalFormula get(int index)
get
in interface java.util.List<RelationalFormula>
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<RelationalFormula>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<RelationalFormula>
public java.util.ListIterator<RelationalFormula> listIterator()
listIterator
in interface java.util.List<RelationalFormula>
public java.util.ListIterator<RelationalFormula> listIterator(int index)
listIterator
in interface java.util.List<RelationalFormula>
public RelationalFormula remove(int index)
remove
in interface java.util.List<RelationalFormula>
public RelationalFormula set(int index, RelationalFormula element)
set
in interface java.util.List<RelationalFormula>
public java.util.List<RelationalFormula> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<RelationalFormula>