|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EvalContext
Interface for objects that encapsulate a partial world and an assignment of values to logical variables. To facilitate debugging, an EvalContext object also maintains a separate stack of objects being evaluated.
Method Summary | |
---|---|
void |
assign(LogicalVar var,
java.lang.Object value)
Assigns the given value to the given logical variable, overwriting any previous value. |
void |
assignTuple(LogicalVar[] vars,
java.lang.Object[] values)
Assigns values to a tuple of logical variables. |
java.lang.String |
getAssignmentStr()
Returns a string describing the assignment of values to variables in this context. |
java.lang.Object |
getLogicalVarValue(LogicalVar var)
Returns the value of the given logical variable in this context, or null if the given logical variable has no assigned value. |
java.util.Set |
getLogicalVarValues()
Returns the set of objects that are the value of some logical variable in this context. |
NumberVar |
getPOPAppSatisfied(java.lang.Object obj)
Returns the NumberVar (i.e., POP and generating objects) such that the given object satisfies that POP applied to those generating objects in this world. |
ObjectSet |
getSatisfiers(NumberVar popApp)
Returns the set of objects that satisfy the given POP in this world. |
java.lang.Object |
getValue(BasicVar var)
Returns the value of the given basic random variable in this partial world, or null if the given variable is not instantiated. |
java.lang.Boolean |
objectExists(java.lang.Object obj)
Returns Boolean.TRUE if obj exists in all worlds
consistent with this context's partial world. |
void |
popEvaluee()
Pops the top object from the stack of objects being evaluated. |
void |
printEvalTrace(java.io.PrintStream s)
Prints the sequence of objects being evaluated, in the order they were added to the stack, to the given stream. |
void |
pushEvaluee(java.lang.Object evaluee)
Pushes the given object onto the stack of objects being evaluated. |
void |
unassign(LogicalVar var)
Erases any value currently assigned to the given logical variable. |
void |
unassignTuple(LogicalVar[] vars)
Erases any values currently assigned to any of the given logical variables. |
boolean |
usesIdentifiers(Type type)
Returns true if the world that underlies this context uses object identifiers for the given type. |
Method Detail |
---|
java.lang.Object getValue(BasicVar var)
ObjectSet getSatisfiers(NumberVar popApp)
The set returned by this method will remain correct if new basic random variables are instantiated. It may not remain correct if new identifiers are added or already-instantiated random variables are changed.
NumberVar getPOPAppSatisfied(java.lang.Object obj)
java.lang.IllegalArgumentException
- if the given object does not exist
in this worldboolean usesIdentifiers(Type type)
java.lang.Boolean objectExists(java.lang.Object obj)
obj
exists in all worlds
consistent with this context's partial world. This is true if
obj
is a guaranteed object, a concrete
non-guaranteed object whose number variable is instantiated to
a sufficiently large value, or an object identifier. Returns
Boolean.FALSE if obj
is a concrete non-guaranteed
object whose number variable is instantiated to a value that is
too small. If neither of the above cases holds, then this
method returns null.
java.lang.IllegalArgumentException
- if obj
is an identifier
that is not in the common ground
of this context's worldjava.lang.Object getLogicalVarValue(LogicalVar var)
java.util.Set getLogicalVarValues()
java.lang.String getAssignmentStr()
void assign(LogicalVar var, java.lang.Object value)
void assignTuple(LogicalVar[] vars, java.lang.Object[] values)
vars
- array of LogicalVar objectsvalues
- array of Objects, in one-to-one correspondence with
the elements of vars
, representing values
for those variables
java.lang.IllegalStateException
- if the assignment stack is emptyvoid unassign(LogicalVar var)
void unassignTuple(LogicalVar[] vars)
void pushEvaluee(java.lang.Object evaluee)
void popEvaluee()
java.lang.IllegalStateException
- if the stack of objects being evaluated
is emptyvoid printEvalTrace(java.io.PrintStream s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |