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() |
getPredicateClscontainsTermsOfType, exchange, getTerms, isLiteral, isWellFormed, substitutefinalize, getClass, notify, notifyAll, wait, wait, waitexchange, isWellFormed, substitutegetPredicateCls, isLiteralcontainsTermsOfType, getTermsprotected 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 DLPLiteralpublic int getArity()
public java.lang.String toString()
toString in class java.lang.Objectpublic Term<?> getTerm(int index)
public DLPAtom cloneWithAddedTerm(Term<?> tval)
DLPLiteralcloneWithAddedTerm in interface DLPLiteraltval - the new argument.public int hashCode()
hashCode in interface SimpleLogicalFormulahashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in interface SimpleLogicalFormulaequals in class java.lang.Objectpublic DLPAtom clone()
SimpleLogicalFormulaclone in interface ComplexLogicalFormulaclone in interface SimpleLogicalFormulaclone in interface DLPElementclone in class DLPElementAdapterpublic java.lang.String getName()
public boolean isGround()
ComplexLogicalFormulaisGround in interface ComplexLogicalFormulaisGround in class ComplexLogicalFormulaAdapterpublic DLPNeg complement()
complement in interface Invertablecomplement in interface DLPLiteralpublic DLPAtom substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
ComplexLogicalFormulasubstitute in interface ComplexLogicalFormulasubstitute in interface DLPElementsubstitute in interface DLPLiteralv - 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()
SimpleLogicalFormulagetAtoms in interface SimpleLogicalFormulagetAtoms in interface DLPElementpublic java.util.Set<DLPPredicate> getPredicates()
SimpleLogicalFormulagetPredicates in interface SimpleLogicalFormulagetPredicates in interface DLPElementpublic FolSignature getSignature()
FormulagetSignature in interface FormulagetSignature in interface DLPElementpublic java.util.Set<Term<?>> getTerms()
getTerms in interface LogicStructurepublic DLPPredicate getPredicate()
getPredicate in interface Atompublic Atom.RETURN_SET_PREDICATE setPredicate(Predicate predicate)
AtomsetPredicate in interface Atompublic void addArgument(Term<?> arg) throws LanguageException
AtomaddArgument in interface Atomarg - The next argumentLanguageException - If the language does not support
arguments for their constructs.public java.util.List<? extends Term<?>> getArguments()
getArguments in interface Atompublic boolean isComplete()
isComplete in interface Atompublic java.util.SortedSet<DLPLiteral> getLiterals()
getLiterals in interface DLPElementpublic int compareTo(DLPLiteral o)
compareTo in interface java.lang.Comparable<DLPLiteral>