blog
Class SymbolEvidenceStatement

java.lang.Object
  extended by blog.SymbolEvidenceStatement

public class SymbolEvidenceStatement
extends java.lang.Object

Represents a symbol evidence statement, which is of the form type_name var_name:cond_formula = { symbol_list }.


Constructor Summary
SymbolEvidenceStatement(ImplicitSetSpec setSpec, java.util.List symbols)
          Creates a new SymbolEvidenceStatement saying that the objects satisfying the given implicit set specification are referred to by the given constant symbols.
 
Method Summary
 boolean checkTypesAndScope(Model model)
          Returns true if this statement satisfies type and scope constraints.
 int compile(java.util.LinkedHashSet callStack)
          Initializes the observed variable and value, and compiles the cardinality spec for the observed variable.
 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.Integer getObservedValue()
          Returns the observed value of the cardinality variable associated with this symbol evidence statement.
 DerivedVar getObservedVar()
          Returns the cardinality variable whose value is observed in this evidence statement.
 ImplicitSetSpec getSetSpec()
          Returns the implicit set specification that defines the set of objects labeled by the symbols.
 java.util.List getSkolemConstants()
          Returns a List of SkolemConstant objects representing the symbols introduced in this symbol evidence statement.
 boolean isDetermined(PartialWorld w)
          Returns true if the given partial world is complete enough to determine whether this symbol evidence statement is true: that is, it determines what objects satisfy this statement's set specification, and it instantiates all the symbols.
 boolean isTrue(PartialWorld w)
          Returns true if this symbol evidence statement is true in the given world: that is, its satisfying set has the right number of elements, and all of its symbols (if they are instantiated) refer to distinct elements of that set.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymbolEvidenceStatement

public SymbolEvidenceStatement(ImplicitSetSpec setSpec,
                               java.util.List symbols)
Creates a new SymbolEvidenceStatement saying that the objects satisfying the given implicit set specification are referred to by the given constant symbols.

Parameters:
setSpec - an implicit set specification
symbols - a List of Strings representing Skolem constant names
Method Detail

getSetSpec

public ImplicitSetSpec getSetSpec()
Returns the implicit set specification that defines the set of objects labeled by the symbols.


getSkolemConstants

public java.util.List getSkolemConstants()
Returns a List of SkolemConstant objects representing the symbols introduced in this symbol evidence statement.

Returns:
unmodifiable List of SkolemConstant objects

getObservedVar

public DerivedVar getObservedVar()
Returns the cardinality variable whose value is observed in this evidence statement.

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

getObservedValue

public java.lang.Integer getObservedValue()
Returns the observed value of the cardinality variable associated with this symbol evidence statement.

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)
Initializes the observed variable and value, and compiles the cardinality spec for the observed variable. Also compiles the dependency models for this statement's skolem constants.


isDetermined

public boolean isDetermined(PartialWorld w)
Returns true if the given partial world is complete enough to determine whether this symbol evidence statement is true: that is, it determines what objects satisfy this statement's set specification, and it instantiates all the symbols.


isTrue

public boolean isTrue(PartialWorld w)
Returns true if this symbol evidence statement is true in the given world: that is, its satisfying set has the right number of elements, and all of its symbols (if they are instantiated) refer to distinct elements of that set.


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