public class DLPHead extends DLPElementAdapter implements AssociativeFormula<DLPLiteral>, Disjunctable, ComplexLogicalFormula, AssociativeFormulaSupport.AssociativeSupportBridge
Modifier and Type | Field and Description |
---|---|
private AssociativeFormulaSupport<DLPLiteral> |
assocSupport |
Constructor and Description |
---|
DLPHead()
Default-Ctor: Generates empty head
|
DLPHead(DLPHead other)
Copy-Ctor: Generates a deep copy from the given head
|
DLPHead(DLPLiteral literal)
Ctor: Generates a head with one literal
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(DLPLiteral arg0) |
void |
add(int index,
DLPLiteral element) |
boolean |
addAll(java.util.Collection<? extends DLPLiteral> arg0) |
boolean |
addAll(int index,
java.util.Collection<? extends DLPLiteral> c) |
void |
clear() |
DLPHead |
clone()
Creates a deep copy of this formula
|
SimpleLogicalFormula |
combineWithOr(Disjunctable f) |
boolean |
contains(java.lang.Object arg0) |
boolean |
containsAll(java.util.Collection<?> arg0) |
DLPHead |
createEmptyFormula() |
Signature |
createEmptySignature() |
boolean |
equals(java.lang.Object other) |
DLPLiteral |
get(int index) |
java.util.Set<DLPAtom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
java.lang.String |
getEmptySymbol() |
java.util.List<DLPLiteral> |
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.SortedSet<DLPLiteral> |
getLiterals() |
java.lang.String |
getOperatorSymbol() |
java.lang.Class<? extends Predicate> |
getPredicateCls() |
java.util.Set<DLPPredicate> |
getPredicates()
Processes the set of all predicates which appear in this
formula
|
FolSignature |
getSignature()
Returns the signature of the language of this formula.
|
java.util.Set<Term<?>> |
getTerms() |
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
java.util.Iterator<DLPLiteral> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<DLPLiteral> |
listIterator() |
java.util.ListIterator<DLPLiteral> |
listIterator(int index) |
DLPLiteral |
remove(int index) |
boolean |
remove(java.lang.Object arg0) |
boolean |
removeAll(java.util.Collection<?> arg0) |
boolean |
retainAll(java.util.Collection<?> arg0) |
DLPLiteral |
set(int index,
DLPLiteral element) |
int |
size() |
java.util.List<DLPLiteral> |
subList(int fromIndex,
int toIndex) |
DLPHead |
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[] arg0) |
java.lang.String |
toString() |
containsTermsOfType, exchange, getTerms, isGround, isLiteral, isWellFormed, substitute
finalize, getClass, notify, notifyAll, wait, wait, wait
exchange, isGround, isWellFormed, substitute
isLiteral
containsTermsOfType, getTerms
private AssociativeFormulaSupport<DLPLiteral> assocSupport
public DLPHead()
public DLPHead(DLPLiteral literal)
literal
- The literal of the headpublic DLPHead(DLPHead other)
other
- The DLPHead object which acts as source for the copy operation.public java.util.Set<DLPAtom> getAtoms()
SimpleLogicalFormula
getAtoms
in interface SimpleLogicalFormula
getAtoms
in interface DLPElement
public java.util.Set<DLPPredicate> getPredicates()
SimpleLogicalFormula
getPredicates
in interface SimpleLogicalFormula
getPredicates
in interface DLPElement
public java.lang.Class<? extends Predicate> getPredicateCls()
getPredicateCls
in interface SimpleLogicalFormula
getPredicateCls
in class DLPElementAdapter
public FolSignature getSignature()
Formula
getSignature
in interface Formula
getSignature
in interface DLPElement
public java.util.List<DLPLiteral> getFormulas()
getFormulas
in interface AssociativeFormula<DLPLiteral>
public <C extends SimpleLogicalFormula> java.util.Set<C> getFormulas(java.lang.Class<C> cls)
AssociativeFormula
getFormulas
in interface AssociativeFormula<DLPLiteral>
cls
- the class structure defining the type of formulas which
are searched.public DLPHead substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
ComplexLogicalFormula
substitute
in interface ComplexLogicalFormula
substitute
in interface DLPElement
v
- the term to be substituted.t
- the term to substitute.java.lang.IllegalArgumentException
- if "v" and "t" are of different sortspublic SimpleLogicalFormula combineWithOr(Disjunctable f)
combineWithOr
in interface Disjunctable
f
- a formula to be combined with OR and this.public DLPHead createEmptyFormula()
createEmptyFormula
in interface AssociativeFormulaSupport.AssociativeSupportBridge
public Signature createEmptySignature()
createEmptySignature
in interface AssociativeFormulaSupport.AssociativeSupportBridge
public java.lang.String getOperatorSymbol()
getOperatorSymbol
in interface AssociativeFormulaSupport.AssociativeSupportBridge
public java.lang.String getEmptySymbol()
getEmptySymbol
in interface AssociativeFormulaSupport.AssociativeSupportBridge
public DLPHead clone()
SimpleLogicalFormula
clone
in interface ComplexLogicalFormula
clone
in interface SimpleLogicalFormula
clone
in interface DLPElement
clone
in class DLPElementAdapter
public java.util.SortedSet<DLPLiteral> getLiterals()
getLiterals
in interface DLPElement
public boolean equals(java.lang.Object other)
equals
in interface java.util.Collection<DLPLiteral>
equals
in interface java.util.List<DLPLiteral>
equals
in interface SimpleLogicalFormula
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection<DLPLiteral>
hashCode
in interface java.util.List<DLPLiteral>
hashCode
in interface SimpleLogicalFormula
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean add(DLPLiteral arg0)
add
in interface java.util.Collection<DLPLiteral>
add
in interface java.util.List<DLPLiteral>
public boolean addAll(java.util.Collection<? extends DLPLiteral> arg0)
addAll
in interface java.util.Collection<DLPLiteral>
addAll
in interface java.util.List<DLPLiteral>
public void clear()
clear
in interface java.util.Collection<DLPLiteral>
clear
in interface java.util.List<DLPLiteral>
public boolean contains(java.lang.Object arg0)
contains
in interface java.util.Collection<DLPLiteral>
contains
in interface java.util.List<DLPLiteral>
public boolean containsAll(java.util.Collection<?> arg0)
containsAll
in interface java.util.Collection<DLPLiteral>
containsAll
in interface java.util.List<DLPLiteral>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<DLPLiteral>
isEmpty
in interface java.util.List<DLPLiteral>
public java.util.Iterator<DLPLiteral> iterator()
iterator
in interface java.lang.Iterable<DLPLiteral>
iterator
in interface java.util.Collection<DLPLiteral>
iterator
in interface java.util.List<DLPLiteral>
public boolean remove(java.lang.Object arg0)
remove
in interface java.util.Collection<DLPLiteral>
remove
in interface java.util.List<DLPLiteral>
public boolean removeAll(java.util.Collection<?> arg0)
removeAll
in interface java.util.Collection<DLPLiteral>
removeAll
in interface java.util.List<DLPLiteral>
public boolean retainAll(java.util.Collection<?> arg0)
retainAll
in interface java.util.Collection<DLPLiteral>
retainAll
in interface java.util.List<DLPLiteral>
public int size()
size
in interface java.util.Collection<DLPLiteral>
size
in interface java.util.List<DLPLiteral>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<DLPLiteral>
toArray
in interface java.util.List<DLPLiteral>
public <T> T[] toArray(T[] arg0)
toArray
in interface java.util.Collection<DLPLiteral>
toArray
in interface java.util.List<DLPLiteral>
public java.util.Set<Term<?>> getTerms()
getTerms
in interface LogicStructure
public void add(int index, DLPLiteral element)
add
in interface java.util.List<DLPLiteral>
public boolean addAll(int index, java.util.Collection<? extends DLPLiteral> c)
addAll
in interface java.util.List<DLPLiteral>
public DLPLiteral get(int index)
get
in interface java.util.List<DLPLiteral>
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<DLPLiteral>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<DLPLiteral>
public java.util.ListIterator<DLPLiteral> listIterator()
listIterator
in interface java.util.List<DLPLiteral>
public java.util.ListIterator<DLPLiteral> listIterator(int index)
listIterator
in interface java.util.List<DLPLiteral>
public DLPLiteral remove(int index)
remove
in interface java.util.List<DLPLiteral>
public DLPLiteral set(int index, DLPLiteral element)
set
in interface java.util.List<DLPLiteral>
public java.util.List<DLPLiteral> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<DLPLiteral>