public class DLPAtom extends DLPElementAdapter implements DLPLiteral
Atom.AtomImpl, Atom.RETURN_SET_PREDICATE
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Term<?>> |
arguments
a list of arguments of the atom
|
protected DLPPredicate |
pred
the predicate identifying the atom
|
Constructor and Description |
---|
DLPAtom()
Default-Ctor: Used for dynamic instantiation
|
DLPAtom(DLPAtom other)
Copy-Ctor: Generates a deep copy of the given atom
|
DLPAtom(FOLAtom other)
Copy-Ctor: Generates a deep copy of the given FOL atom
|
DLPAtom(java.lang.String symbol,
java.util.List<? extends Term<?>> terms)
Creates a predicate for the atom from symbol name
and uses a list of terms as arguments for the atom.
|
DLPAtom(java.lang.String symbol,
Term<?>... terms)
Ctor: Creates an atom with the given predicate as name and the
given terms as argument
|
Modifier and Type | Method and Description |
---|---|
void |
addArgument(Term<?> arg)
Adds an argument to the atom's argument list
|
DLPAtom |
clone()
Creates a deep copy of this formula
|
DLPAtom |
cloneWithAddedTerm(Term<?> tval)
Creates a copy of the literal and adds the
given term as argument to the end of the argument
list.
|
int |
compareTo(DLPLiteral o) |
DLPNeg |
complement() |
boolean |
equals(java.lang.Object o) |
java.util.List<? extends Term<?>> |
getArguments() |
int |
getArity() |
DLPAtom |
getAtom() |
java.util.Set<DLPAtom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
java.util.SortedSet<DLPLiteral> |
getLiterals() |
java.lang.String |
getName() |
DLPPredicate |
getPredicate() |
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.
|
Term<?> |
getTerm(int index) |
java.util.Set<Term<?>> |
getTerms() |
int |
hashCode() |
boolean |
isComplete() |
boolean |
isGround()
Checks whether this formula is ground, i.e.
|
Atom.RETURN_SET_PREDICATE |
setPredicate(Predicate predicate)
Changes the predicate of the atom.
|
DLPAtom |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
java.lang.String |
toString() |
getPredicateCls
containsTermsOfType, exchange, getTerms, isLiteral, isWellFormed, substitute
finalize, getClass, notify, notifyAll, wait, wait, wait
exchange, isWellFormed, substitute
getPredicateCls, isLiteral
containsTermsOfType, getTerms
protected DLPPredicate pred
protected java.util.List<Term<?>> arguments
public DLPAtom()
public DLPAtom(DLPAtom other)
other
- The atom acting as source for the deep copypublic DLPAtom(FOLAtom other)
other
- The FOL atom acting as source for the deep copypublic DLPAtom(java.lang.String symbol, Term<?>... terms)
symbol
- The name of the atomterms
- A list of Term> defining the arguments of the termpublic DLPAtom(java.lang.String symbol, java.util.List<? extends Term<?>> terms)
public DLPAtom getAtom()
getAtom
in interface DLPLiteral
public int getArity()
public java.lang.String toString()
toString
in class java.lang.Object
public Term<?> getTerm(int index)
public DLPAtom cloneWithAddedTerm(Term<?> tval)
DLPLiteral
cloneWithAddedTerm
in interface DLPLiteral
tval
- the new argument.public int hashCode()
hashCode
in interface SimpleLogicalFormula
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in interface SimpleLogicalFormula
equals
in class java.lang.Object
public DLPAtom clone()
SimpleLogicalFormula
clone
in interface ComplexLogicalFormula
clone
in interface SimpleLogicalFormula
clone
in interface DLPElement
clone
in class DLPElementAdapter
public java.lang.String getName()
public boolean isGround()
ComplexLogicalFormula
isGround
in interface ComplexLogicalFormula
isGround
in class ComplexLogicalFormulaAdapter
public DLPNeg complement()
complement
in interface Invertable
complement
in interface DLPLiteral
public DLPAtom substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
ComplexLogicalFormula
substitute
in interface ComplexLogicalFormula
substitute
in interface DLPElement
substitute
in interface DLPLiteral
v
- the term to be substituted.t
- the term to substitute.java.lang.IllegalArgumentException
- if "v" and "t" are of different sortspublic 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 FolSignature getSignature()
Formula
getSignature
in interface Formula
getSignature
in interface DLPElement
public java.util.Set<Term<?>> getTerms()
getTerms
in interface LogicStructure
public DLPPredicate getPredicate()
getPredicate
in interface Atom
public Atom.RETURN_SET_PREDICATE setPredicate(Predicate predicate)
Atom
setPredicate
in interface Atom
public void addArgument(Term<?> arg) throws LanguageException
Atom
addArgument
in interface Atom
arg
- The next argumentLanguageException
- If the language does not support
arguments for their constructs.public java.util.List<? extends Term<?>> getArguments()
getArguments
in interface Atom
public boolean isComplete()
isComplete
in interface Atom
public java.util.SortedSet<DLPLiteral> getLiterals()
getLiterals
in interface DLPElement
public int compareTo(DLPLiteral o)
compareTo
in interface java.lang.Comparable<DLPLiteral>