| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (5 out of 16)

Determining When Expressions Expire

Each value that G2 uses has an expiration time, which is the point in time when the value's expiration time interval runs out. Most G2 values have an expiration time of never, indicating they are valid indefinitely. Variables are the exception, because they are the only values in G2 that can expire. G2 determines a value's expiration time based on when the value was obtained at its source and on the explicit or implicit expiration time intervals of the sources for that value.

To illustrate, if your KB concludes a value into a variable at 1000 seconds of G2 clock time, and the variable's Validity-interval attribute contains the value 10 seconds, then the expiration time of this value is at 1010 seconds of G2 clock time. The validity interval of a variable is an example of an explicit expiration time interval.

If a value's expiration time interval has passed, that value has expired. A variable whose value has expired also has no current value.

The value that G2 obtains from evaluating an expression also has an expiration time. G2 determines this point in time as the current KB runs, based on the expiration times for the values that are the expression's terms. In some contexts, such as within an executing procedure, an expression's expiration time must be indefinite, or else G2 signals an error. In these cases, if evaluating an expression produces a value at all (that is, if G2 does not produce an error condition), that value never expires.

In other contexts, such as in rules and displays, G2 might evaluate an expression that refers to the expired value of a variable. In such cases, the expression's expiration time depends upon the expiration times of the values that are its terms.


Note: When G2 evaluates an expression that produces a no value condition, the expression's expiration time is also a no value condition.

For the majority of expressions, the expiration time is the minimum expiration time of its terms. A notable exception to this rule is an expression that includes the and operator. For more information, see Affecting the Expiration Time.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (5 out of 16)

Copyright © 1997 Gensym Corporation, Inc.