public class DLPNeg extends DLPElementAdapter implements DLPLiteral
Atom.AtomImpl, Atom.RETURN_SET_PREDICATE
Constructor and Description |
---|
DLPNeg(DLPAtom inner) |
DLPNeg(DLPNeg other) |
DLPNeg(java.lang.String expr) |
DLPNeg(java.lang.String symbol,
java.util.List<Term<?>> terms)
Default constructor, creates an atom from a functor name
and a list of terms.
|
DLPNeg(java.lang.String symbol,
Term<?>... terms) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(Term<?> arg)
Adds an argument to the atom's argument list
|
DLPNeg |
clone()
Creates a deep copy of this formula
|
DLPLiteral |
cloneWithAddedTerm(Term<?> term)
Creates a copy of the literal and adds the
given term as argument to the end of the argument
list.
|
int |
compareTo(DLPLiteral o) |
DLPAtom |
complement() |
boolean |
equals(java.lang.Object o) |
java.util.List<? extends Term<?>> |
getArguments() |
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.
|
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.
|
DLPNeg |
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
DLPAtom atom
public DLPNeg(DLPAtom inner)
public DLPNeg(DLPNeg other)
public DLPNeg(java.lang.String symbol, Term<?>... terms)
public DLPNeg(java.lang.String symbol, java.util.List<Term<?>> terms)
symbol
- the functor nameterms
- the terms (arguments) of the atompublic DLPNeg(java.lang.String expr)
public DLPAtom getAtom()
getAtom
in interface DLPLiteral
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in interface SimpleLogicalFormula
equals
in class java.lang.Object
public boolean isGround()
ComplexLogicalFormula
isGround
in interface ComplexLogicalFormula
isGround
in class ComplexLogicalFormulaAdapter
public DLPNeg clone()
SimpleLogicalFormula
clone
in interface ComplexLogicalFormula
clone
in interface SimpleLogicalFormula
clone
in interface DLPElement
clone
in class DLPElementAdapter
public DLPAtom complement()
complement
in interface Invertable
complement
in interface DLPLiteral
public DLPLiteral cloneWithAddedTerm(Term<?> term)
DLPLiteral
cloneWithAddedTerm
in interface DLPLiteral
term
- the new argument.public int hashCode()
hashCode
in interface SimpleLogicalFormula
hashCode
in class java.lang.Object
public DLPNeg 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 java.lang.String getName()
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>