|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.ArgSpec blog.Term
public abstract class Term
Represents a Bayesian atom. All specific kinds of terms are expected to implement this interface.
Field Summary |
---|
Fields inherited from class blog.ArgSpec |
---|
location |
Constructor Summary | |
---|---|
Term()
|
Method Summary | |
---|---|
boolean |
containsTerm(Term target)
Returns true if the given term occurs in this term (or if the given term is equal to this term). |
abstract Term |
getCanonicalVersion()
Returns a version of this term that uses canonical terms as much as possible. |
java.util.Set |
getGenFuncsApplied(Term subject)
Returns the set of generating functions that are applied to the term subject by this term or any of its subterms. |
Term |
getTermInScope(Model model,
java.util.Map scope)
Returns an object representing this term in the given scope. |
abstract Type |
getType()
Returns the type of this term. |
boolean |
isConstantNull()
Returns true if this term is the constant term that always denotes Model.NULL. |
boolean |
isNumeric()
Returns true if the value of this ArgSpec is always an instance of Number (regardless of scope). |
Substitution |
makeOverlapSubst(Term t)
Function for computing a substitution that will make the two terms overlap. |
abstract boolean |
makeOverlapSubst(Term t,
Substitution theta)
Function for computing a substitution that will make the two terms overlap. |
Methods inherited from class blog.ArgSpec |
---|
checkTypesAndScope, compile, containsRandomSymbol, evaluate, evaluate, evaluate, getFreeVars, getLocation, getSubExprs, getSubstResult, getSubstResult, getValueIfNonRandom, getVariable, isDetermined, setLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Term()
Method Detail |
---|
public Term getTermInScope(Model model, java.util.Map scope)
The default implementation simply returns this object if checkTypesAndScope returns true, and null otherwise.
model
- a BLOG modelscope
- a map from String to LogicalVarpublic abstract Type getType()
public boolean containsTerm(Term target)
public java.util.Set getGenFuncsApplied(Term subject)
subject
by this term or any of its subterms.
The default implementation returns the union of the generating functions applied in this term's sub-expressions. This is overridden by FuncAppTerm.
public boolean isNumeric()
ArgSpec
isNumeric
in class ArgSpec
public boolean isConstantNull()
public Substitution makeOverlapSubst(Term t)
null
if there is no such
substitution.
public abstract boolean makeOverlapSubst(Term t, Substitution theta)
theta
. If there is no extension of
theta
that makes this term and t
overlap,
this method returns false.
public abstract Term getCanonicalVersion()
obj
of type type
is returned by
type.getCanonicalTerm(obj)
. A term can be
converted to canonical form only if it is non-random and has no
free variables (note that if the term is non-random, its value
must be a guaranteed object). This method returns a canonical
version of this term if possible; otherwise, it returns a
version where the subterms have been converted to canonical
form as much as possible.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |