blog
Class ValueEvidenceStatement

java.lang.Object
  extended by blog.ValueEvidenceStatement

public class ValueEvidenceStatement
extends java.lang.Object

Represents a statement that a certain term has a certain value. Such a statement is of the form term = value. Currently the values are restricted to be zero-ary functions, so we don't have to worry about evaluating arguments on the righthand side.


Constructor Summary
ValueEvidenceStatement(Term leftSide, Term output)
          Creates a ValueEvidenceStatement of the form: leftSide = output.
 
Method Summary
 boolean checkTypesAndScope(Model model)
          Returns true if this statement satisfies type and scope constraints.
 int compile(java.util.LinkedHashSet callStack)
          Compiles both sides of this evidence statement, and initializes the observed variable and value.
 java.lang.Object getLocation()
          Returns an object whose toString method yields a description of the location where this statement occurred in an input file.
 java.lang.Object getObservedValue()
          Returns the observed value.
 BayesNetVar getObservedVar()
          Returns the observed variable.
 boolean isDetermined(PartialWorld w)
          Returns true if the given partial world is complete enough to determine whether this evidence statement is true or not.
 boolean isTrue(PartialWorld w)
          Returns true if, in this function evidence statement, the function application term and the output constant symbol have the same denotation in the given world.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValueEvidenceStatement

public ValueEvidenceStatement(Term leftSide,
                              Term output)
Creates a ValueEvidenceStatement of the form: leftSide = output.

Parameters:
leftSide - the term whose value is being specified.
output - a term denoting the value
Method Detail

getObservedVar

public BayesNetVar getObservedVar()
Returns the observed variable.

Throws:
java.lang.IllegalStateException - if compile has not yet been called.

getObservedValue

public java.lang.Object getObservedValue()
Returns the observed value.

Throws:
java.lang.IllegalStateException - if compile has not yet been called.

checkTypesAndScope

public boolean checkTypesAndScope(Model model)
Returns true if this statement satisfies type and scope constraints. If there is a type or scope error, prints a message to standard error and returns false.


compile

public int compile(java.util.LinkedHashSet callStack)
Compiles both sides of this evidence statement, and initializes the observed variable and value.


isDetermined

public boolean isDetermined(PartialWorld w)
Returns true if the given partial world is complete enough to determine whether this evidence statement is true or not.


isTrue

public boolean isTrue(PartialWorld w)
Returns true if, in this function evidence statement, the function application term and the output constant symbol have the same denotation in the given world.


getLocation

public java.lang.Object getLocation()
Returns an object whose toString method yields a description of the location where this statement occurred in an input file.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object