public class FOLAtom extends FolFormula implements Atom
Atom.AtomImpl, Atom.RETURN_SET_PREDICATE
Modifier and Type | Field and Description |
---|---|
private java.util.List<Term<?>> |
arguments
The arguments of the atom
|
private Predicate |
predicate
The predicate of this atom
|
Constructor and Description |
---|
FOLAtom()
Default-Ctor: Creates new empty FOL-Atom
|
FOLAtom(FOLAtom other) |
FOLAtom(Predicate predicate)
Creates a new atom with the given predicate and initializes
an empty argument list.
|
FOLAtom(Predicate predicate,
java.util.List<? extends Term<?>> arguments)
Creates a new atom with the given predicate and list of
terms
|
FOLAtom(Predicate predicate,
Term<?>... terms) |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(Term<?> term)
Appends the given argument to this atom's
arguments and returns itself.
|
FOLAtom |
clone()
Creates a deep copy of this formula
|
FolFormula |
collapseAssociativeFormulas()
This method collapses all associative operations appearing
in this term, e.g.
|
boolean |
containsQuantifier()
Checks whether this formula contains any quantification.
|
boolean |
equals(java.lang.Object obj) |
java.util.List<Term<?>> |
getArguments() |
java.util.Set<FOLAtom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
java.util.Set<Functor> |
getFunctors() |
java.lang.String |
getName() |
Predicate |
getPredicate()
Returns the predicate of this atom
|
java.util.Set<Predicate> |
getPredicates()
Processes the set of all predicates which appear in this
formula
|
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() |
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 |
isComplete()
Checks whether this atom is complete, i.e.
|
boolean |
isDnf()
Checks whether this formula is in disjunctive normal form.
|
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.
|
Atom.RETURN_SET_PREDICATE |
setPredicate(Predicate newer)
Changes the predicate of the atom.
|
FOLAtom |
substitute(Term<?> v,
Term<?> t)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
FolFormula |
toNnf()
Makes the negation normal form of this formula.
|
java.lang.String |
toString() |
combineWithAnd, combineWithOr, complement, getQuantifierVariables, getSignature, getUniformProbability, toDnf
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute
finalize, getClass, notify, notifyAll, wait, wait, wait
getPredicateCls
getSignature
private Predicate predicate
private java.util.List<Term<?>> arguments
public FOLAtom()
public FOLAtom(Predicate predicate)
predicate
- the predicate of the atom.public FOLAtom(Predicate predicate, java.util.List<? extends Term<?>> arguments)
predicate
- the predicate of the atomarguments
- the arguments (terms) of the atompublic FOLAtom(FOLAtom other)
public void addArgument(Term<?> term) throws java.lang.IllegalArgumentException
addArgument
in interface Atom
term
- an argument to be addedjava.lang.IllegalArgumentException
- if the given term does not correspond
to the expected sort or the argument list is complete.public FOLAtom substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException
RelationalFormula
substitute
in interface ComplexLogicalFormula
substitute
in class FolFormula
v
- the term to be substituted.t
- the term to substitute.java.lang.IllegalArgumentException
- if "v" and "t" are of different sorts
(NOTE: this exception is only thrown when "v" actually appears in this
formula).public java.util.Set<FOLAtom> getAtoms()
SimpleLogicalFormula
getAtoms
in interface SimpleLogicalFormula
getAtoms
in class RelationalFormula
public boolean isComplete()
isComplete
in interface Atom
public java.util.Set<Variable> getUnboundVariables()
getUnboundVariables
in interface QuantifiedFormula
public java.util.Set<Predicate> getPredicates()
SimpleLogicalFormula
getPredicates
in interface SimpleLogicalFormula
public java.util.Set<Functor> getFunctors()
getFunctors
in class RelationalFormula
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 containsQuantifier()
QuantifiedFormula
containsQuantifier
in interface QuantifiedFormula
public Predicate getPredicate()
getPredicate
in interface Atom
public java.util.List<Term<?>> getArguments()
getArguments
in interface Atom
public boolean isDnf()
FolFormula
isDnf
in class FolFormula
public boolean isLiteral()
isLiteral
in interface SimpleLogicalFormula
public java.lang.String toString()
toString
in class RelationalFormula
public FolFormula toNnf()
FolFormula
toNnf
in class FolFormula
public FolFormula collapseAssociativeFormulas()
FolFormula
collapseAssociativeFormulas
in class FolFormula
public int hashCode()
hashCode
in interface SimpleLogicalFormula
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface SimpleLogicalFormula
equals
in class java.lang.Object
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 FOLAtom clone()
SimpleLogicalFormula
clone
in interface ComplexLogicalFormula
clone
in interface SimpleLogicalFormula
clone
in class FolFormula
public Atom.RETURN_SET_PREDICATE setPredicate(Predicate newer)
Atom
setPredicate
in interface Atom