Triveni

triveni.tl
Class Expr

java.lang.Object
  |
  +--triveni.tl.Expr
Direct Known Subclasses:
AllPast, And, BackTo, Implies, Leaf, Not, Once, Or, Previous, Since

public abstract class Expr
extends java.lang.Object
implements java.lang.Cloneable

The class Expr is the common abstract superclass for all temporal logic formula classes.


Constructor Summary
Expr()
           
Expr(boolean v)
           
 
Method Summary
 boolean check()
          This method returns the value of the formula as it was last eval()uated.
abstract  java.lang.Object clone()
           
 boolean eval()
          This method evaluates the formula, by recursively evaluating its subformulas.
 boolean eval(java.lang.Object label)
          This method evaluates the formula for the given label.
 java.lang.Object[] getLabels()
          This method returns the labels that occur in the leaves of this formula.
 void reset()
          return time to "zero" by resetting the local state of this formula and all its subformulas.
 void set(boolean val)
          This method sets the value of an expression.
 void tick()
          This method advances the clock by one step.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expr

public Expr()

Expr

public Expr(boolean v)
Method Detail

clone

public abstract java.lang.Object clone()
Overrides:
clone in class java.lang.Object

set

public final void set(boolean val)
This method sets the value of an expression. for obvious reasons, this is only available to base Expr's. NOTE: at each time instant, set must be called with the appropriate value, otherwise, it maintains values across invocations of eval(). (this could be changed, if necessary, to automatically set all Exprs to false at the end of each eval.)

check

public final boolean check()
This method returns the value of the formula as it was last eval()uated. subformulas can be ckec()ed.

reset

public void reset()
return time to "zero" by resetting the local state of this formula and all its subformulas. use only on top-level formulas.

eval

public final boolean eval()
This method evaluates the formula, by recursively evaluating its subformulas. it is important that only top-level formulas be eval()uated, and only once during each "tick" of the system. each time eval is used on a top-level formula a "tick" takes place. once a formula is evaluated, its value and all its subformulas' value can be obtained through the check() method. in other words, eval modifies the states of the formulas and recurses, check does not.

eval

public final boolean eval(java.lang.Object label)
This method evaluates the formula for the given label. Leaves evaluate to true if and only if their label is equal to the given one.
See Also:
Leaf

tick

public void tick()
This method advances the clock by one step. Subclasses should override this method to advance their subformulas.

getLabels

public java.lang.Object[] getLabels()
This method returns the labels that occur in the leaves of this formula.

toString

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

Triveni

http://www.cs.luc.edu/triveni/